Module Sprockets::Processing
In: lib/sprockets/processing.rb

`Processing` is an internal mixin whose public methods are exposed on the `Environment` and `Index` classes.

Methods

Included Modules

Engines Mime

Public Instance methods

Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.

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

All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.

Return CSS compressor or nil if none is set

Assign a compressor to run on `text/css` assets.

The compressor object must respond to `compress` or `compile`.

Returns an `Array` of format extension `String`s.

    format_extensions
    # => ['.js', '.css']

Return JS compressor or nil if none is set

Assign a compressor to run on `application/javascript` assets.

The compressor object must respond to `compress` or `compile`.

Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.

Postprocessors are ran after Preprocessors and Engine processors.

All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.

Returns an `Array` of `Processor` classes. If a `mime_type` argument is supplied, the processors registered under that extension will be returned.

Preprocessors are ran before Postprocessors and Engine processors.

All `Processor`s must follow the `Tilt::Template` interface. It is recommended to subclass `Tilt::Template`.

Deprecated alias for `preprocessors`.

Registers a new Bundle Processor `klass` for `mime_type`.

    register_bundle_processor  'text/css', Sprockets::CharsetNormalizer

A block can be passed for to create a shorthand processor.

    register_bundle_processor :my_processor do |context, data|
      data.gsub(...)
    end

Registers a new Engine `klass` for `ext`.

Register a new mime type.

Registers a new Postprocessor `klass` for `mime_type`.

    register_postprocessor 'text/css', Sprockets::CharsetNormalizer

A block can be passed for to create a shorthand processor.

    register_postprocessor :my_processor do |context, data|
      data.gsub(...)
    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 :my_processor do |context, data|
      data.gsub(...)
    end

Remove Bundle Processor `klass` for `mime_type`.

    unregister_bundle_processor 'text/css', Sprockets::CharsetNormalizer

Remove Postprocessor `klass` for `mime_type`.

    unregister_postprocessor 'text/css', Sprockets::DirectiveProcessor

Remove Preprocessor `klass` for `mime_type`.

    unregister_preprocessor 'text/css', Sprockets::DirectiveProcessor

[Validate]