module Sprockets::Engines

def engine_mime_types

# => { '.coffee' => 'application/javascript' }

Internal: Returns a `Hash` of engine extensions to mime types.
def engine_mime_types
  config[:engine_mime_types]
end

def engines


# => {".coffee" => CoffeeScriptProcessor, ".sass" => SassProcessor, ...}
environment.engines

that extension will be returned.
If an `ext` argument is supplied, the `Engine` associated with
Returns a `Hash` of `Engine`s registered on the `Environment`.
def engines
  config[:engines]
end

def register_engine(ext, klass, options = {})


environment.register_engine '.coffee', CoffeeScriptProcessor

has an engine registered, it will be overridden.
Registers a new Engine `klass` for `ext`. If the `ext` already
def register_engine(ext, klass, options = {})
  ext = Sprockets::Utils.normalize_extension(ext)
  if klass.class == Sprockets::AutoloadProcessor || klass.respond_to?(:call)
    processor = klass
    self.config = hash_reassoc(config, :engines) do |engines|
      engines.merge(ext => klass)
    end
    if options[:mime_type]
      self.config = hash_reassoc(config, :engine_mime_types) do |mime_types|
        mime_types.merge(ext.to_s => options[:mime_type])
      end
    end
  else
    processor = LegacyTiltProcessor.new(klass)
    self.config = hash_reassoc(config, :engines) do |engines|
      engines.merge(ext => processor)
    end
    if klass.respond_to?(:default_mime_type) && klass.default_mime_type
      self.config = hash_reassoc(config, :engine_mime_types) do |mime_types|
        mime_types.merge(ext.to_s => klass.default_mime_type)
      end
    end
  end
  self.config = hash_reassoc(config, :_extnames) do
    compute_extname_map
  end
end