class Sprockets::Base
def resolve(logical_path, options = {})
# => "/path/to/app/javascripts/application.js.coffee"
resolve("application.js")
searching the environment's paths.
Finds the expanded real path for a given logical path by
def resolve(logical_path, options = {}) # If a block is given, preform an iterable search if block_given? args = attributes_for(logical_path).search_paths + [options] @trail.find(*args) do |path| pathname = Pathname.new(path) if pathname.basename.to_s == 'component.json' component = json_decode(pathname.read) case component['main'] when String yield pathname.dirname.join(component['main']) when Array extname = File.extname(logical_path) component['main'].each do |fn| if extname == "" || extname == File.extname(fn) yield pathname.dirname.join(fn) end end end else yield pathname end end else resolve(logical_path, options) do |pathname| return pathname end raise FileNotFound, "couldn't find file '#{logical_path}'" end end