module Sprockets::Resolve

def resolve(path, options = {})

The String Asset URI is returned or nil if no results are found.

# => "file:///path/to/app/javascripts/application.coffee?type=application/javascript"
resolve("application", accept: "application/javascript")

format extension.
An accept content type can be given if the logical path doesn't have a

# => "file:///path/to/app/javascripts/application.js?type=application/javascript"
resolve("application.js")

environment's load paths.
Public: Find Asset URI for given a logical path by searching the
def resolve(path, options = {})
  path = path.to_s
  paths = options[:load_paths] || config[:paths]
  accept = options[:accept]
  if valid_asset_uri?(path)
    uri, deps = resolve_asset_uri(path)
  elsif absolute_path?(path)
    filename, type, deps = resolve_absolute_path(paths, path, accept)
  elsif relative_path?(path)
    filename, type, pipeline, deps = resolve_relative_path(paths, path, options[:base_path], accept)
  else
    filename, type, pipeline, deps = resolve_logical_path(paths, path, accept)
  end
  if filename
    params = {}
    params[:type] = type if type
    params[:pipeline] = pipeline if pipeline
    params[:pipeline] = options[:pipeline] if options[:pipeline]
    uri = build_asset_uri(filename, params)
  end
  return uri, deps
end