Method: Sprockets::Environment#find_asset

Defined in:
lib/sprockets/environment.rb

#find_asset(path, options = {}) ⇒ Object

Cache ‘find_asset` calls



68
69
70
71
72
73
74
75
76
# File 'lib/sprockets/environment.rb', line 68

def find_asset(path, options = {})
  # Ensure inmemory cached assets are still fresh on every lookup
  if (asset = @assets[path.to_s]) && asset.fresh?
    asset
  elsif asset = super
    @assets[path.to_s] = @assets[asset.pathname.to_s] = asset
    asset
  end
end