123456789_123456789_123456789_123456789_123456789_

Module: Sprockets

Relationships & Source Files
Namespace Children
Modules:
Classes:
Exceptions:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: lib/sprockets/errors.rb,
lib/sprockets.rb,
lib/sprockets/add_source_map_comment_to_asset_processor.rb,
lib/sprockets/asset.rb,
lib/sprockets/autoload.rb,
lib/sprockets/babel_processor.rb,
lib/sprockets/base.rb,
lib/sprockets/bower.rb,
lib/sprockets/bundle.rb,
lib/sprockets/cache.rb,
lib/sprockets/cached_environment.rb,
lib/sprockets/closure_compressor.rb,
lib/sprockets/coffee_script_processor.rb,
lib/sprockets/compressing.rb,
lib/sprockets/configuration.rb,
lib/sprockets/context.rb,
lib/sprockets/dependencies.rb,
lib/sprockets/digest_utils.rb,
lib/sprockets/directive_processor.rb,
lib/sprockets/eco_processor.rb,
lib/sprockets/ejs_processor.rb,
lib/sprockets/encoding_utils.rb,
lib/sprockets/environment.rb,
lib/sprockets/exporting.rb,
lib/sprockets/file_reader.rb,
lib/sprockets/http_utils.rb,
lib/sprockets/jsminc_compressor.rb,
lib/sprockets/jst_processor.rb,
lib/sprockets/loader.rb,
lib/sprockets/manifest.rb,
lib/sprockets/manifest_utils.rb,
lib/sprockets/mime.rb,
lib/sprockets/npm.rb,
lib/sprockets/path_dependency_utils.rb,
lib/sprockets/path_digest_utils.rb,
lib/sprockets/path_utils.rb,
lib/sprockets/paths.rb,
lib/sprockets/processing.rb,
lib/sprockets/processor_utils.rb,
lib/sprockets/resolve.rb,
lib/sprockets/sass_cache_store.rb,
lib/sprockets/sass_compressor.rb,
lib/sprockets/sass_processor.rb,
lib/sprockets/sassc_compressor.rb,
lib/sprockets/sassc_processor.rb,
lib/sprockets/server.rb,
lib/sprockets/source_map_processor.rb,
lib/sprockets/source_map_utils.rb,
lib/sprockets/transformers.rb,
lib/sprockets/uglifier_compressor.rb,
lib/sprockets/unloaded_asset.rb,
lib/sprockets/uri_tar.rb,
lib/sprockets/uri_utils.rb,
lib/sprockets/utils.rb,
lib/sprockets/version.rb,
lib/sprockets/yui_compressor.rb,
lib/sprockets/autoload/babel.rb,
lib/sprockets/autoload/closure.rb,
lib/sprockets/autoload/coffee_script.rb,
lib/sprockets/autoload/eco.rb,
lib/sprockets/autoload/ejs.rb,
lib/sprockets/autoload/jsminc.rb,
lib/sprockets/autoload/sass.rb,
lib/sprockets/autoload/sassc.rb,
lib/sprockets/autoload/uglifier.rb,
lib/sprockets/autoload/yui.rb,
lib/sprockets/autoload/zopfli.rb,
lib/sprockets/cache/file_store.rb,
lib/sprockets/cache/memory_store.rb,
lib/sprockets/cache/null_store.rb,
lib/sprockets/exporters/base.rb,
lib/sprockets/exporters/file_exporter.rb,
lib/sprockets/exporters/zlib_exporter.rb,
lib/sprockets/exporters/zopfli_exporter.rb,
lib/sprockets/preprocessors/default_source_map.rb,
lib/sprockets/utils/gzip.rb

Overview

Define some basic Sprockets error classes

Constant Summary

Class Attribute Summary

Configuration - Extended

config, config=,
context_class

This class maybe mutated and mixed in with custom helpers.

digest_class

Public: Returns a Digest implementation class.

digest_class=

Deprecated: Assign a Digest implementation class.

logger

Get and set Logger instance.

version

The Environment#version is a custom value used for manually expiring all asset caches.

