sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::Resolve#resolve_under_paths

Internal: Finds a file in a set of given paths

paths        - Array of Strings.
logical_name - String. A filename without extension
               e.g. "application" or "coffee/foo"
accepts      - Array of array containing mime/version pairs
               e.g. [["application/javascript", 1.0]]

Finds a file with the same name as `logical_name` or "index" inside
of the `logical_name` directory that matches a valid mime-type/version from
`accepts`.

Returns Array. Filename, type, dependencies, and index_alias

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_under_paths-for-pr


# Commit to git

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


# 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_under_paths-for-pr

hub pull-request


# Celebrate!