sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::Resolve#resolve

Public: Find Asset URI for given a logical path by searching the
environment's load paths.

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

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

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

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

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/resolve.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--Resolve-resolve-for-pr


# Commit to git

git add lib/sprockets/resolve.rbgit commit -m "better docs for Sprockets::Resolve#resolve"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--Resolve-resolve-for-pr

hub pull-request


# Celebrate!