module Sprockets::Resolve
def parse_path_extnames(path)
# => ["foo", "application/javascript", [".coffee", ".erb"]]
"foo.js.coffee.erb"
Internal: Returns the name, mime type and `Array` of engine extensions.
def parse_path_extnames(path) mime_type = nil engine_extnames = [] len = path.length path_extnames(path).reverse_each do |extname| if engines.key?(extname) mime_type = engine_mime_types[extname] engine_extnames.unshift(extname) len -= extname.length elsif mime_exts.key?(extname) mime_type = mime_exts[extname] len -= extname.length break else break end end name = path[0, len] return [name, mime_type, engine_extnames] end