module Sprockets::Loader
def asset_from_cache(key)
This method converts all "compressed" paths to absolute paths.
key - A String containing lookup information for an asset
Internal: Load asset hash from cache
def asset_from_cache(key) asset = cache.get(key, true) if asset asset[:uri] = expand_from_root(asset[:uri]) asset[:load_path] = expand_from_root(asset[:load_path]) asset[:filename] = expand_from_root(asset[:filename]) expand_key_from_hash(asset[:metadata], :included) expand_key_from_hash(asset[:metadata], :links) expand_key_from_hash(asset[:metadata], :stubbed) expand_key_from_hash(asset[:metadata], :required) expand_key_from_hash(asset[:metadata], :to_load) expand_key_from_hash(asset[:metadata], :to_link) expand_key_from_hash(asset[:metadata], :dependencies) { |uri| uri.start_with?("file-digest://") } asset[:metadata].each_key do |k| next unless k.match?(/_dependencies\z/) # rubocop:disable Performance/EndWith expand_key_from_hash(asset[:metadata], k) end end asset end