version=

Assign an environment version.

Paths - Included

root

Returns Environment root.

root=

Internal: Change Environment root.

Exporting - Included

export_concurrent

Public: Checks if concurrent exporting is allowed.

export_concurrent=

Public: Enable or disable the concurrently exporting files.

Compressing - Included

css_compressor

Return CSS compressor or nil if none is set.

css_compressor=

Assign a compressor to run on text/css assets.

gzip=

Public: Enable or disable the creation of Gzip files.

gzip?

Public: Checks if Gzip is enabled.

js_compressor

Return JS compressor or nil if none is set.

js_compressor=

Assign a compressor to run on application/javascript assets.

skip_gzip?

Public: Checks if Gzip is disabled.

Class Method Summary

Configuration - Extended

Paths - Included

append_path

Append a path to the paths list.

clear_paths

Clear all paths and start fresh.

each_file

Public: Iterate over every file under all load paths.

paths

Returns an Array of path Strings.

prepend_path

Prepend a path to the paths list.

Mime - Included

mime_exts

Internal: Mapping of MIME extension Strings to MIME type Strings.

mime_type_charset_detecter

Internal: Get detecter function for MIME type.

mime_types

Public: Mapping of MIME type Strings to properties Hash.

read_file

Public: Read file on disk with MIME type specific encoding.

register_mime_type

Public: Register a new mime type.

Transformers - Included

compose_transformers

Internal: Compose multiple transformer steps into a single processor function.

expand_transform_accepts

Internal: Expand accept type list to include possible transformed types.

register_transformer

Public: Register a transformer from and to a mime type.

register_transformer_suffix

Internal: Register transformer for existing type adding a suffix.

resolve_transform_type

Internal: Resolve target mime type that the source type should be transformed to.

transformers

Public: Two level mapping of a source mime type to a target mime type.

compose_transformer_list, compute_transformers!

HTTPUtils - Included

find_best_mime_type_match

Internal: Find the best qvalue match from an Array of available mime type options.

find_best_q_match

Internal: Find the best qvalue match from an Array of available options.

find_mime_type_matches

Internal: Find the all qvalue match from an Array of available mime type options.

find_q_matches

Internal: Find all qvalue matches from an Array of available options.

match_mime_type?

Public: Test mime type against mime range.

match_mime_type_keys

Public: Return values from Hash where the key matches the mime type.

parse_q_values

Internal: Parse Accept header quality values.

Processing - Included

bundle_processors

Bundle Processors are ran on concatenated assets rather than individual files.

pipelines,
postprocessors

Postprocessors are ran after Preprocessors and Engine processors.

preprocessors

Preprocessors are ran before Postprocessors and Engine processors.

processors
register_bundle_metadata_reducer

Public: Register bundle metadata reducer function.

register_bundle_processor

Registers a new Bundle Processor klass for mime_type.

register_pipeline

Registers a pipeline that will be called by call_processor method.

register_postprocessor

Registers a new Postprocessor klass for mime_type.

register_preprocessor

Registers a new Preprocessor klass for mime_type.

register_processor
unregister_bundle_processor

Remove Bundle Processor klass for mime_type.

unregister_postprocessor

Remove Postprocessor klass for mime_type.

unregister_preprocessor

Remove Preprocessor klass for mime_type.

unregister_processor
register_config_processor, unregister_config_processor

Exporting - Included

exporters

Exporters are ran on the assets:precompile task.

register_exporter

Public: Registers a new Exporter klass for mime_type.

unregister_exporter

Public: Remove Exporting processor klass for mime_type.

Compressing - Included

compressors,
register_compressor

Public: Register a new compressor klass at sym for mime_type.

Dependencies - Included

add_dependency

Public: Add environmental dependency inherited by all assets.

depend_on
dependencies

Public: Default set of dependency URIs for assets.

dependency_resolvers

Public: Mapping dependency schemes to resolver functions.

register_dependency_resolver

Public: Register new dependency URI resolver.

resolve_dependency

Internal: Resolve dependency URIs.

PathDigestUtils - Included

file_digest

