module Sprockets::Resolve
def resolve(path, load_paths: config[:paths], accept: nil, pipeline: nil, base_path: nil)
# => "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, load_paths: config[:paths], accept: nil, pipeline: nil, base_path: nil) paths = load_paths 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, path_pipeline, deps, index_alias = resolve_relative_path(paths, path, base_path, accept) else filename, type, path_pipeline, deps, index_alias = resolve_logical_path(paths, path, accept) end if filename uri = build_asset_uri(filename, type: type, pipeline: pipeline || path_pipeline, index_alias: index_alias) end return uri, deps end