sprockets
https://github.com/rails/sprockets
Ruby
Rack-based asset packaging system
Sprockets::Cache#fetch
Public: Prefer API to retrieve and set values in the cache store.
key - JSON serializable key
block -
Must return a consistent JSON serializable object for the given key.
Examples
cache.fetch("foo") { "bar" }
Returns a JSON serializable object.Edit
git clone [email protected]:rails/sprockets.git
cd sprockets
open lib/sprockets/cache.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Sprockets--Cache-fetch-for-pr
# Commit to gitgit add lib/sprockets/cache.rbgit commit -m "better docs for Sprockets::Cache#fetch"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Sprockets--Cache-fetch-for-pr
hub pull-request
# Celebrate!