Internal: Compute digest for path.

files_digest

Internal: Compute digest for a set of paths.

stat_digest

Internal: Compute digest for file stat.

DigestUtils - Included

already_digested?

Internal: Checks an asset name for a valid digest.

detect_digest_class

Internal: Detect digest class hash algorithm for digest bytes.

digest

Internal: Generate a hexdigest for a nested JSON serializable object.

digest_class

Internal: Default digest class.

hexdigest

Internal: Generate a hexdigest for a nested JSON serializable object.

hexdigest_integrity_uri

Public: Generate hash for use in the integrity attribute of an asset tag as per the subresource integrity specification.

integrity_uri

Public: Generate hash for use in the integrity attribute of an asset tag as per the subresource integrity specification.

pack_base64digest

Internal: Pack a binary digest to a base64 encoded string.

pack_hexdigest

Internal: Pack a binary digest to a hex encoded string.

pack_urlsafe_base64digest

Internal: Pack a binary digest to a urlsafe base64 encoded string.

unpack_hexdigest

Internal: Unpack a hex encoded digest string into binary bytes.

build_digest

PathUtils - Included

absolute_path?

On Windows, ALT_SEPARATOR is \ Delegate to Pathname since the logic gets complex.

atomic_write

Public: Write to a file atomically.

directory?

Public: Like File.directory?.

entries

Public: A version of Dir.entries that filters out . files and ~ swap files.

file?

Public: Like File.file?.

find_matching_path_for_extensions

Internal: Match paths in a directory against available extensions.

find_upwards

Internal: Find target basename checking upwards from path.

join

Public: Joins path to base path.

match_path_extname

Internal: Match path extnames against available extensions.

path_extnames

Internal: Get path’s extensions.

path_parents

Internal: Returns all parents for path.

paths_split

Internal: Detect root path and base for file in a set of paths.

relative_path?

Public: Check if path is explicitly relative.

relative_path_from

Public: Get relative path from start to dest.

set_pipeline

Public: Sets pipeline for path.

split_subpath

Internal: Get relative path for root path and subpath.

stat

Public: Like File.stat.

stat_directory

Public: Stat all the files under a directory.

stat_sorted_tree

Public: Recursive stat all the files under a directory in alphabetical order.

stat_tree

Public: Recursive stat all the files under a directory.

URIUtils - Included

build_asset_uri

Internal: Build Asset URI.

build_file_digest_uri

Internal: Build file-digest dependency URI.

encode_uri_query_params

Internal: Serialize hash of params into query string.

join_file_uri

Internal: Join file: URI component parts into String.

join_uri

Internal: Join URI component parts into String.

parse_asset_uri

Internal: Parse Asset URI.

parse_file_digest_uri

Internal: Parse file-digest dependency URI.

parse_uri_query_params

Internal: Parse query string into hash of params.

split_file_uri

Internal: Parse file: URI into component parts.

split_uri

Internal: Parse URI into component parts.

valid_asset_uri?

Internal: Check if String is a valid Asset URI.

Utils - Included

concat_javascript_sources

Internal: Accumulate asset source to buffer and append a trailing semicolon if necessary.

dfs

Internal: Post-order Depth-First search algorithm.

dfs_paths

Internal: Post-order Depth-First search algorithm that gathers all paths along the way.

duplicable?

Internal: Check if object can safely be .dup’d.

hash_reassoc

Internal: Duplicate and store key/value on new frozen hash.

hash_reassoc1

Internal: Duplicate and store key/value on new frozen hash.

module_include

Internal: Inject into target module for the duration of the block.

string_end_with_semicolon?

Internal: Check if string has a trailing semicolon.

ProcessorUtils - Extended

call_processor

Public: Invoke processor.

call_processors

Public: Invoke list of processors in right to left order.

compose_processors

Public: Compose processors in right to left order.

processor_cache_key

Internal: Get processor defined cached key.

processors_cache_keys

Internal: Get combined cache keys for set of processors.

validate_processor_result!

Internal: Validate returned result of calling a processor pipeline and raise a friendly user error message.