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_aliasEdit
git clone [email protected]:rails/sprockets.git
cd sprockets
open lib/sprockets/resolve.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Sprockets--Resolve-resolve_under_paths-for-pr
# Commit to gitgit add lib/sprockets/resolve.rbgit commit -m "better docs for Sprockets::Resolve#resolve_under_paths"
# Open pull requestgem 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!