sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

ActiveSupport::Cache.lookup_store

Creates a new CacheStore object according to the given options.

If no arguments are passed to this method, then a new
ActiveSupport::Cache::MemoryStore object will be returned.

If you pass a Symbol as the first argument, then a corresponding cache
store class under the ActiveSupport::Cache namespace will be created.
For example:

  ActiveSupport::Cache.lookup_store(:memory_store)
  # => returns a new ActiveSupport::Cache::MemoryStore object

  ActiveSupport::Cache.lookup_store(:mem_cache_store)
  # => returns a new ActiveSupport::Cache::MemCacheStore object

Any additional arguments will be passed to the corresponding cache store
class's constructor:

  ActiveSupport::Cache.lookup_store(:file_store, '/tmp/cache')
  # => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache')

If the first argument is not a Symbol, then it will simply be returned:

  ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new)
  # => returns MyOwnCacheStore.new

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/cache.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ActiveSupport--Cache-lookup_store-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/cache.rbgit commit -m "better docs for ActiveSupport::Cache.lookup_store"


# Open pull request

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

hub fork

git push <your name> -your-name--update-docs-ActiveSupport--Cache-lookup_store-for-pr

hub pull-request


# Celebrate!