sorbet/rbi/gems/sprockets@3.7.2.rbi
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `sprockets` gem.
# Please instead update this file by running `bin/tapioca gem sprockets`.
# Define some basic Sprockets error classes
#
# source://sprockets-3.7.2/lib/sprockets/version.rb:1
module Sprockets
extend ::Sprockets::Utils
extend ::Sprockets::URIUtils
extend ::Sprockets::PathUtils
extend ::Sprockets::DigestUtils
extend ::Sprockets::PathDigestUtils
extend ::Sprockets::Dependencies
extend ::Sprockets::Compressing
extend ::Sprockets::ProcessorUtils
extend ::Sprockets::Processing
extend ::Sprockets::HTTPUtils
extend ::Sprockets::Transformers
extend ::Sprockets::Engines
extend ::Sprockets::Mime
extend ::Sprockets::Paths
extend ::Sprockets::Configuration
end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:4
class Sprockets::ArgumentError < ::Sprockets::Error; end
# source://sprockets-3.7.2/lib/sprockets/asset.rb:5
class Sprockets::Asset
# Private: Intialize Asset wrapper from attributes Hash.
#
# Asset wrappers should not be initialized directly, only
# Environment#find_asset should vend them.
#
# attributes - Hash of ivars
#
# Returns Asset.
#
# @return [Asset] a new instance of Asset
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:16
def initialize(environment, attributes = T.unsafe(nil)); end
# Public: Compare assets.
#
# Assets are equal if they share the same path and digest.
#
# Returns true or false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:195
def ==(other); end
# Public: Returns String base64 digest of source.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:137
def base64digest; end
# Public: Returns Integer length of source.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:118
def bytesize; end
# Public: Get charset of source.
#
# Returns a String charset name or nil if binary.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:113
def charset; end
# Public: Returns String MIME type of asset. Returns nil if type is unknown.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:72
def content_type; end
# Deprecated: Get all required Assets.
#
# See Asset#to_a
#
# Returns Array of Assets.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:206
def dependencies; end
# Public: Returns String hexdigest of source.
# Deprecated: Returns String hexdigest of source.
#
# In 4.x this will be changed to return a raw Digest byte String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:124
def digest; end
# Public: Return logical path with digest spliced in.
#
# "foo/bar-37b51d194a7513e45b56f6524f2d51f2.js"
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:67
def digest_path; end
# Public: Add enumerator to allow `Asset` instances to be used as Rack
# compatible body objects.
#
# block
# part - String body chunk
#
# Returns nothing.
#
# @yield [to_s]
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:153
def each; end
# Public: Compare assets.
#
# Assets are equal if they share the same path and digest.
#
# Returns true or false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:195
def eql?(other); end
# Public: Returns String hexdigest of source.
# Pubic: ETag String of Asset.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:124
def etag; end
# Public: Returns String path of asset.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:48
def filename; end
# Public: Implements Object#hash so Assets can be used as a Hash key or
# in a Set.
#
# Returns Integer hash of the id.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:186
def hash; end
# Public: Returns String hexdigest of source.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:124
def hexdigest; end
# Internal: Unique asset object ID.
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:53
def id; end
# Public: Get all internally required assets that were concated into this
# asset.
#
# Returns Array of String asset URIs.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:87
def included; end
# Public: Pretty inspect
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:178
def inspect; end
# Public: A "named information" URL for subresource integrity.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:142
def integrity; end
# Public: Returns Integer length of source.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:118
def length; end
# Public: Get all externally linked asset filenames from asset.
#
# All linked assets should be compiled anytime this asset is.
#
# Returns Set of String asset URIs.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:79
def links; end
# Returns the value of attribute logical_path.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:6
def logical_path; end
# Public: Metadata accumulated from pipeline process.
#
# The API status of the keys is dependent on the pipeline processors
# itself. So some values maybe considered public and others internal.
# See the pipeline proccessor documentation itself.
#
# Returns Hash.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:45
def metadata; end
# Deprecated: Returns Time of the last time the source was modified.
#
# Time resolution is normalized to the nearest second.
#
# Returns Time.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:215
def mtime; end
# Deprecated: Use #filename instead.
#
# Returns Pathname.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:176
def pathname; end
# Public: Return `String` of concatenated source.
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:94
def source; end
# Deprecated: Expand asset into an `Array` of parts.
#
# Appending all of an assets body parts together should give you
# the asset's contents as a whole.
#
# This allows you to link to individual files for debugging
# purposes.
#
# Use Asset#included instead. Keeping a full copy of the bundle's processed
# assets in memory (and in cache) is expensive and redundant. The common use
# case is to relink to the assets anyway.
#
# Returns Array of Assets.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:193
def to_a; end
# Internal: Return all internal instance variables as a hash.
#
# Returns a Hash.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:34
def to_hash; end
# Public: Alias for #source.
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:106
def to_s; end
# Public: Internal URI to lookup asset by.
#
# NOT a publically accessible URL.
#
# Returns URI.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:60
def uri; end
# Deprecated: Save asset to disk.
#
# filename - String target
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/asset.rb:162
def write_to(filename); end
end
# source://sprockets-3.7.2/lib/sprockets/autoload.rb:2
module Sprockets::Autoload; end
# source://sprockets-3.7.2/lib/sprockets/autoload/coffee_script.rb:5
Sprockets::Autoload::CoffeeScript = CoffeeScript
# source://sprockets-3.7.2/lib/sprockets/autoload/uglifier.rb:5
Sprockets::Autoload::Uglifier = Uglifier
# `Base` class for `Environment` and `Cached`.
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:18
class Sprockets::Base
include ::Sprockets::Utils
include ::Sprockets::PathUtils
include ::Sprockets::DigestUtils
include ::Sprockets::PathDigestUtils
include ::Sprockets::URIUtils
include ::Sprockets::PathDependencyUtils
include ::Sprockets::Dependencies
include ::Sprockets::Compressing
include ::Sprockets::ProcessorUtils
include ::Sprockets::Resolve
include ::Sprockets::Processing
include ::Sprockets::HTTPUtils
include ::Sprockets::Transformers
include ::Sprockets::Engines
include ::Sprockets::Mime
include ::Sprockets::Paths
include ::Sprockets::Configuration
include ::Sprockets::Server
include ::Sprockets::Loader
include ::Sprockets::Bower
# Preferred `find_asset` shorthand.
#
# environment['application.js']
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:91
def [](*args); end
# Get persistent cache store
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:26
def cache; end
# Set persistent cache store
#
# The cache store must implement a pair of getters and
# setters. Either `get(key)`/`set(key, value)`,
# `[key]`/`[key]=value`, `read(key)`/`write(key, value)`.
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:33
def cache=(cache); end
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:123
def cache_get(key); end
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:127
def cache_set(key, value); end
# Return an `Cached`. Must be implemented by the subclass.
#
# @raise [NotImplementedError]
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:38
def cached; end
# source://sprockets-3.7.2/lib/sprockets/base.rb:102
def compress_from_root(uri); end
# Deprecated: Iterate over all logical paths with a matcher.
#
# Remove from 4.x.
#
# args - List of matcher objects.
#
# Returns Enumerator if no block is given.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:79
def each_logical_path(*args, &block); end
# source://sprockets-3.7.2/lib/sprockets/base.rb:106
def expand_from_root(uri); end
# Internal: Compute digest for path.
#
# path - String filename or directory path.
#
# Returns a String digest or nil.
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:48
def file_digest(path); end
# @yield [asset]
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:70
def find_all_linked_assets(path, options = T.unsafe(nil)); end
# Find asset by logical path or expanded path.
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:63
def find_asset(path, options = T.unsafe(nil)); end
# Return an `Cached`. Must be implemented by the subclass.
#
# @raise [NotImplementedError]
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:38
def index; end
# Pretty inspect
#
# source://sprockets-3.7.2/lib/sprockets/base.rb:96
def inspect; end
# Deprecated: Enumerate over all logical paths in the environment.
#
# Returns an Enumerator of [logical_path, filename].
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:99
def logical_paths; end
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:131
def normalize_logical_path(path); end
# Deprecated: Change default return type of resolve() to return 2.x
# compatible plain filename String. 4.x will always return an Asset URI
# and a set of file system dependencies that had to be read to compute the
# result.
#
# 2.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# 3.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: true)
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: false)
# # => [
# # "file:///path/to/app/javascripts/foo.js?type=application/javascript"
# # #<Set: {"file-digest:/path/to/app/javascripts/foo.js"}>
# # ]
#
# 4.x
#
# resolve("foo.js")
# # => [
# # "file:///path/to/app/javascripts/foo.js?type=application/javascript"
# # #<Set: {"file-digest:/path/to/app/javascripts/foo.js"}>
# # ]
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:55
def resolve(path, options = T.unsafe(nil)); end
# Deprecated: Change default return type of resolve() to return 2.x
# compatible plain filename String. 4.x will always return an Asset URI
# and a set of file system dependencies that had to be read to compute the
# result.
#
# 2.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# 3.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: true)
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: false)
# # => [
# # "file:///path/to/app/javascripts/foo.js?type=application/javascript"
# # #<Set: {"file-digest:/path/to/app/javascripts/foo.js"}>
# # ]
#
# 4.x
#
# resolve("foo.js")
# # => [
# # "file:///path/to/app/javascripts/foo.js?type=application/javascript"
# # #<Set: {"file-digest:/path/to/app/javascripts/foo.js"}>
# # ]
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:55
def resolve_with_compat(path, options = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:23
def resolve_without_compat(path, options = T.unsafe(nil)); end
private
# Deprecated: Seriously.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:139
def matches_filter(filters, logical_path, filename); end
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:160
def unescape(str); end
end
# source://sprockets-3.7.2/lib/sprockets/bower.rb:4
module Sprockets::Bower
# Internal: Read bower.json's main directive.
#
# dirname - String path to component directory.
# filename - String path to bower.json.
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/bower.rb:45
def read_bower_main(dirname, filename); end
# Internal: Override resolve_alternates to install bower.json behavior.
#
# load_path - String environment path
# logical_path - String path relative to base
#
# Returns candiate filenames.
#
# source://sprockets-3.7.2/lib/sprockets/bower.rb:16
def resolve_alternates(load_path, logical_path); end
end
# Internal: All supported bower.json files.
#
# https://github.com/bower/json/blob/0.4.0/lib/json.js#L7
#
# source://sprockets-3.7.2/lib/sprockets/bower.rb:8
Sprockets::Bower::POSSIBLE_BOWER_JSONS = T.let(T.unsafe(nil), Array)
# Internal: Bundle processor takes a single file asset and prepends all the
# `:required` URIs to the contents.
#
# Uses pipeline metadata:
#
# :required - Ordered Set of asset URIs to prepend
# :stubbed - Set of asset URIs to substract from the required set.
#
# Also see DirectiveProcessor.
#
# source://sprockets-3.7.2/lib/sprockets/bundle.rb:14
class Sprockets::Bundle
class << self
# source://sprockets-3.7.2/lib/sprockets/bundle.rb:15
def call(input); end
# Internal: Run bundle reducers on set of Assets producing a reduced
# metadata Hash.
#
# assets - Array of Assets
# reducers - Array of [initial, reducer_proc] pairs
#
# Returns reduced asset metadata Hash.
#
# source://sprockets-3.7.2/lib/sprockets/bundle.rb:44
def process_bundle_reducers(assets, reducers); end
end
end
# Public: Wrapper interface to backend cache stores. Ensures a consistent API
# even when the backend uses get/set or read/write.
#
# Public cache interface
#
# Always assign the backend store instance to Environment#cache=.
#
# environment.cache = Sprockets::Cache::MemoryStore.new(1000)
#
# Environment#cache will always return a wrapped Cache interface. See the
# methods marked public on this class.
#
#
# Backend cache interface
#
# The Backend cache store must implement two methods.
#
# get(key)
#
# key - An opaque String with a length less than 250 characters.
#
# Returns an JSON serializable object.
#
# set(key, value)
#
# Will only be called once per key. Setting a key "foo" with value "bar",
# then later key "foo" with value "baz" is an undefined behavior.
#
# key - An opaque String with a length less than 250 characters.
# value - A JSON serializable object.
#
# Returns argument value.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:38
class Sprockets::Cache
# Internal: Wrap a backend cache store.
#
# Always assign a backend cache store instance to Environment#cache= and
# use Environment#cache to retreive a wrapped interface.
#
# cache - A compatible backend cache store instance.
#
# @return [Cache] a new instance of Cache
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:61
def initialize(cache = T.unsafe(nil), logger = T.unsafe(nil)); end
# Public: Prefer API to retrieve and set values in the cache store.
#
# key - JSON serializable key
# block -
# Must return a consistent JSON serializable object for the given key.
#
# Examples
#
# cache.fetch("foo") { "bar" }
#
# Returns a JSON serializable object.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:78
def fetch(key); end
# Public: Low level API to retrieve item directly from the backend cache
# store.
#
# This API may be used publicly, but may have undefined behavior
# depending on the backend store being used. Prefer the
# Cache#fetch API over using this.
#
# key - JSON serializable key
# local - Check local cache first (default: false)
#
# Returns a JSON serializable object or nil if there was a cache miss.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:108
def get(key, local = T.unsafe(nil)); end
# Public: Pretty inspect
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:142
def inspect; end
# Public: Low level API to set item directly to the backend cache store.
#
# This API may be used publicly, but may have undefined behavior
# depending on the backend store being used. Prefer the
# Cache#fetch API over using this.
#
# key - JSON serializable key
# value - A consistent JSON serializable object for the given key. Setting
# a different value for the given key has undefined behavior.
# local - Set on local cache (default: false)
#
# Returns the value argument.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:133
def set(key, value, local = T.unsafe(nil)); end
private
# Internal: Expand object cache key into a short String key.
#
# The String should be under 250 characters so its compatible with
# Memcache.
#
# key - JSON serializable key
#
# Returns a String with a length less than 250 characters.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:155
def expand_key(key); end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:181
def get_cache_wrapper(cache); end
# Internal: Show first 100 characters of cache key for logging purposes.
#
# Returns a String with a length less than 100 characters.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:166
def peek_key(key); end
class << self
# source://sprockets-3.7.2/lib/sprockets/cache.rb:49
def default_logger; end
end
end
# Public: A file system cache store that automatically cleans up old keys.
#
# Assign the instance to the Environment#cache.
#
# environment.cache = Sprockets::Cache::FileStore.new("/tmp")
#
# See Also
#
# ActiveSupport::Cache::FileStore
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:19
class Sprockets::Cache::FileStore
# Public: Initialize the cache store.
#
# root - A String path to a directory to persist cached values to.
# max_size - A Integer of the maximum number of keys the store will hold.
# (default: 1000).
#
# @return [FileStore] a new instance of FileStore
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:37
def initialize(root, max_size = T.unsafe(nil), logger = T.unsafe(nil)); end
# Public: Retrieve value from cache.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
#
# Returns Object or nil or the value is not set.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:51
def get(key); end
# Public: Pretty inspect
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:121
def inspect; end
# Public: Set a key and value in the cache.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
# value - Object value.
#
# Returns Object value.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:80
def set(key, value); end
private
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:144
def compute_size(caches); end
# Internal: Get all cache files along with stats.
#
# Returns an Array of [String filename, File::Stat] pairs sorted by
# mtime.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:130
def find_caches; end
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:161
def gc!; end
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:154
def safe_open(path, &block); end
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:148
def safe_stat(fn); end
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:140
def size; end
class << self
# Internal: Default standard error fatal logger.
#
# Returns a Logger.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:26
def default_logger; end
end
end
# Internal: Default key limit for store.
#
# source://sprockets-3.7.2/lib/sprockets/cache/file_store.rb:21
Sprockets::Cache::FileStore::DEFAULT_MAX_SIZE = T.let(T.unsafe(nil), Integer)
# source://sprockets-3.7.2/lib/sprockets/cache.rb:206
class Sprockets::Cache::GetWrapper < ::Sprockets::Cache::Wrapper
# source://sprockets-3.7.2/lib/sprockets/cache.rb:207
def get(key); end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:211
def set(key, value); end
end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:216
class Sprockets::Cache::HashWrapper < ::Sprockets::Cache::Wrapper
# source://sprockets-3.7.2/lib/sprockets/cache.rb:217
def get(key); end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:221
def set(key, value); end
end
# Public: Basic in memory LRU cache.
#
# Assign the instance to the Environment#cache.
#
# environment.cache = Sprockets::Cache::MemoryStore.new(1000)
#
# See Also
#
# ActiveSupport::Cache::MemoryStore
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:13
class Sprockets::Cache::MemoryStore
# Public: Initialize the cache store.
#
# max_size - A Integer of the maximum number of keys the store will hold.
# (default: 1000).
#
# @return [MemoryStore] a new instance of MemoryStore
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:21
def initialize(max_size = T.unsafe(nil)); end
# Public: Retrieve value from cache.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
#
# Returns Object or nil or the value is not set.
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:33
def get(key); end
# Public: Pretty inspect
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:61
def inspect; end
# Public: Set a key and value in the cache.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
# value - Object value.
#
# Returns Object value.
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:51
def set(key, value); end
end
# Internal: Default key limit for store.
#
# source://sprockets-3.7.2/lib/sprockets/cache/memory_store.rb:15
Sprockets::Cache::MemoryStore::DEFAULT_MAX_SIZE = T.let(T.unsafe(nil), Integer)
# Public: A compatible cache store that doesn't store anything. Used by
# default when no Environment#cache is configured.
#
# Assign the instance to the Environment#cache.
#
# environment.cache = Sprockets::Cache::NullStore.new
#
# See Also
#
# ActiveSupport::Cache::NullStore
#
# source://sprockets-3.7.2/lib/sprockets/cache/null_store.rb:14
class Sprockets::Cache::NullStore
# Public: Simulate a cache miss.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
#
# Returns nil.
#
# source://sprockets-3.7.2/lib/sprockets/cache/null_store.rb:22
def get(key); end
# Public: Pretty inspect
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/cache/null_store.rb:41
def inspect; end
# Public: Simulate setting a value in the cache.
#
# This API should not be used directly, but via the Cache wrapper API.
#
# key - String cache key.
# value - Object value.
#
# Returns Object value.
#
# source://sprockets-3.7.2/lib/sprockets/cache/null_store.rb:34
def set(key, value); end
end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:161
Sprockets::Cache::PEEK_SIZE = T.let(T.unsafe(nil), Integer)
# source://sprockets-3.7.2/lib/sprockets/cache.rb:226
class Sprockets::Cache::ReadWriteWrapper < ::Sprockets::Cache::Wrapper
# source://sprockets-3.7.2/lib/sprockets/cache.rb:227
def get(key); end
# source://sprockets-3.7.2/lib/sprockets/cache.rb:231
def set(key, value); end
end
# Internal: Cache key version for this class. Rarely should have to change
# unless the cache format radically changes. Will be bump on major version
# releases though.
#
# source://sprockets-3.7.2/lib/sprockets/cache.rb:47
Sprockets::Cache::VERSION = T.let(T.unsafe(nil), String)
# source://sprockets-3.7.2/lib/sprockets/cache.rb:203
class Sprockets::Cache::Wrapper < ::Struct; end
# `Cached` is a special cached version of `Environment`.
#
# The expection is that all of its file system methods are cached
# for the instances lifetime. This makes `Cached` much faster. This
# behavior is ideal in production environments where the file system
# is immutable.
#
# `Cached` should not be initialized directly. Instead use
# `Environment#cached`.
#
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:13
class Sprockets::CachedEnvironment < ::Sprockets::Base
# @return [CachedEnvironment] a new instance of CachedEnvironment
#
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:14
def initialize(environment); end
# Internal: Cache Environment#entries
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:54
def _entries(path); end
# Internal: Cache Environment#load
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:32
def _load(uri); end
# Internal: Cache Environment#processor_cache_key
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:92
def _processor_cache_key(processor); end
# Internal: Cache Environment#resolve_dependency
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:57
def _resolve_dependency(str); end
# Internal: Cache Environment#stat
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:14
def _stat(path); end
# No-op return self as cached environment.
#
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:27
def cached; end
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:34
def entries(path); end
# No-op return self as cached environment.
#
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:27
def index; end
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:46
def load(uri); end
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:52
def processor_cache_key(str); end
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:58
def resolve_dependency(str); end
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:40
def stat(path); end
private
# Cache is immutable, any methods that try to change the runtime config
# should bomb.
#
# @raise [RuntimeError]
#
# source://sprockets-3.7.2/lib/sprockets/cached_environment.rb:65
def config=(config); end
end
# Public: Closure Compiler minifier.
#
# To accept the default options
#
# environment.register_bundle_processor 'application/javascript',
# Sprockets::ClosureCompressor
#
# Or to pass options to the Closure::Compiler class.
#
# environment.register_bundle_processor 'application/javascript',
# Sprockets::ClosureCompressor.new({ ... })
#
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:17
class Sprockets::ClosureCompressor
# @return [ClosureCompressor] a new instance of ClosureCompressor
#
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:37
def initialize(options = T.unsafe(nil)); end
# Returns the value of attribute cache_key.
#
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:35
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:42
def call(input); end
class << self
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:31
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:27
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns ClosureCompressor object.
#
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:23
def instance; end
end
end
# source://sprockets-3.7.2/lib/sprockets/closure_compressor.rb:18
Sprockets::ClosureCompressor::VERSION = T.let(T.unsafe(nil), String)
# Processor engine class for the CoffeeScript compiler.
# Depends on the `coffee-script` and `coffee-script-source` gems.
#
# For more infomation see:
#
# https://github.com/josh/ruby-coffee-script
#
# source://sprockets-3.7.2/lib/sprockets/coffee_script_processor.rb:11
module Sprockets::CoffeeScriptProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/coffee_script_processor.rb:14
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/coffee_script_processor.rb:18
def call(input); end
end
end
# source://sprockets-3.7.2/lib/sprockets/coffee_script_processor.rb:12
Sprockets::CoffeeScriptProcessor::VERSION = T.let(T.unsafe(nil), String)
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/coffee_script_template.rb:5
module Sprockets::CoffeeScriptTemplate
class << self
# source://sprockets-3.7.2/lib/sprockets/coffee_script_template.rb:8
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/coffee_script_template.rb:12
def call(*args); end
end
end
# source://sprockets-3.7.2/lib/sprockets/coffee_script_template.rb:6
Sprockets::CoffeeScriptTemplate::VERSION = T.let(T.unsafe(nil), String)
# `Compressing` is an internal mixin whose public methods are exposed on
# the `Environment` and `CachedEnvironment` classes.
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:6
module Sprockets::Compressing
include ::Sprockets::Utils
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:9
def compressors; end
# Return CSS compressor or nil if none is set
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:21
def css_compressor; end
# Assign a compressor to run on `text/css` assets.
#
# The compressor object must respond to `compress`.
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:30
def css_compressor=(compressor); end
# Public: Enable or disable the creation of Gzip files.
#
# Defaults to true.
#
# environment.gzip = false
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:90
def gzip=(gzip); end
# Public: Checks if Gzip is enabled.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:75
def gzip?; end
# Return JS compressor or nil if none is set
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:48
def js_compressor; end
# Assign a compressor to run on `application/javascript` assets.
#
# The compressor object must respond to `compress`.
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:57
def js_compressor=(compressor); end
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:13
def register_compressor(mime_type, sym, klass); end
# Public: Checks if Gzip is disabled.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/compressing.rb:80
def skip_gzip?; end
end
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:11
module Sprockets::Configuration
include ::Sprockets::Utils
include ::Sprockets::URIUtils
include ::Sprockets::PathUtils
include ::Sprockets::DigestUtils
include ::Sprockets::PathDigestUtils
include ::Sprockets::Dependencies
include ::Sprockets::Compressing
include ::Sprockets::ProcessorUtils
include ::Sprockets::Processing
include ::Sprockets::HTTPUtils
include ::Sprockets::Transformers
include ::Sprockets::Engines
include ::Sprockets::Mime
include ::Sprockets::Paths
# Returns the value of attribute computed_config.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:23
def computed_config; end
# Sets the attribute computed_config
#
# @param value the value to set the attribute computed_config to.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:23
def computed_config=(_arg0); end
# Returns the value of attribute config.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:21
def config; end
# @raise [TypeError]
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:25
def config=(config); end
# Deprecated: Get `Context` class.
#
# This class maybe mutated and mixed in with custom helpers.
#
# environment.context_class.instance_eval do
# include MyHelpers
# def asset_url; end
# end
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:81
def context_class; end
# Public: Returns a `Digest` implementation class.
#
# Defaults to `Digest::SHA256`.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:58
def digest_class; end
# Deprecated: Assign a `Digest` implementation class. This maybe any Ruby
# `Digest::` implementation such as `Digest::SHA256` or
# `Digest::MD5`.
#
# environment.digest_class = Digest::MD5
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:68
def digest_class=(klass); end
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:14
def initialize_configuration(parent); end
# Get and set `Logger` instance.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:31
def logger; end
# Get and set `Logger` instance.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:31
def logger=(_arg0); end
# The `Environment#version` is a custom value used for manually
# expiring all asset caches.
#
# Sprockets is able to track most file and directory changes and
# will take care of expiring the cache for you. However, its
# impossible to know when any custom helpers change that you mix
# into the `Context`.
#
# It would be wise to increment this value anytime you make a
# configuration change to the `Environment` object.
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:43
def version; end
# Assign an environment version.
#
# environment.version = '2.0'
#
# source://sprockets-3.7.2/lib/sprockets/configuration.rb:51
def version=(version); end
end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:5
class Sprockets::ContentTypeMismatch < ::Sprockets::Error; end
# Deprecated: `Context` provides helper methods to all processors.
# They are typically accessed by ERB templates. You can mix in custom helpers
# by injecting them into `Environment#context_class`. Do not mix them into
# `Context` directly.
#
# environment.context_class.class_eval do
# include MyHelper
# def asset_url; end
# end
#
# <%= asset_url "foo.png" %>
#
# The `Context` also collects dependencies declared by
# assets. See `DirectiveProcessor` for an example of this.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:21
class Sprockets::Context
# @return [Context] a new instance of Context
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:27
def initialize(input); end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:25
def __LINE__; end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:25
def __LINE__=(_arg0); end
# Returns a Base64-encoded `data:` URI with the contents of the
# asset at the specified path, and marks that path as a dependency
# of the current file.
#
# Use `asset_data_uri` from ERB with CSS or JavaScript assets:
#
# #logo { background: url(<%= asset_data_uri 'logo.png' %>) }
#
# $('<img>').attr('src', '<%= asset_data_uri 'avatar.jpg' %>')
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:175
def asset_data_uri(path); end
# Expands logical path to full url to asset.
#
# NOTE: This helper is currently not implemented and should be
# customized by the application. Though, in the future, some
# basics implemention may be provided with different methods that
# are required to be overridden.
#
# @raise [NotImplementedError]
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:187
def asset_path(path, options = T.unsafe(nil)); end
# Expand logical audio asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:212
def audio_path(path); end
# Returns content type of file
#
# 'application/javascript'
# 'text/css'
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:70
def content_type; end
# `depend_on` allows you to state a dependency on a file without
# including it.
#
# This is used for caching purposes. Any changes made to
# the dependency file with invalidate the cache of the
# source file.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:110
def depend_on(path); end
# `depend_on_asset` allows you to state an asset dependency
# without including it.
#
# This is used for caching purposes. Any changes that would
# invalidate the dependency asset will invalidate the source
# file. Unlike `depend_on`, this will include recursively include
# the target asset's dependencies.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:128
def depend_on_asset(path); end
# Returns the value of attribute environment.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:22
def environment; end
# Returns the value of attribute filename.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:22
def filename; end
# Expand logical font asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:217
def font_path(path); end
# Expand logical image asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:202
def image_path(path); end
# Expand logical javascript asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:222
def javascript_path(path); end
# `link_asset` declares an external dependency on an asset without directly
# including it. The target asset is returned from this function making it
# easy to construct a link to it.
#
# Returns an Asset or nil.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:159
def link_asset(path); end
# Public: Load Asset by AssetURI and track it as a dependency.
#
# uri - AssetURI
#
# Returns Asset.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:98
def load(uri); end
# Returns the environment path that contains the file.
#
# If `app/javascripts` and `app/stylesheets` are in your path, and
# current file is `app/javascripts/foo/bar.js`, `load_path` would
# return `app/javascripts`.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:55
def load_path; end
# Returns logical path without any file extensions.
#
# 'app/javascripts/application.js'
# # => 'application'
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:63
def logical_path; end
# source://sprockets-3.7.2/lib/sprockets/context.rb:43
def metadata; end
# Returns the value of attribute pathname.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:22
def pathname; end
# `require_asset` declares `path` as a dependency of the file. The
# dependency will be inserted before the file and will only be
# included once.
#
# If ERB processing is enabled, you can use it to dynamically
# require assets.
#
# <%= require_asset "#{framework}.js" %>
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:141
def require_asset(path); end
# Deprecated: Change default return type of resolve() to return 2.x
# compatible plain filename String. 4.x will always return an Asset URI.
#
# 2.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# 3.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: true)
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: false)
# # => "file:///path/to/app/javascripts/foo.js?type=application/javascript"
#
# 4.x
#
# resolve("foo.js")
# # => "file:///path/to/app/javascripts/foo.js?type=application/javascript"
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:245
def resolve(path, options = T.unsafe(nil)); end
# Deprecated: Change default return type of resolve() to return 2.x
# compatible plain filename String. 4.x will always return an Asset URI.
#
# 2.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# 3.x
#
# resolve("foo.js")
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: true)
# # => "/path/to/app/javascripts/foo.js"
#
# resolve("foo.js", compat: false)
# # => "file:///path/to/app/javascripts/foo.js?type=application/javascript"
#
# 4.x
#
# resolve("foo.js")
# # => "file:///path/to/app/javascripts/foo.js?type=application/javascript"
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:245
def resolve_with_compat(path, options = T.unsafe(nil)); end
# Public: Given a logical path, `resolve` will find and return an Asset URI.
# Relative paths will also be resolved. An accept type maybe given to
# restrict the search.
#
# resolve("foo.js")
# # => "file:///path/to/app/javascripts/foo.js?type=application/javascript"
#
# resolve("./bar.js")
# # => "file:///path/to/app/javascripts/bar.js?type=application/javascript"
#
# path - String logical or absolute path
# options
# accept - String content accept type
#
# Returns an Asset URI String.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:87
def resolve_without_compat(path, options = T.unsafe(nil)); end
# Returns the environment path that contains the file.
#
# If `app/javascripts` and `app/stylesheets` are in your path, and
# current file is `app/javascripts/foo/bar.js`, `load_path` would
# return `app/javascripts`.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:55
def root_path; end
# `stub_asset` blacklists `path` from being included in the bundle.
# `path` must be an asset which may or may not already be included
# in the bundle.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:149
def stub_asset(path); end
# Expand logical stylesheet asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:227
def stylesheet_path(path); end
# Expand logical video asset path.
#
# source://sprockets-3.7.2/lib/sprockets/context.rb:207
def video_path(path); end
end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:8
class Sprockets::ConversionError < ::Sprockets::NotFound; end
# `Dependencies` is an internal mixin whose public methods are exposed on the
# `Environment` and `CachedEnvironment` classes.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:8
module Sprockets::Dependencies
include ::Sprockets::URIUtils
include ::Sprockets::PathUtils
include ::Sprockets::DigestUtils
include ::Sprockets::PathDigestUtils
# Public: Add environmental dependency inheirted by all assets.
#
# uri - String dependency URI
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:47
def add_dependency(uri); end
# Public: Add environmental dependency inheirted by all assets.
#
# uri - String dependency URI
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:47
def depend_on(uri); end
# Public: Default set of dependency URIs for assets.
#
# Returns Set of String URIs.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:24
def dependencies; end
# Public: Mapping dependency schemes to resolver functions.
#
# key - String scheme
# value - Proc.call(Environment, String)
#
# Returns Hash.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:17
def dependency_resolvers; end
# Public: Register new dependency URI resolver.
#
# scheme - String scheme
# block -
# environment - Environment
# uri - String dependency URI
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:36
def register_dependency_resolver(scheme, &block); end
# Internal: Resolve dependency URIs.
#
# Returns resolved Object.
#
# source://sprockets-3.7.2/lib/sprockets/dependencies.rb:57
def resolve_dependency(str); end
end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:2
class Sprockets::Deprecation
# @return [Deprecation] a new instance of Deprecation
#
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:25
def initialize(callstack = T.unsafe(nil)); end
# Returns the value of attribute callstack.
#
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:16
def callstack; end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:29
def warn(message); end
private
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:77
def _extract_callstack; end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:37
def behavior; end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:41
def behavior=(behavior); end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:50
def deprecation_caller_message; end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:45
def deprecation_message(message = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:67
def extract_callstack; end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:63
def ignored_callstack(path); end
class << self
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:18
def silence(&block); end
end
end
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:4
Sprockets::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash)
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:61
Sprockets::Deprecation::SPROCKETS_GEM_ROOT = T.let(T.unsafe(nil), String)
# source://sprockets-3.7.2/lib/sprockets/deprecation.rb:3
Sprockets::Deprecation::THREAD_LOCAL__SILENCE_KEY = T.let(T.unsafe(nil), String)
# Internal: Hash functions and digest related utilities. Mixed into
# Environment.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:9
module Sprockets::DigestUtils
extend ::Sprockets::DigestUtils
# Internal: Detect digest class hash algorithm for digest bytes.
#
# While not elegant, all the supported digests have a unique bytesize.
#
# Returns Digest::Base or nil.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:33
def detect_digest_class(bytes); end
# Internal: Generate a hexdigest for a nested JSON serializable object.
#
# This is used for generating cache keys, so its pretty important its
# wicked fast. Microbenchmarks away!
#
# obj - A JSON serializable object.
#
# Returns a String digest of the object.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:95
def digest(obj); end
# Internal: Default digest class.
#
# Returns a Digest::Base subclass.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:15
def digest_class; end
# Public: Generate hash for use in the `integrity` attribute of an asset tag
# as per the subresource integrity specification.
#
# digest - The String hexbyte digest of the asset content.
#
# Returns a String or nil if hash algorithm is incompatible.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:176
def hexdigest_integrity_uri(hexdigest); end
# Public: Generate hash for use in the `integrity` attribute of an asset tag
# as per the subresource integrity specification.
#
# digest - The String byte digest of the asset content.
#
# Returns a String or nil if hash algorithm is incompatible.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:154
def integrity_uri(digest); end
# Internal: Pack a binary digest to a base64 encoded string.
#
# bin - String bytes
#
# Returns base64 String.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:125
def pack_base64digest(bin); end
# Internal: Pack a binary digest to a hex encoded string.
#
# bin - String bytes
#
# Returns hex String.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:107
def pack_hexdigest(bin); end
# Internal: Pack a binary digest to a urlsafe base64 encoded string.
#
# bin - String bytes
#
# Returns urlsafe base64 String.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:134
def pack_urlsafe_base64digest(bin); end
# Internal: Unpack a hex encoded digest string into binary bytes.
#
# hex - String hex
#
# Returns binary String.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:116
def unpack_hexdigest(hex); end
end
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:37
Sprockets::DigestUtils::ADD_VALUE_TO_DIGEST = T.let(T.unsafe(nil), Hash)
# Internal: Maps digest bytesize to the digest class.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:20
Sprockets::DigestUtils::DIGEST_SIZES = T.let(T.unsafe(nil), Hash)
# Internal: Maps digest class to the CSP hash algorithm name.
#
# source://sprockets-3.7.2/lib/sprockets/digest_utils.rb:142
Sprockets::DigestUtils::HASH_ALGORITHMS = T.let(T.unsafe(nil), Hash)
# The `DirectiveProcessor` is responsible for parsing and evaluating
# directive comments in a source file.
#
# A directive comment starts with a comment prefix, followed by an "=",
# then the directive name, then any arguments.
#
# // JavaScript
# //= require "foo"
#
# # CoffeeScript
# #= require "bar"
#
# /* CSS
# *= require "baz"
# */
#
# This makes it possible to disable or modify the processor to do whatever
# you'd like. You could add your own custom directives or invent your own
# directive syntax.
#
# `Environment#processors` includes `DirectiveProcessor` by default.
#
# To remove the processor entirely:
#
# env.unregister_processor('text/css', Sprockets::DirectiveProcessor)
# env.unregister_processor('application/javascript', Sprockets::DirectiveProcessor)
#
# Then inject your own preprocessor:
#
# env.register_processor('text/css', MyProcessor)
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:36
class Sprockets::DirectiveProcessor
# @return [DirectiveProcessor] a new instance of DirectiveProcessor
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:63
def initialize(options = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:71
def _call(input); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:67
def call(input); end
protected
# Directives will only be picked up if they are in the header
# of the source file. C style (/* */), JavaScript (//), and
# Ruby (#) comments are supported.
#
# Directives in comments after the first non-whitespace line
# of code will not be processed.
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:99
def compile_header_pattern(comments); end
# Returns an Array of directive structures. Each structure
# is an Array with the line number as the first element, the
# directive name as the second element, followed by any
# arguments.
#
# [[1, "require", "foo"], [2, "require", "bar"]]
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:136
def extract_directives(header); end
# Allows you to state a dependency on an asset without including
# it.
#
# This is used for caching purposes. Any changes that would
# invalid the asset dependency will invalidate the cache our the
# source file.
#
# Unlike `depend_on`, the path must be a requirable asset.
#
# //= depend_on_asset "bar.js"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:275
def process_depend_on_asset_directive(path); end
# Allows you to state a dependency on a file without
# including it.
#
# This is used for caching purposes. Any changes made to
# the dependency file will invalidate the cache of the
# source file.
#
# This is useful if you are using ERB and File.read to pull
# in contents from another file.
#
# //= depend_on "foo.png"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:260
def process_depend_on_directive(path); end
# Gathers comment directives in the source and processes them.
# Any directive method matching `process_*_directive` will
# automatically be available. This makes it easy to extend the
# processor.
#
# To implement a custom directive called `require_glob`, subclass
# `Sprockets::DirectiveProcessor`, then add a method called
# `process_require_glob_directive`.
#
# class DirectiveProcessor < Sprockets::DirectiveProcessor
# def process_require_glob_directive
# Dir["#{dirname}/#{glob}"].sort.each do |filename|
# require(filename)
# end
# end
# end
#
# Replace the current processor on the environment with your own:
#
# env.unregister_processor('text/css', Sprockets::DirectiveProcessor)
# env.register_processor('text/css', DirectiveProcessor)
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:177
def process_directives(directives); end
# Declares a linked dependency on the target asset.
#
# The `path` must be a valid asset and should not already be part of the
# bundle. Any linked assets will automatically be compiled along with the
# current.
#
# /*= link "logo.png" */
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:299
def process_link_directive(path); end
# `link_directory` links all the files inside a single
# directory. It's similar to `path/*` since it does not follow
# nested directories.
#
# //= link_directory "./fonts"
#
# Use caution when linking against JS or CSS assets. Include an explicit
# extension or content type in these cases
#
# //= link_directory "./scripts" .js
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:314
def process_link_directory_directive(path = T.unsafe(nil), accept = T.unsafe(nil)); end
# `link_tree` links all the nested files in a directory.
# Its glob equivalent is `path/**/*`.
#
# //= link_tree "./images"
#
# Use caution when linking against JS or CSS assets. Include an explicit
# extension or content type in these cases
#
# //= link_tree "./styles" .css
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:330
def process_link_tree_directive(path = T.unsafe(nil), accept = T.unsafe(nil)); end
# The `require` directive functions similar to Ruby's own `require`.
# It provides a way to declare a dependency on a file in your path
# and ensures its only loaded once before the source file.
#
# `require` works with files in the environment path:
#
# //= require "foo.js"
#
# Extensions are optional. If your source file is ".js", it
# assumes you are requiring another ".js".
#
# //= require "foo"
#
# Relative paths work too. Use a leading `./` to denote a relative
# path:
#
# //= require "./bar"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:206
def process_require_directive(path); end
# `require_directory` requires all the files inside a single
# directory. It's similar to `path/*` since it does not follow
# nested directories.
#
# //= require_directory "./javascripts"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:233
def process_require_directory_directive(path = T.unsafe(nil)); end
# `require_self` causes the body of the current file to be inserted
# before any subsequent `require` directives. Useful in CSS files, where
# it's common for the index file to contain global styles that need to
# be defined before other dependencies are loaded.
#
# /*= require "reset"
# *= require_self
# *= require_tree .
# */
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:220
def process_require_self_directive; end
# `require_tree` requires all the nested files in a directory.
# Its glob equivalent is `path/**/*`.
#
# //= require_tree "./public"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:243
def process_require_tree_directive(path = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:113
def process_source(source); end
# Allows dependency to be excluded from the asset bundle.
#
# The `path` must be a valid asset and may or may not already
# be part of the bundle. Once stubbed, it is blacklisted and
# can't be brought back by any other `require`.
#
# //= stub "jquery"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:287
def process_stub_directive(path); end
private
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:337
def expand_accept_shorthand(accept); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:371
def expand_relative_dirname(directive, path); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:355
def link_paths(paths, deps, accept); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:387
def load(uri); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:349
def require_paths(paths, deps); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:393
def resolve(path, options = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:361
def resolve_paths(paths, deps, options = T.unsafe(nil)); end
class << self
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:59
def call(input); end
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:52
def instance; end
end
end
# Directives are denoted by a `=` followed by the name, then
# argument list.
#
# A few different styles are allowed:
#
# // =require foo
# //= require foo
# //= require "foo"
#
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:48
Sprockets::DirectiveProcessor::DIRECTIVE_PATTERN = T.let(T.unsafe(nil), Regexp)
# source://sprockets-3.7.2/lib/sprockets/directive_processor.rb:37
Sprockets::DirectiveProcessor::VERSION = T.let(T.unsafe(nil), String)
# source://sprockets-3.7.2/lib/sprockets/erb_processor.rb:4
class Sprockets::ERBProcessor
# @return [ERBProcessor] a new instance of ERBProcessor
#
# source://sprockets-3.7.2/lib/sprockets/erb_processor.rb:16
def initialize(&block); end
# source://sprockets-3.7.2/lib/sprockets/erb_processor.rb:20
def call(input); end
class << self
# source://sprockets-3.7.2/lib/sprockets/erb_processor.rb:12
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns ERBProcessor object.
#
# source://sprockets-3.7.2/lib/sprockets/erb_processor.rb:8
def instance; end
end
end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/erb_template.rb:5
class Sprockets::ERBTemplate < ::Sprockets::ERBProcessor
# source://sprockets-3.7.2/lib/sprockets/erb_template.rb:6
def call(*args); end
end
# Processor engine class for the Eco compiler. Depends on the `eco` gem.
#
# For more infomation see:
#
# https://github.com/sstephenson/ruby-eco
# https://github.com/sstephenson/eco
#
# source://sprockets-3.7.2/lib/sprockets/eco_processor.rb:11
module Sprockets::EcoProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/eco_processor.rb:14
def cache_key; end
# Compile template data with Eco compiler.
#
# Returns a JS function definition String. The result should be
# assigned to a JS variable.
#
# # => "function(...) {...}"
#
# source://sprockets-3.7.2/lib/sprockets/eco_processor.rb:25
def call(input); end
end
end
# source://sprockets-3.7.2/lib/sprockets/eco_processor.rb:12
Sprockets::EcoProcessor::VERSION = T.let(T.unsafe(nil), String)
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/eco_template.rb:5
module Sprockets::EcoTemplate
class << self
# source://sprockets-3.7.2/lib/sprockets/eco_template.rb:8
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/eco_template.rb:12
def call(*args); end
end
end
# source://sprockets-3.7.2/lib/sprockets/eco_template.rb:6
Sprockets::EcoTemplate::VERSION = T.let(T.unsafe(nil), String)
# Processor engine class for the EJS compiler. Depends on the `ejs` gem.
#
# For more infomation see:
#
# https://github.com/sstephenson/ruby-ejs
#
# source://sprockets-3.7.2/lib/sprockets/ejs_processor.rb:10
module Sprockets::EjsProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/ejs_processor.rb:13
def cache_key; end
# Compile template data with EJS compiler.
#
# Returns a JS function definition String. The result should be
# assigned to a JS variable.
#
# # => "function(obj){...}"
#
# source://sprockets-3.7.2/lib/sprockets/ejs_processor.rb:24
def call(input); end
end
end
# source://sprockets-3.7.2/lib/sprockets/ejs_processor.rb:11
Sprockets::EjsProcessor::VERSION = T.let(T.unsafe(nil), String)
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/ejs_template.rb:5
module Sprockets::EjsTemplate
class << self
# source://sprockets-3.7.2/lib/sprockets/ejs_template.rb:8
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/ejs_template.rb:12
def call(*args); end
end
end
# source://sprockets-3.7.2/lib/sprockets/ejs_template.rb:6
Sprockets::EjsTemplate::VERSION = T.let(T.unsafe(nil), String)
# Internal: HTTP transport encoding and charset detecting related functions.
# Mixed into Environment.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:8
module Sprockets::EncodingUtils
extend ::Sprockets::EncodingUtils
# Public: Use base64 to encode data.
#
# str - String data
#
# Returns a encoded String
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:72
def base64(str); end
# Internal: Use Charlock Holmes to detect encoding.
#
# To enable this code path, require 'charlock_holmes'
#
# Returns encoded String.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:121
def charlock_detect(str); end
# Public: Use deflate to compress data.
#
# str - String data
#
# Returns a compressed String
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:18
def deflate(str); end
# Public: Basic string detecter.
#
# Attempts to parse any Unicode BOM otherwise falls back to the
# environment's external encoding.
#
# str - ASCII-8BIT encoded String
#
# Returns encoded String.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:99
def detect(str); end
# Public: Detect and strip @charset from CSS style sheet.
#
# str - String.
#
# Returns a encoded String.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:177
def detect_css(str); end
# Public: Detect charset from HTML document.
#
# Attempts to parse any Unicode BOM otherwise attempt Charlock detection
# and finally falls back to the environment's external encoding.
#
# str - String.
#
# Returns a encoded String.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:244
def detect_html(str); end
# Public: Detect Unicode string.
#
# Attempts to parse Unicode BOM and falls back to UTF-8.
#
# str - ASCII-8BIT encoded String
#
# Returns encoded String.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:138
def detect_unicode(str); end
# Public: Detect and strip BOM from possible unicode string.
#
# str - ASCII-8BIT encoded String
#
# Returns UTF 8/16/32 encoded String without BOM or the original String if
# no BOM was present.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:156
def detect_unicode_bom(str); end
# Public: Use gzip to compress data.
#
# str - String data
#
# Returns a compressed String
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:58
def gzip(str); end
# Internal: Scan binary CSS string for @charset encoding name.
#
# str - ASCII-8BIT encoded String
#
# Returns encoding String name or nil.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:207
def scan_css_charset(str); end
# Internal: Unmarshal optionally deflated data.
#
# Checks leading marshal header to see if the bytes are uncompressed
# otherwise inflate the data an unmarshal.
#
# str - Marshaled String
# window_bits - Integer deflate window size. See ZLib::Inflate.new()
#
# Returns unmarshaled Object or raises an Exception.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:38
def unmarshaled_deflated(str, window_bits = T.unsafe(nil)); end
end
# Internal: Mapping unicode encodings to byte order markers.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:83
Sprockets::EncodingUtils::BOM = T.let(T.unsafe(nil), Hash)
# Internal: Shorthand aliases for detecter functions.
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:80
Sprockets::EncodingUtils::CHARSET_DETECT = T.let(T.unsafe(nil), Hash)
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:200
Sprockets::EncodingUtils::CHARSET_SIZE = T.let(T.unsafe(nil), Integer)
# Internal: @charset bytes
#
# source://sprockets-3.7.2/lib/sprockets/encoding_utils.rb:199
Sprockets::EncodingUtils::CHARSET_START = T.let(T.unsafe(nil), Array)
# `Engines` provides a global and `Environment` instance registry.
#
# An engine is a type of processor that is bound to a filename
# extension. `application.js.coffee` indicates that the
# `CoffeeScriptProcessor` engine will be ran on the file.
#
# Extensions can be stacked and will be evaulated from right to
# left. `application.js.coffee.erb` will first run `ERBProcessor`
# then `CoffeeScriptProcessor`.
#
# All `Engine`s must follow the `Template` interface. It is
# recommended to subclass `Template`.
#
# Its recommended that you register engine changes on your local
# `Environment` instance.
#
# environment.register_engine '.foo', FooProcessor
#
# The global registry is exposed for plugins to register themselves.
#
# Sprockets.register_engine '.sass', SassProcessor
#
# source://sprockets-3.7.2/lib/sprockets/engines.rb:27
module Sprockets::Engines
include ::Sprockets::Utils
# Internal: Returns a `Hash` of engine extensions to mime types.
#
# # => { '.coffee' => 'application/javascript' }
#
# source://sprockets-3.7.2/lib/sprockets/engines.rb:44
def engine_mime_types; end
# Returns a `Hash` of `Engine`s registered on the `Environment`.
# If an `ext` argument is supplied, the `Engine` associated with
# that extension will be returned.
#
# environment.engines
# # => {".coffee" => CoffeeScriptProcessor, ".sass" => SassProcessor, ...}
#
# source://sprockets-3.7.2/lib/sprockets/engines.rb:37
def engines; end
# Registers a new Engine `klass` for `ext`. If the `ext` already
# has an engine registered, it will be overridden.
#
# environment.register_engine '.coffee', CoffeeScriptProcessor
#
# source://sprockets-3.7.2/lib/sprockets/engines.rb:53
def register_engine(ext, klass, options = T.unsafe(nil)); end
end
# source://sprockets-3.7.2/lib/sprockets/environment.rb:11
class Sprockets::Environment < ::Sprockets::Base
# `Environment` should initialized with your application's root
# directory. This should be the same as your Rails or Rack root.
#
# env = Environment.new(Rails.root)
#
# @return [Environment] a new instance of Environment
# @yield [_self]
# @yieldparam _self [Sprockets::Environment] the object that the method was called on
#
# source://sprockets-3.7.2/lib/sprockets/environment.rb:12
def initialize(root = T.unsafe(nil)); end
# Returns a cached version of the environment.
#
# All its file system calls are cached which makes `cached` much
# faster. This behavior is ideal in production since the file
# system only changes between deploys.
#
# source://sprockets-3.7.2/lib/sprockets/environment.rb:24
def cached; end
# source://sprockets-3.7.2/lib/sprockets/environment.rb:33
def find_all_linked_assets(*args, &block); end
# source://sprockets-3.7.2/lib/sprockets/environment.rb:29
def find_asset(*args); end
# Returns a cached version of the environment.
#
# All its file system calls are cached which makes `cached` much
# faster. This behavior is ideal in production since the file
# system only changes between deploys.
#
# source://sprockets-3.7.2/lib/sprockets/environment.rb:24
def index; end
# source://sprockets-3.7.2/lib/sprockets/environment.rb:37
def load(*args); end
end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:3
class Sprockets::Error < ::StandardError; end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:9
class Sprockets::FileNotFound < ::Sprockets::NotFound; end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:10
class Sprockets::FileOutsidePaths < ::Sprockets::NotFound; end
# Internal: The first processor in the pipeline that reads the file into
# memory and passes it along as `input[:data]`.
#
# source://sprockets-3.7.2/lib/sprockets/file_reader.rb:6
class Sprockets::FileReader
class << self
# source://sprockets-3.7.2/lib/sprockets/file_reader.rb:7
def call(input); end
end
end
# Internal: HTTP URI utilities. Many adapted from Rack::Utils. Mixed into
# Environment.
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:4
module Sprockets::HTTPUtils
extend ::Sprockets::HTTPUtils
# Internal: Find the best qvalue match from an Array of available mime type
# options.
#
# Adapted from Rack::Utils#q_values.
#
# Returns the matched mime type String from available Array or nil.
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:111
def find_best_mime_type_match(q_value_header, available); end
# Internal: Find the best qvalue match from an Array of available options.
#
# Adapted from Rack::Utils#q_values.
#
# Returns the matched String from available Array or nil.
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:89
def find_best_q_match(q_values, available, &matcher); end
# Internal: Find the all qvalue match from an Array of available mime type
# options.
#
# Adapted from Rack::Utils#q_values.
#
# Returns Array of matched mime type Strings from available Array or [].
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:99
def find_mime_type_matches(q_value_header, available); end
# Internal: Find all qvalue matches from an Array of available options.
#
# Adapted from Rack::Utils#q_values.
#
# Returns Array of matched Strings from available Array or [].
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:58
def find_q_matches(q_values, available, &matcher); end
# Public: Test mime type against mime range.
#
# match_mime_type?('text/html', 'text/*') => true
# match_mime_type?('text/plain', '*') => true
# match_mime_type?('text/html', 'application/json') => false
#
# Returns true if the given value is a mime match for the given mime match
# specification, false otherwise.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:15
def match_mime_type?(value, matcher); end
# Public: Return values from Hash where the key matches the mime type.
#
# hash - Hash of String matcher keys to Object values
# mime_type - String mime type
#
# Returns Array of Object values.
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:27
def match_mime_type_keys(hash, mime_type); end
# Internal: Parse Accept header quality values.
#
# Adapted from Rack::Utils#q_values.
#
# Returns an Array of [String, Float].
#
# source://sprockets-3.7.2/lib/sprockets/http_utils.rb:42
def parse_q_values(values); end
end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:18
Sprockets::Index = Sprockets::CachedEnvironment
# Public: .jst engine.
#
# Exports server side compiled templates to an object.
#
# Name your template "users/show.jst.ejs", "users/new.jst.eco", etc.
#
# To accept the default options
#
# environment.register_engine '.jst',
# JstProcessor,
# mime_type: 'application/javascript'
#
# Change the default namespace.
#
# environment.register_engine '.jst',
# JstProcessor.new(namespace: 'App.templates'),
# mime_type: 'application/javascript'
#
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:20
class Sprockets::JstProcessor
# @return [JstProcessor] a new instance of JstProcessor
#
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:36
def initialize(options = T.unsafe(nil)); end
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:40
def call(input); end
class << self
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:32
def call(input); end
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:21
def default_namespace; end
# Public: Return singleton instance with default options.
#
# Returns JstProcessor object.
#
# source://sprockets-3.7.2/lib/sprockets/jst_processor.rb:28
def instance; end
end
end
# Deprecated: Wraps legacy process Procs with new processor call signature.
#
# Will be removed in Sprockets 4.x.
#
# LegacyProcProcessor.new(:compress,
# proc { |context, data| data.gsub(...) })
#
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:11
class Sprockets::LegacyProcProcessor
# @return [LegacyProcProcessor] a new instance of LegacyProcProcessor
#
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:12
def initialize(name, proc); end
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:17
def __getobj__; end
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:29
def call(input); end
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:21
def name; end
# source://sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb:25
def to_s; end
end
# Deprecated: Wraps legacy engine and process Tilt templates with new
# processor call signature.
#
# Will be removed in Sprockets 4.x.
#
# LegacyTiltProcessor.new(Tilt::CoffeeScriptProcessor)
#
# source://sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb:11
class Sprockets::LegacyTiltProcessor
# @return [LegacyTiltProcessor] a new instance of LegacyTiltProcessor
#
# source://sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb:12
def initialize(klass); end
# source://sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb:16
def __getobj__; end
# source://sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb:20
def call(input); end
end
# The loader phase takes a asset URI location and returns a constructed Asset
# object.
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:19
module Sprockets::Loader
include ::Sprockets::URIUtils
include ::Sprockets::Utils
include ::Sprockets::ProcessorUtils
include ::Sprockets::PathUtils
include ::Sprockets::DigestUtils
include ::Sprockets::PathDependencyUtils
include ::Sprockets::HTTPUtils
include ::Sprockets::Transformers
include ::Sprockets::Resolve
include ::Sprockets::Processing
include ::Sprockets::Mime
include ::Sprockets::Engines
# Public: Load Asset by Asset URI.
#
# uri - A String containing complete URI to a file including schema
# and full path such as:
# "file:///Path/app/assets/js/app.js?type=application/javascript"
#
#
# Returns Asset.
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:32
def load(uri); end
private
# Internal: Load asset hash from cache
#
# key - A String containing lookup information for an asset
#
# This method converts all "compressed" paths to absolute paths.
# Returns a hash of values representing an asset
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:75
def asset_from_cache(key); end
# Internal: Retrieves an asset based on its digest
#
# unloaded - An UnloadedAsset
# limit - A Fixnum which sets the maximum number of versions of "histories"
# stored in the cache
#
# This method attempts to retrieve the last `limit` number of histories of an asset
# from the cache a "history" which is an array of unresolved "dependencies" that the asset needs
# to compile. In this case A dependency can refer to either an asset i.e. index.js
# may rely on jquery.js (so jquery.js is a depndency), or other factors that may affect
# compilation, such as the VERSION of sprockets (i.e. the environment) and what "processors"
# are used.
#
# For example a history array may look something like this
#
# [["environment-version", "environment-paths", "processors:type=text/css&file_type=text/css",
# "file-digest:///Full/path/app/assets/stylesheets/application.css",
# "processors:type=text/css&file_digesttype=text/css&pipeline=self",
# "file-digest:///Full/path/app/assets/stylesheets"]]
#
# Where the first entry is a Set of dependencies for last generated version of that asset.
# Multiple versions are stored since sprockets keeps the last `limit` number of assets
# generated present in the system.
#
# If a "history" of dependencies is present in the cache, each version of "history" will be
# yielded to the passed block which is responsible for loading the asset. If found, the existing
# history will be saved with the dependency that found a valid asset moved to the front.
#
# If no history is present, or if none of the histories could be resolved to a valid asset then,
# the block is yielded to and expected to return a valid asset.
# When this happens the dependencies for the returned asset are added to the "history", and older
# entries are removed if the "history" is above `limit`.
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:303
def fetch_asset_from_dependency_cache(unloaded, limit = T.unsafe(nil)); end
# Internal: Loads an asset and saves it to cache
#
# unloaded - An UnloadedAsset
#
# This method is only called when the given unloaded asset could not be
# successfully pulled from cache.
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:101
def load_from_unloaded(unloaded); end
# Internal: Resolve set of dependency URIs.
#
# uris - An Array of "dependencies" for example:
# ["environment-version", "environment-paths", "processors:type=text/css&file_type=text/css",
# "file-digest:///Full/path/app/assets/stylesheets/application.css",
# "processors:type=text/css&file_type=text/css&pipeline=self",
# "file-digest:///Full/path/app/assets/stylesheets"]
#
# Returns back array of things that the given uri dpends on
# For example the environment version, if you're using a different version of sprockets
# then the dependencies should be different, this is used only for generating cache key
# for example the "environment-version" may be resolved to "environment-1.0-3.2.0" for
# version "3.2.0" of sprockets.
#
# Any paths that are returned are converted to relative paths
#
# Returns array of resolved dependencies
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:267
def resolve_dependencies(uris); end
# Internal: Save a given asset to the cache
#
# asset - A hash containing values of loaded asset
# unloaded - The UnloadedAsset used to lookup the `asset`
#
# This method converts all absolute paths to "compressed" paths
# which are relative if they're in the root.
#
# source://sprockets-3.7.2/lib/sprockets/loader.rb:196
def store_asset(asset, unloaded); end
end
# The Manifest logs the contents of assets compiled to a single directory. It
# records basic attributes about the asset for fast lookup without having to
# compile. A pointer from each logical path indicates which fingerprinted
# asset is the current one.
#
# The JSON is part of the public API and should be considered stable. This
# should make it easy to read from other programming languages and processes
# that don't have sprockets loaded. See `#assets` and `#files` for more
# infomation about the structure.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:19
class Sprockets::Manifest
include ::Sprockets::ManifestUtils
# Create new Manifest associated with an `environment`. `filename` is a full
# path to the manifest json file. The file may or may not already exist. The
# dirname of the `filename` will be used to write compiled assets to.
# Otherwise, if the path is a directory, the filename will default a random
# ".sprockets-manifest-*.json" file in that directory.
#
# Manifest.new(environment, "./public/assets/manifest.json")
#
# @return [Manifest] a new instance of Manifest
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:32
def initialize(*args); end
# Returns internal assets mapping. Keys are logical paths which
# map to the latest fingerprinted filename.
#
# Logical path (String): Fingerprint path (String)
#
# { "application.js" => "application-2e8e9a7c6b0aafa0c9bdeec90ea30213.js",
# "jquery.js" => "jquery-ae0908555a245f8266f77df5a8edca2e.js" }
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:97
def assets; end
# Cleanup old assets in the compile directory. By default it will
# keep the latest version, 2 backups and any created within the past hour.
#
# Examples
#
# To force only 1 backup to be kept, set count=1 and age=0.
#
# To only keep files created within the last 10 minutes, set count=0 and
# age=600.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:272
def clean(count = T.unsafe(nil), age = T.unsafe(nil)); end
# Wipe directive
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:295
def clobber; end
# Compile and write asset to directory. The asset is written to a
# fingerprinted filename like
# `application-2e8e9a7c6b0aafa0c9bdeec90ea30213.js`. An entry is
# also inserted into the manifest file.
#
# compile("application.js")
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:177
def compile(*args); end
# Returns the value of attribute directory.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:86
def dir; end
# Returns the value of attribute directory.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:86
def directory; end
# Returns the value of attribute environment.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:22
def environment; end
# Returns String path to manifest.json file.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:83
def filename; end
# Returns internal file directory listing. Keys are filenames
# which map to an attributes array.
#
# Fingerprint path (String):
# logical_path: Logical path (String)
# mtime: ISO8601 mtime (String)
# digest: Base64 hex digest (String)
#
# { "application-2e8e9a7c6b0aafa0c9bdeec90ea30213.js" =>
# { 'logical_path' => "application.js",
# 'mtime' => "2011-12-13T21:47:08-06:00",
# 'digest' => "2e8e9a7c6b0aafa0c9bdeec90ea30213" } }
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:114
def files; end
# Deprecated: Filter logical paths in environment. Useful for selecting what
# files you want to compile.
#
# Returns an Enumerator.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:320
def filter_logical_paths(*args); end
# Public: Find all assets matching pattern set in environment.
#
# Returns Enumerator of Assets.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:121
def find(*args); end
# Deprecated: Filter logical paths in environment. Useful for selecting what
# files you want to compile.
#
# Returns an Enumerator.
# Deprecated alias.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:320
def find_logical_paths(*args); end
# Public: Find the source of assets by paths.
#
# Returns Enumerator of assets file content.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:155
def find_sources(*args); end
# Returns String path to manifest.json file.
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:83
def path; end
# Removes file from directory and from manifest. `filename` must
# be the name with any directory path.
#
# manifest.remove("application-2e8e9a7c6b0aafa0c9bdeec90ea30213.js")
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:242
def remove(filename); end
# Persist manfiest back to FS
#
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:302
def save; end
private
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:318
def json_decode(obj); end
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:322
def json_encode(obj); end
# source://sprockets-3.7.2/lib/sprockets/manifest.rb:326
def logger; end
class << self
# Deprecated: Compile logical path matching filter into a proc that can be
# passed to logical_paths.select(&proc).
#
# compile_match_filter(proc { |logical_path|
# File.extname(logical_path) == '.js'
# })
#
# compile_match_filter(/application.js/)
#
# compile_match_filter("foo/*.js")
#
# Returns a Proc or raise a TypeError.
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:279
def compile_match_filter(filter); end
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:306
def compute_alias_logical_path(path); end
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/legacy.rb:300
def simple_logical_path?(str); end
end
end
# Public: Manifest utilities.
#
# source://sprockets-3.7.2/lib/sprockets/manifest_utils.rb:5
module Sprockets::ManifestUtils
extend ::Sprockets::ManifestUtils
# Public: Find or pick a new manifest filename for target build directory.
#
# dirname - String dirname
#
# Examples
#
# find_directory_manifest("/app/public/assets")
# # => "/app/public/assets/.sprockets-manifest-abc123.json"
#
# Returns String filename.
#
# source://sprockets-3.7.2/lib/sprockets/manifest_utils.rb:36
def find_directory_manifest(dirname); end
# Public: Generate a new random manifest path.
#
# Manifests are not intended to be accessed publicly, but typically live
# alongside public assets for convenience. To avoid being served, the
# filename is prefixed with a "." which is usually hidden by web servers
# like Apache. To help in other environments that may not control this,
# a random hex string is appended to the filename to prevent people from
# guessing the location. If directory indexes are enabled on the server,
# all bets are off.
#
# Return String path.
#
# source://sprockets-3.7.2/lib/sprockets/manifest_utils.rb:22
def generate_manifest_path; end
end
# source://sprockets-3.7.2/lib/sprockets/manifest_utils.rb:9
Sprockets::ManifestUtils::LEGACY_MANIFEST_RE = T.let(T.unsafe(nil), Regexp)
# source://sprockets-3.7.2/lib/sprockets/manifest_utils.rb:8
Sprockets::ManifestUtils::MANIFEST_RE = T.let(T.unsafe(nil), Regexp)
# source://sprockets-3.7.2/lib/sprockets/mime.rb:6
module Sprockets::Mime
include ::Sprockets::Utils
include ::Sprockets::HTTPUtils
# Internal: Mapping of MIME extension Strings to MIME type Strings.
#
# Used for internal fast lookup purposes.
#
# Examples:
#
# mime_exts['.js'] #=> 'application/javascript'
#
# key - MIME extension String
# value - MIME Type String
#
# Returns Hash.
#
# source://sprockets-3.7.2/lib/sprockets/mime.rb:33
def mime_exts; end
# Internal: Get detecter function for MIME type.
#
# mime_type - String MIME type
#
# Returns Proc detector or nil if none is available.
#
# source://sprockets-3.7.2/lib/sprockets/mime.rb:81
def mime_type_charset_detecter(mime_type); end
# Public: Mapping of MIME type Strings to properties Hash.
#
# key - MIME Type String
# value - Hash
# extensions - Array of extnames
# charset - Default Encoding or function to detect encoding
#
# Returns Hash.
#
# source://sprockets-3.7.2/lib/sprockets/mime.rb:17
def mime_types; end
# Public: Read file on disk with MIME type specific encoding.
#
# filename - String path
# content_type - String MIME type
#
# Returns String file contents transcoded to UTF-8 or in its external
# encoding.
#
# source://sprockets-3.7.2/lib/sprockets/mime.rb:96
def read_file(filename, content_type = T.unsafe(nil)); end
# Public: Register a new mime type.
#
# mime_type - String MIME Type
# options - Hash
# extensions: Array of String extnames
# charset: Proc/Method that detects the charset of a file.
# See EncodingUtils.
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/mime.rb:46
def register_mime_type(mime_type, options = T.unsafe(nil)); end
private
# source://sprockets-3.7.2/lib/sprockets/mime.rb:111
def compute_extname_map; end
# source://sprockets-3.7.2/lib/sprockets/mime.rb:107
def extname_map; end
end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:7
class Sprockets::NotFound < ::Sprockets::Error; end
# source://sprockets-3.7.2/lib/sprockets/errors.rb:6
class Sprockets::NotImplementedError < ::Sprockets::Error; end
# Internal: Related PathUtils helpers that also track all the file system
# calls they make for caching purposes. All functions return a standard
# return value and a Set of cache dependency URIs that can be used in the
# future to see if the returned value should be invalidated from cache.
#
# entries_with_dependencies("app/assets/javascripts")
# # => [
# # ["application.js", "projects.js", "users.js", ...]
# # #<Set: {"file-digest:/path/to/app/assets/javascripts"}>
# # ]
#
# The returned dependency set can be passed to resolve_dependencies(deps)
# to check if the returned result is still fresh. In this case, entry always
# returns a single path, but multiple calls should accumulate dependencies
# into a single set thats saved off and checked later.
#
# resolve_dependencies(deps)
# # => "\x01\x02\x03"
#
# Later, resolving the same set again will produce a different hash if
# something on the file system has changed.
#
# resolve_dependencies(deps)
# # => "\x03\x04\x05"
#
# source://sprockets-3.7.2/lib/sprockets/path_dependency_utils.rb:31
module Sprockets::PathDependencyUtils
include ::Sprockets::PathUtils
include ::Sprockets::URIUtils
# Internal: List directory entries and return a set of dependencies that
# would invalid the cached return result.
#
# See PathUtils#entries
#
# path - String directory path
#
# Returns an Array of entry names and a Set of dependency URIs.
#
# source://sprockets-3.7.2/lib/sprockets/path_dependency_utils.rb:43
def entries_with_dependencies(path); end
# Internal: Returns a set of dependencies for a particular path.
#
# path - String directory path
#
# Returns a Set of dependency URIs.
#
# source://sprockets-3.7.2/lib/sprockets/path_dependency_utils.rb:64
def file_digest_dependency_set(path); end
# Internal: List directory filenames and associated Stats under a
# directory.
#
# See PathUtils#stat_directory
#
# dir - A String directory
#
# Returns an Array of filenames and a Set of dependency URIs.
#
# source://sprockets-3.7.2/lib/sprockets/path_dependency_utils.rb:55
def stat_directory_with_dependencies(dir); end
# Internal: List directory filenames and associated Stats under an entire
# directory tree.
#
# See PathUtils#stat_sorted_tree
#
# dir - A String directory
#
# Returns an Array of filenames and a Set of dependency URIs.
#
# source://sprockets-3.7.2/lib/sprockets/path_dependency_utils.rb:76
def stat_sorted_tree_with_dependencies(dir); end
end
# Internal: Crossover of path and digest utilities functions.
#
# source://sprockets-3.7.2/lib/sprockets/path_digest_utils.rb:6
module Sprockets::PathDigestUtils
include ::Sprockets::PathUtils
include ::Sprockets::DigestUtils
# Internal: Compute digest for path.
#
# path - String filename or directory path.
#
# Returns String digest bytes or nil.
#
# source://sprockets-3.7.2/lib/sprockets/path_digest_utils.rb:32
def file_digest(path); end
# Internal: Compute digest for a set of paths.
#
# paths - Array of filename or directory paths.
#
# Returns String digest bytes.
#
# source://sprockets-3.7.2/lib/sprockets/path_digest_utils.rb:43
def files_digest(paths); end
# Internal: Compute digest for file stat.
#
# path - String filename
# stat - File::Stat
#
# Returns String digest bytes.
#
# source://sprockets-3.7.2/lib/sprockets/path_digest_utils.rb:15
def stat_digest(path, stat); end
end
# Internal: File and path related utilities. Mixed into Environment.
#
# Probably would be called FileUtils, but that causes namespace annoyances
# when code actually wants to reference ::FileUtils.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:6
module Sprockets::PathUtils
extend ::Sprockets::PathUtils
# On Windows, ALT_SEPARATOR is \
# Delegate to Pathname since the logic gets complex.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:82
def absolute_path?(path); end
# Public: Write to a file atomically. Useful for situations where you
# don't want other processes or threads to see half-written files.
#
# Utils.atomic_write('important.file') do |file|
# file.write('hello')
# end
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:268
def atomic_write(filename); end
# Public: Like `File.directory?`.
#
# path - String file path.
#
# Returns true path exists and is a directory.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:40
def directory?(path); end
# Public: A version of `Dir.entries` that filters out `.` files and `~`
# swap files.
#
# path - String directory path
#
# Returns an empty `Array` if the directory does not exist.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:54
def entries(path); end
# Public: Like `File.file?`.
#
# path - String file path.
#
# Returns true path exists and is a file.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:27
def file?(path); end
# Internal: Find target basename checking upwards from path.
#
# basename - String filename: ".sprocketsrc"
# path - String path to start search: "app/assets/javascripts/app.js"
# root - String path to stop at (default: system root)
#
# Returns String filename or nil.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:193
def find_upwards(basename, path, root = T.unsafe(nil)); end
# Internal: Match path extnames against available extensions.
#
# path - String
# extensions - Hash of String extnames to values
#
# Returns [String extname, Object value] or nil nothing matched.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:150
def match_path_extname(path, extensions); end
# Internal: Get path's extensions.
#
# path - String
#
# Returns an Array of String extnames.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:140
def path_extnames(path); end
# Internal: Returns all parents for path
#
# path - String absolute filename or directory
# root - String path to stop at (default: system root)
#
# Returns an Array of String paths.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:172
def path_parents(path, root = T.unsafe(nil)); end
# Internal: Detect root path and base for file in a set of paths.
#
# paths - Array of String paths
# filename - String path of file expected to be in one of the paths.
#
# Returns [String root, String path]
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:126
def paths_split(paths, filename); end
# Public: Check if path is explicitly relative.
# Starts with "./" or "../".
#
# path - String path.
#
# Returns true if path is relative, otherwise false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:99
def relative_path?(path); end
# Internal: Get relative path for root path and subpath.
#
# path - String path
# subpath - String subpath of path
#
# Returns relative String path if subpath is a subpath of path, or nil if
# subpath is outside of path.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:110
def split_subpath(path, subpath); end
# Public: Like `File.stat`.
#
# path - String file or directory path
#
# Returns nil if the file does not exist.
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:14
def stat(path); end
# Public: Stat all the files under a directory.
#
# dir - A String directory
#
# Returns an Enumerator of [path, stat].
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:206
def stat_directory(dir); end
# Public: Recursive stat all the files under a directory in alphabetical
# order.
#
# dir - A String directory
#
# Returns an Enumerator of [path, stat].
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:244
def stat_sorted_tree(dir, &block); end
# Public: Recursive stat all the files under a directory.
#
# dir - A String directory
#
# Returns an Enumerator of [path, stat].
#
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:224
def stat_tree(dir, &block); end
end
# source://sprockets-3.7.2/lib/sprockets/path_utils.rb:90
Sprockets::PathUtils::SEPARATOR_PATTERN = T.let(T.unsafe(nil), String)
# source://sprockets-3.7.2/lib/sprockets/paths.rb:5
module Sprockets::Paths
include ::Sprockets::Utils
include ::Sprockets::PathUtils
# Append a `path` to the `paths` list.
#
# Paths at the beginning of the `Array` have a higher priority.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:46
def append_path(path); end
# Clear all paths and start fresh.
#
# There is no mechanism for reordering paths, so its best to
# completely wipe the paths list and reappend them in the order
# you want.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:58
def clear_paths; end
# Public: Iterate over every file under all load paths.
#
# Returns Enumerator if no block is given.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:67
def each_file; end
# Returns an `Array` of path `String`s.
#
# These paths will be used for asset logical path lookups.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:29
def paths; end
# Prepend a `path` to the `paths` list.
#
# Paths at the end of the `Array` have the least priority.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:36
def prepend_path(path); end
# Returns `Environment` root.
#
# All relative paths are expanded with root as its base. To be
# useful set this to your applications root directory. (`Rails.root`)
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:12
def root; end
private
# Internal: Change Environment root.
#
# Only the initializer should change the root.
#
# source://sprockets-3.7.2/lib/sprockets/paths.rb:19
def root=(path); end
end
# `Processing` is an internal mixin whose public methods are exposed on
# the `Environment` and `CachedEnvironment` classes.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:13
module Sprockets::Processing
include ::Sprockets::Utils
include ::Sprockets::URIUtils
include ::Sprockets::ProcessorUtils
# Bundle Processors are ran on concatenated assets rather than
# individual files.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:88
def bundle_processors; end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:16
def pipelines; end
# Postprocessors are ran after Preprocessors and Engine processors.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:36
def postprocessors; end
# Preprocessors are ran before Postprocessors and Engine
# processors.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:30
def preprocessors; end
# Preprocessors are ran before Postprocessors and Engine
# processors.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:30
def processors; end
# Public: Register bundle metadata reducer function.
#
# Examples
#
# Sprockets.register_bundle_metadata_reducer 'application/javascript', :jshint_errors, [], :+
#
# Sprockets.register_bundle_metadata_reducer 'text/css', :selector_count, 0 { |total, count|
# total + count
# }
#
# mime_type - String MIME Type. Use '*/*' applies to all types.
# key - Symbol metadata key
# initial - Initial memo to pass to the reduce funciton (default: nil)
# block - Proc accepting the memo accumulator and current value
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:130
def register_bundle_metadata_reducer(mime_type, key, *args, &block); end
# Registers a new Bundle Processor `klass` for `mime_type`.
#
# register_bundle_processor 'application/javascript', Sprockets::DirectiveProcessor
#
# A block can be passed for to create a shorthand processor.
#
# register_bundle_processor 'application/javascript', :my_processor do |context, data|
# data.gsub(...)
# end
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:102
def register_bundle_processor(*args, &block); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:20
def register_pipeline(name, proc = T.unsafe(nil), &block); end
# Registers a new Postprocessor `klass` for `mime_type`.
#
# register_postprocessor 'application/javascript', Sprockets::DirectiveProcessor
#
# A block can be passed for to create a shorthand processor.
#
# register_postprocessor 'application/javascript', :my_processor do |context, data|
# data.gsub(...)
# end
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:65
def register_postprocessor(*args, &block); end
# Registers a new Preprocessor `klass` for `mime_type`.
#
# register_preprocessor 'text/css', Sprockets::DirectiveProcessor
#
# A block can be passed for to create a shorthand processor.
#
# register_preprocessor 'text/css', :my_processor do |context, data|
# data.gsub(...)
# end
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:50
def register_preprocessor(*args, &block); end
# Registers a new Preprocessor `klass` for `mime_type`.
#
# register_preprocessor 'text/css', Sprockets::DirectiveProcessor
#
# A block can be passed for to create a shorthand processor.
#
# register_preprocessor 'text/css', :my_processor do |context, data|
# data.gsub(...)
# end
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:50
def register_processor(*args, &block); end
# Remove Bundle Processor `klass` for `mime_type`.
#
# unregister_bundle_processor 'application/javascript', Sprockets::DirectiveProcessor
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:110
def unregister_bundle_processor(*args); end
# Remove Postprocessor `klass` for `mime_type`.
#
# unregister_postprocessor 'text/css', Sprockets::DirectiveProcessor
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:82
def unregister_postprocessor(*args); end
# Remove Preprocessor `klass` for `mime_type`.
#
# unregister_preprocessor 'text/css', Sprockets::DirectiveProcessor
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:73
def unregister_preprocessor(*args); end
# Remove Preprocessor `klass` for `mime_type`.
#
# unregister_preprocessor 'text/css', Sprockets::DirectiveProcessor
#
# source://sprockets-3.7.2/lib/sprockets/processing.rb:73
def unregister_processor(*args); end
protected
# source://sprockets-3.7.2/lib/sprockets/processing.rb:162
def build_processors_uri(type, file_type, engine_extnames, pipeline); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:178
def default_processors_for(type, file_type, engine_extnames); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:173
def processors_for(type, file_type, engine_extnames, pipeline); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:155
def resolve_processors_cache_key_uri(uri); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:187
def self_processors_for(type, file_type, engine_extnames); end
private
# source://sprockets-3.7.2/lib/sprockets/processing.rb:234
def deprecate_legacy_processor_interface(interface); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:207
def register_config_processor(type, mime_type, klass, proc = T.unsafe(nil), &block); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:219
def unregister_config_processor(type, mime_type, klass); end
# source://sprockets-3.7.2/lib/sprockets/processing.rb:242
def wrap_processor(klass, proc); end
end
# Functional utilities for dealing with Processor functions.
#
# A Processor is a general function that my modify or transform an asset as
# part of the pipeline. CoffeeScript to JavaScript conversion, Minification
# or Concatenation are all implemented as seperate Processor steps.
#
# Processors maybe any object that responds to call. So procs or a class that
# defines a self.call method.
#
# For ergonomics, processors may return a number of shorthand values.
# Unfortunately, this means that processors can not compose via ordinary
# function composition. The composition helpers here can help.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:16
module Sprockets::ProcessorUtils
extend ::Sprockets::ProcessorUtils
# Public: Invoke processor.
#
# processor - Processor callables
# input - Hash of input data to pass to processor
#
# Returns a Hash with :data and other processor metadata key/values.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:71
def call_processor(processor, input); end
# Public: Invoke list of processors in right to left order.
#
# The right to left order processing mirrors standard function composition.
# Think about:
#
# bundle.call(uglify.call(coffee.call(input)))
#
# processors - Array of processor callables
# input - Hash of input data to pass to each processor
#
# Returns a Hash with :data and other processor metadata key/values.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:52
def call_processors(processors, input); end
# Public: Compose processors in right to left order.
#
# processors - Array of processors callables
#
# Returns a composed Proc.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:24
def compose_processors(*processors); end
# Internal: Get processor defined cached key.
#
# processor - Processor function
#
# Returns JSON serializable key or nil.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:92
def processor_cache_key(processor); end
# Internal: Get combined cache keys for set of processors.
#
# processors - Array of processor functions
#
# Returns Array of JSON serializable keys.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:101
def processors_cache_keys(processors); end
# Internal: Validate object is in validate metadata whitelist.
#
# value - Any Object
#
# Returns true if class is in whitelist otherwise false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:170
def valid_processor_metadata_value?(value); end
# Internal: Validate returned result of calling a processor pipeline and
# raise a friendly user error message.
#
# result - Metadata Hash returned from call_processors
#
# Returns result or raises a TypeError.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:142
def validate_processor_result!(result); end
end
# Internal: Set of all nested compound metadata types that can nest values.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:116
Sprockets::ProcessorUtils::VALID_METADATA_COMPOUND_TYPES = T.let(T.unsafe(nil), Set)
# Internal: Hash of all nested compound metadata types that can nest values.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:129
Sprockets::ProcessorUtils::VALID_METADATA_COMPOUND_TYPES_HASH = T.let(T.unsafe(nil), Hash)
# Internal: Set of all allowed metadata types.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:134
Sprockets::ProcessorUtils::VALID_METADATA_TYPES = T.let(T.unsafe(nil), Set)
# Internal: Set of all "simple" value types allowed to be returned in
# processor metadata.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:107
Sprockets::ProcessorUtils::VALID_METADATA_VALUE_TYPES = T.let(T.unsafe(nil), Set)
# Internal: Hash of all "simple" value types allowed to be returned in
# processor metadata.
#
# source://sprockets-3.7.2/lib/sprockets/processor_utils.rb:124
Sprockets::ProcessorUtils::VALID_METADATA_VALUE_TYPES_HASH = T.let(T.unsafe(nil), Hash)
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:7
module Sprockets::Resolve
include ::Sprockets::PathUtils
include ::Sprockets::URIUtils
include ::Sprockets::PathDependencyUtils
include ::Sprockets::HTTPUtils
# Public: Find Asset URI for given a logical path by searching the
# environment's load paths.
#
# resolve("application.js")
# # => "file:///path/to/app/javascripts/application.js?type=application/javascript"
#
# An accept content type can be given if the logical path doesn't have a
# format extension.
#
# resolve("application", accept: "application/javascript")
# # => "file:///path/to/app/javascripts/application.coffee?type=application/javascript"
#
# The String Asset URI is returned or nil if no results are found.
#
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:23
def resolve(path, options = T.unsafe(nil)); end
# Public: Same as resolve() but raises a FileNotFound exception instead of
# nil if no assets are found.
#
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:51
def resolve!(path, options = T.unsafe(nil)); end
protected
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:177
def dirname_matches(dirname, basename); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:136
def parse_accept_options(mime_type, types); end
# Internal: Returns the name, mime type and `Array` of engine extensions.
#
# "foo.js.coffee.erb"
# # => ["foo", "application/javascript", [".coffee", ".erb"]]
#
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:199
def parse_path_extnames(path); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:155
def path_matches(load_path, logical_name, logical_basename); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:77
def resolve_absolute_path(paths, filename, accept); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:190
def resolve_alternates(load_path, logical_name); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:72
def resolve_asset_uri(uri); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:104
def resolve_logical_path(paths, logical_path, accept); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:94
def resolve_relative_path(paths, path, dirname, accept); end
# source://sprockets-3.7.2/lib/sprockets/resolve.rb:119
def resolve_under_paths(paths, logical_name, accepts); end
end
# Public: Sass CSS minifier.
#
# To accept the default options
#
# environment.register_bundle_processor 'text/css',
# Sprockets::SassCompressor
#
# Or to pass options to the Sass::Engine class.
#
# environment.register_bundle_processor 'text/css',
# Sprockets::SassCompressor.new({ ... })
#
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:17
class Sprockets::SassCompressor
# @return [SassCompressor] a new instance of SassCompressor
#
# source://sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:7
def initialize(options = T.unsafe(nil)); end
# Returns the value of attribute cache_key.
#
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:35
def cache_key; end
# source://sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:17
def call(*args); end
# sprockets 2.x
#
# source://sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:17
def evaluate(*args); end
class << self
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:31
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:27
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns SassCompressor object.
#
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:23
def instance; end
end
end
# source://sprockets-3.7.2/lib/sprockets/sass_compressor.rb:18
Sprockets::SassCompressor::VERSION = T.let(T.unsafe(nil), String)
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:291
Sprockets::SassFunctions = Sprockets::SassProcessor::Functions
# Processor engine class for the SASS/SCSS compiler. Depends on the `sass` gem.
#
# For more infomation see:
#
# https://github.com/sass/sass
# https://github.com/rails/sass-rails
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:13
class Sprockets::SassProcessor
# Public: Initialize template with custom options.
#
# options - Hash
# cache_version - String custom cache version. Used to force a cache
# change after code changes are made to Sass Functions.
#
# @return [SassProcessor] a new instance of SassProcessor
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:45
def initialize(options = T.unsafe(nil), &block); end
# Returns the value of attribute cache_key.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:37
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:56
def call(input); end
private
# Public: Build the cache store to be used by the Sass engine.
#
# input - the input hash.
# version - the cache version.
#
# Override this method if you need to use a different cache than the
# Sprockets cache.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:94
def build_cache_store(input, version); end
class << self
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:33
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:29
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns SassProcessor object.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:25
def instance; end
# Internal: Defines default sass syntax to use. Exposed so the ScssProcessor
# may override it.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:18
def syntax; end
end
end
# Public: Functions injected into Sass context during Sprockets evaluation.
#
# This module may be extended to add global functionality to all Sprockets
# Sass environments. Though, scoping your functions to just your environment
# is preferred.
#
# module Sprockets::SassProcessor::Functions
# def asset_path(path, options = {})
# end
# end
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:110
module Sprockets::SassProcessor::Functions
# Public: Generate a data URI for asset path.
#
# path - Sass::Script::String logical asset path
#
# Returns a Sass::Script::String.
#
# source://sassc-rails-2.1.2/lib/sassc/rails/functions.rb:7
def asset_data_url(path); end
# Public: Generate a url for asset path.
#
# Default implementation is deprecated. Currently defaults to
# Context#asset_path.
#
# Will raise NotImplementedError in the future. Users should provide their
# own base implementation.
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:120
def asset_path(path, options = T.unsafe(nil)); end
# Public: Generate a asset url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:136
def asset_url(path, options = T.unsafe(nil)); end
# Public: Generate url for audio path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:181
def audio_path(path); end
# Public: Generate a audio url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:190
def audio_url(path); end
# Public: Generate url for font path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:199
def font_path(path); end
# Public: Generate a font url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:208
def font_url(path); end
# Public: Generate url for image path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:145
def image_path(path); end
# Public: Generate a image url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:154
def image_url(path); end
# Public: Generate url for javascript path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:217
def javascript_path(path); end
# Public: Generate a javascript url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:226
def javascript_url(path); end
# Public: Generate url for stylesheet path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:235
def stylesheet_path(path); end
# Public: Generate a stylesheet url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:244
def stylesheet_url(path); end
# Public: Generate url for video path.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:163
def video_path(path); end
# Public: Generate a video url() link.
#
# path - Sass::Script::String URL path
#
# Returns a Sass::Script::String.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:172
def video_url(path); end
protected
# Deprecated: Get the Context instance. Use APIs on
# sprockets_environment or sprockets_dependencies directly.
#
# Returns a Context instance.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:277
def sprockets_context; end
# Public: Mutatable set of dependencies.
#
# Returns a Set.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:269
def sprockets_dependencies; end
# Public: The Environment.
#
# Returns Sprockets::Environment.
#
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:262
def sprockets_environment; end
end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/sass_template.rb:5
class Sprockets::SassTemplate < ::Sprockets::SassProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/sass_template.rb:6
def call(*args); end
end
end
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:284
class Sprockets::ScssProcessor < ::Sprockets::SassProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/sass_processor.rb:285
def syntax; end
end
end
# Deprecated
#
# source://sprockets-3.7.2/lib/sprockets/sass_template.rb:13
class Sprockets::ScssTemplate < ::Sprockets::ScssProcessor
class << self
# source://sprockets-3.7.2/lib/sprockets/sass_template.rb:14
def call(*args); end
end
end
# `Server` is a concern mixed into `Environment` and
# `CachedEnvironment` that provides a Rack compatible `call`
# interface and url generation helpers.
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:8
module Sprockets::Server
# `call` implements the Rack 1.x specification which accepts an
# `env` Hash and returns a three item tuple with the status code,
# headers, and body.
#
# Mapping your environment at a url prefix will serve all assets
# in the path.
#
# map "/assets" do
# run Sprockets::Environment.new
# end
#
# A request for `"/assets/foo/bar.js"` will search your
# environment for `"foo/bar.js"`.
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:22
def call(env); end
private
# Test if `?body=1` or `body=true` query param is set
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:240
def body_only?(env); end
# source://sprockets-3.7.2/lib/sprockets/server.rb:244
def cache_headers(env, etag); end
# Returns a CSS response that hides all elements on the page and
# displays the exception
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:179
def css_exception_response(exception); end
# Escape special characters for use inside a CSS content("...") string
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:231
def escape_css_content(content); end
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:113
def forbidden_request?(path); end
# Returns a 403 Forbidden response tuple
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:140
def forbidden_response(env); end
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:121
def head_request?(env); end
# source://sprockets-3.7.2/lib/sprockets/server.rb:265
def headers(env, asset, length); end
# Returns a JavaScript response that re-throws a Ruby exception
# in the browser
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:171
def javascript_exception_response(exception); end
# source://sprockets-3.7.2/lib/sprockets/server.rb:157
def method_not_allowed_response; end
# Returns a 404 Not Found response tuple
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:149
def not_found_response(env); end
# Returns a 304 Not Modified response tuple
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:135
def not_modified_response(env, etag); end
# Returns a 200 OK response tuple
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:126
def ok_response(asset, env); end
# Gets ETag fingerprint.
#
# "foo-0aa2105d29558f3eb790d411d7d8fb66.js"
# # => "0aa2105d29558f3eb790d411d7d8fb66"
#
# source://sprockets-3.7.2/lib/sprockets/server.rb:288
def path_fingerprint(path); end
# source://sprockets-3.7.2/lib/sprockets/server.rb:161
def precondition_failed_response(env); end
end
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:6
module Sprockets::Transformers
include ::Sprockets::Utils
include ::Sprockets::ProcessorUtils
include ::Sprockets::HTTPUtils
# Internal: Compose multiple transformer steps into a single processor
# function.
#
# transformers - Two level Hash of a source mime type to a target mime type
# types - Array of mime type steps
#
# Returns Processor.
#
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:92
def compose_transformers(transformers, types); end
# Internal: Expand accept type list to include possible transformed types.
#
# parsed_accepts - Array of accept q values
#
# Examples
#
# expand_transform_accepts([['application/javascript', 1.0]])
# # => [['application/javascript', 1.0], ['text/coffeescript', 0.8]]
#
# Returns an expanded Array of q values.
#
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:74
def expand_transform_accepts(parsed_accepts); end
# Public: Register a transformer from and to a mime type.
#
# from - String mime type
# to - String mime type
# proc - Callable block that accepts an input Hash.
#
# Examples
#
# register_transformer 'text/coffeescript', 'application/javascript',
# ConvertCoffeeScriptToJavaScript
#
# register_transformer 'image/svg+xml', 'image/png', ConvertSvgToPng
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:35
def register_transformer(from, to, proc); end
# Internal: Resolve target mime type that the source type should be
# transformed to.
#
# type - String from mime type
# accept - String accept type list (default: '*/*')
#
# Examples
#
# resolve_transform_type('text/plain', 'text/plain')
# # => 'text/plain'
#
# resolve_transform_type('image/svg+xml', 'image/png, image/*')
# # => 'image/png'
#
# resolve_transform_type('text/css', 'image/png')
# # => nil
#
# Returns String mime type or nil is no type satisfied the accept value.
#
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:60
def resolve_transform_type(type, accept); end
# Public: Two level mapping of a source mime type to a target mime type.
#
# environment.transformers
# # => { 'text/coffeescript' => {
# 'application/javascript' => ConvertCoffeeScriptToJavaScript
# }
# }
#
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:17
def transformers; end
private
# source://sprockets-3.7.2/lib/sprockets/transformers.rb:123
def compute_transformers!; end
end
# Internal: used to "expand" and "compress" values for storage
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:5
class Sprockets::URITar
# Internal: Initialize object for compression or expansion
#
# uri - A String containing URI that may or may not contain the scheme
# env - The current "environment" that assets are being loaded into.
#
# @return [URITar] a new instance of URITar
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:12
def initialize(uri, env); end
# Internal: Tells us if we are using an absolute path
#
# Nix* systems start with a `/` like /Users/schneems.
# Windows systems start with a drive letter than colon and slash
# like C:/Schneems.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:43
def absolute_path?; end
# Internal: Converts full uri to a "compressed" uri
#
# If a uri is inside of an environment's root it will
# be shortened to be a relative path.
#
# If a uri is outside of the environment's root the original
# uri will be returned.
#
# Returns String
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:34
def compress; end
# Internal: Returns "compressed" path
#
# If the input uri is relative to the environment root
# it will return a path relative to the environment root.
# Otherwise an absolute path will be returned.
#
# Only path information is returned, and not scheme.
#
# Returns String
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:83
def compressed_path; end
# Internal: Convert a "compressed" uri to an absolute path
#
# If a uri is inside of the environment's root it will not
# start with a slash for example:
#
# file://this/is/a/relative/path
#
# If a uri is outside the root, it will start with a slash:
#
# file:///This/is/an/absolute/path
#
# Returns String
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:59
def expand; end
# Returns the value of attribute path.
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:6
def path; end
# Returns the value of attribute root.
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:6
def root; end
# Returns the value of attribute scheme.
#
# source://sprockets-3.7.2/lib/sprockets/uri_tar.rb:6
def scheme; end
end
# Internal: Asset URI related parsing utilities. Mixed into Environment.
#
# An Asset URI identifies the compiled Asset result. It shares the file:
# scheme and requires an absolute path.
#
# Other query parameters
#
# type - String output content type. Otherwise assumed from file extension.
# This maybe different than the extension if the asset is transformed
# from one content type to another. For an example .coffee -> .js.
#
# id - Unique fingerprint of the entire asset and all its metadata. Assets
# will only have the same id if they serialize to an identical value.
#
# pipeline - String name of pipeline.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:20
module Sprockets::URIUtils
extend ::Sprockets::URIUtils
# Internal: Build Asset URI.
#
# Examples
#
# build("/tmp/js/application.coffee", type: "application/javascript")
# # => "file:///tmp/js/application.coffee?type=application/javascript"
#
# path - String file path
# params - Hash of optional parameters
#
# Returns String URI.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:111
def build_asset_uri(path, params = T.unsafe(nil)); end
# Internal: Build file-digest dependency URI.
#
# Examples
#
# build("/tmp/js/application.js")
# # => "file-digest:/tmp/js/application.js"
#
# path - String file path
#
# Returns String URI.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:145
def build_file_digest_uri(path); end
# Internal: Serialize hash of params into query string.
#
# params - Hash of params to serialize
#
# Returns String query or nil if empty.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:154
def encode_uri_query_params(params); end
# Internal: Join file: URI component parts into String.
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:59
def join_file_uri(scheme, host, path, query); end
# Internal: Join URI component parts into String.
#
# Returns String.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:35
def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment); end
# Internal: Parse Asset URI.
#
# Examples
#
# parse("file:///tmp/js/application.coffee?type=application/javascript")
# # => "/tmp/js/application.coffee", {type: "application/javascript"}
#
# uri - String asset URI
#
# Returns String path and Hash of symbolized parameters.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:90
def parse_asset_uri(uri); end
# Internal: Parse file-digest dependency URI.
#
# Examples
#
# parse("file-digest:/tmp/js/application.js")
# # => "/tmp/js/application.js"
#
# uri - String file-digest URI
#
# Returns String path.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:125
def parse_file_digest_uri(uri); end
# Internal: Parse query string into hash of params
#
# query - String query string
#
# Return Hash of params.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:179
def parse_uri_query_params(query); end
# Internal: Parse file: URI into component parts.
#
# uri - String uri
#
# Returns [scheme, host, path, query].
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:44
def split_file_uri(uri); end
# Internal: Parse URI into component parts.
#
# uri - String uri
#
# Returns Array of components.
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:28
def split_uri(uri); end
# Internal: Check if String is a valid Asset URI.
#
# str - Possible String asset URI.
#
# Returns true or false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/uri_utils.rb:73
def valid_asset_uri?(str); end
end
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:17
class Sprockets::UglifierCompressor
# @return [UglifierCompressor] a new instance of UglifierCompressor
#
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:37
def initialize(options = T.unsafe(nil)); end
# Returns the value of attribute cache_key.
#
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:35
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:51
def call(input); end
class << self
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:31
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:27
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns UglifierCompressor object.
#
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:23
def instance; end
end
end
# source://sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:18
Sprockets::UglifierCompressor::VERSION = T.let(T.unsafe(nil), String)
# Internal: Used to parse and store the URI to an unloaded asset
# Generates keys used to store and retrieve items from cache
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:7
class Sprockets::UnloadedAsset
# Internal: Initialize object for generating cache keys
#
# uri - A String containing complete URI to a file including scheme
# and full path such as
# "file:///Path/app/assets/js/app.js?type=application/javascript"
# env - The current "environment" that assets are being loaded into.
# We need it so we know where the +root+ (directory where sprockets
# is being invoked). We also need for the `file_digest` method,
# since, for some strange reason, memoization is provided by
# overriding methods such as `stat` in the `PathUtils` module.
#
# Returns UnloadedAsset.
#
# @return [UnloadedAsset] a new instance of UnloadedAsset
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:21
def initialize(uri, env); end
# Internal: Key of asset
#
# Used to retrieve an asset from the cache based on "compressed" path to asset.
# A "compressed" path can either be relative to the root of the project or an
# absolute path.
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:76
def asset_key; end
# Returns the value of attribute compressed_path.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:28
def compressed_path; end
# Public: Dependency History key
#
# Used to retrieve an array of "histories" each of which contain a set of stored dependencies
# for a given asset path and filename digest.
#
# A dependency can refer to either an asset i.e. index.js
# may rely on jquery.js (so jquery.js is a dependency), or other factors that may affect
# compilation, such as the VERSION of sprockets (i.e. the environment) and what "processors"
# are used.
#
# For example a history array with one Set of dependencies may look like:
#
# [["environment-version", "environment-paths", "processors:type=text/css&file_type=text/css",
# "file-digest:///Full/path/app/assets/stylesheets/application.css",
# "processors:type=text/css&file_type=text/css&pipeline=self",
# "file-digest:///Full/path/app/assets/stylesheets"]]
#
# This method of asset lookup is used to ensure that none of the dependencies have been modified
# since last lookup. If one of them has, the key will be different and a new entry must be stored.
#
# URI depndencies are later converted to "compressed" paths
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:103
def dependency_history_key; end
# Internal: Digest key
#
# Used to retrieve a string containing the "compressed" path to an asset based on
# a digest. The digest is generated from dependencies stored via information stored in
# the `dependency_history_key` after each of the "dependencies" is "resolved" for example
# "environment-version" may be resolved to "environment-1.0-3.2.0" for version "3.2.0" of sprockets
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:115
def digest_key(digest); end
# Internal: File digest key
#
# The digest for a given file won't change if the path and the stat time hasn't changed
# We can save time by not re-computing this information and storing it in the cache
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:125
def file_digest_key(stat); end
# Internal: Full file path without schema
#
# This returns a string containing the full path to the asset without the schema.
# Information is loaded lazilly since we want `UnloadedAsset.new(dep, self).relative_path`
# to be fast. Calling this method the first time allocates an array and a hash.
#
# Example
#
# If the URI is `file:///Full/path/app/assets/javascripts/application.js"` then the
# filename would be `"/Full/path/app/assets/javascripts/application.js"`
#
# Returns a String.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:42
def filename; end
# Internal: Hash of param values
#
# This information is generated and used internally by sprockets.
# Known keys include `:type` which store the asset's mime-type, `:id` which is a fully resolved
# digest for the asset (includes dependency digest as opposed to a digest of only file contents)
# and `:pipeline`. Hash may be empty.
#
# Example
#
# If the URI is `file:///Full/path/app/assets/javascripts/application.js"type=application/javascript`
# Then the params would be `{type: "application/javascript"}`
#
# Returns a Hash.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:62
def params; end
# Returns the value of attribute uri.
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:28
def uri; end
private
# Internal: Parses uri into filename and params hash
#
# Returns Array with filename and params hash
#
# source://sprockets-3.7.2/lib/sprockets/unloaded_asset.rb:133
def load_file_params; end
end
# Internal: Utils, we didn't know where else to put it! Functions may
# eventually be shuffled into more specific drawers.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:6
module Sprockets::Utils
extend ::Sprockets::Utils
# Internal: Accumulate asset source to buffer and append a trailing
# semicolon if necessary.
#
# buf - String buffer to append to
# source - String source to append
#
# Returns buf String.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:104
def concat_javascript_sources(buf, source); end
# Internal: Post-order Depth-First search algorithm.
#
# Used for resolving asset dependencies.
#
# initial - Initial Array of nodes to traverse.
# block -
# node - Current node to get children of
#
# Returns a Set of nodes.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:190
def dfs(initial); end
# Internal: Post-order Depth-First search algorithm that gathers all paths
# along the way.
#
# TODO: Rename function.
#
# path - Initial Array node path
# block -
# node - Current node to get children of
#
# Returns an Array of node Arrays.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:217
def dfs_paths(path); end
# Internal: Check if object can safely be .dup'd.
#
# Similar to ActiveSupport #duplicable? check.
#
# obj - Any Object
#
# Returns false if .dup would raise a TypeError, otherwise true.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:16
def duplicable?(obj); end
# Internal: Duplicate and store key/value on new frozen hash.
#
# Similar to Hash#store for nested frozen hashes.
#
# hash - Hash
# key - Object keys. Use multiple keys for nested hashes.
# block - Receives current value at key.
#
# Examples
#
# config = {paths: ["/bin", "/sbin"]}.freeze
# new_config = hash_reassoc(config, :paths) do |paths|
# paths << "/usr/local/bin"
# end
#
# Returns duplicated frozen Hash.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:63
def hash_reassoc(hash, *keys, &block); end
# Internal: Duplicate and store key/value on new frozen hash.
#
# Seperated for recursive calls, always use hash_reassoc(hash, *keys).
#
# hash - Hash
# key - Object key
#
# Returns Hash.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:37
def hash_reassoc1(hash, key); end
# Internal: Inject into target module for the duration of the block.
#
# mod - Module
#
# Returns result of block.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:155
def module_include(base, mod); end
# Internal: Prepends a leading "." to an extension if its missing.
#
# normalize_extension("js")
# # => ".js"
#
# normalize_extension(".css")
# # => ".css"
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:130
def normalize_extension(extension); end
# Internal: Check if string has a trailing semicolon.
#
# str - String
#
# Returns true or false.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:78
def string_end_with_semicolon?(str); end
end
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:3
class Sprockets::Utils::Gzip
# Private: Generates a gzipped file based off of reference file.
#
# @return [Gzip] a new instance of Gzip
#
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:5
def initialize(asset); end
# Private: Returns whether or not an asset can be compressed.
#
# We want to compress any file that is text based.
# You do not want to compress binary
# files as they may already be compressed and running them
# through a compression algorithm would make them larger.
#
# Return Boolean.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:29
def can_compress?(mime_types); end
# Private: Opposite of `can_compress?`.
#
# Returns Boolean.
#
# @return [Boolean]
#
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:41
def cannot_compress?(mime_types); end
# Private: Generates a gzipped file based off of reference asset.
#
# Compresses the target asset's contents and puts it into a file with
# the same name plus a `.gz` extension in the same folder as the original.
# Does not modify the target asset.
#
# Returns nothing.
#
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:52
def compress(target); end
end
# What non-text mime types should we compress? This list comes from:
# https://www.fastly.com/blog/new-gzip-settings-and-deciding-what-compress
#
# source://sprockets-3.7.2/lib/sprockets/utils/gzip.rb:13
Sprockets::Utils::Gzip::COMPRESSABLE_MIME_TYPES = T.let(T.unsafe(nil), Hash)
# Internal: Feature detect if UnboundMethods can #bind to any Object or
# just Objects that share the same super class.
# Basically if RUBY_VERSION >= 2.
#
# source://sprockets-3.7.2/lib/sprockets/utils.rb:142
Sprockets::Utils::UNBOUND_METHODS_BIND_TO_ANY_OBJECT = T.let(T.unsafe(nil), TrueClass)
# source://sprockets-3.7.2/lib/sprockets/version.rb:2
Sprockets::VERSION = T.let(T.unsafe(nil), String)
# Public: YUI compressor.
#
# To accept the default options
#
# environment.register_bundle_processor 'application/javascript',
# Sprockets::YUICompressor
#
# Or to pass options to the YUI::JavaScriptCompressor class.
#
# environment.register_bundle_processor 'application/javascript',
# Sprockets::YUICompressor.new(munge: true)
#
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:17
class Sprockets::YUICompressor
# @return [YUICompressor] a new instance of YUICompressor
#
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:37
def initialize(options = T.unsafe(nil)); end
# Returns the value of attribute cache_key.
#
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:35
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:42
def call(input); end
class << self
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:31
def cache_key; end
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:27
def call(input); end
# Public: Return singleton instance with default options.
#
# Returns YUICompressor object.
#
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:23
def instance; end
end
end
# source://sprockets-3.7.2/lib/sprockets/yui_compressor.rb:18
Sprockets::YUICompressor::VERSION = T.let(T.unsafe(nil), String)