sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::UnloadedAsset#initialize

Internal: Initialize object for generating cache keys

uri - A String containing complete URI to a file including scheme
      and full path such as
      "file:///Path/app/assets/js/app.js?type=application/javascript"
env - The current "environment" that assets are being loaded into.
      We need it so we know where the +root+ (directory where Sprockets
      is being invoked). We also need it for the `file_digest` method,
      since, for some strange reason, memoization is provided by
      overriding methods such as `stat` in the `PathUtils` module.

Returns UnloadedAsset.

Source | Google | Stack overflow

Edit

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

cd sprockets

open lib/sprockets/unloaded_asset.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--UnloadedAsset-initialize-for-pr


# Commit to git

git add lib/sprockets/unloaded_asset.rbgit commit -m "better docs for Sprockets::UnloadedAsset#initialize"


# 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--UnloadedAsset-initialize-for-pr

hub pull-request


# Celebrate!