Method: Sprockets::Mime#mime_types

Defined in:
lib/sprockets/mime.rb

#mime_types(ext = nil) ⇒ Object

Returns a ‘Hash` of registered mime types registered on the environment and those part of `Rack::Mime`.

If an ‘ext` is given, it will lookup the mime type for that extension.



9
10
11
12
13
14
15
16
# File 'lib/sprockets/mime.rb', line 9

def mime_types(ext = nil)
  if ext.nil?
    Rack::Mime::MIME_TYPES.merge(@mime_types)
  else
    ext = Sprockets::Utils.normalize_extension(ext)
    @mime_types[ext] || Rack::Mime::MIME_TYPES[ext]
  end
end