Closed arnaldodg closed 5 years ago
You can create a fake Rails.cache
by implement with ActiveSupport::Cache::Store like this:
module Rails
class << self
def cache
@cache ||= ActiveSupport::Cache::MemCacheStore.new('127.0.0.1')
end
end
end
Sometimes it would be useful to have it working on a non-rails project. The Rails gem dependency makes it not possible. I noticed there are calls for the Rails.cache objects. Isn't there a way of creating specific depencencies for the Rails.cache classes? eg: require 'rails/cache'. In this fashion one could add other require statments like 'activesupport/all' and 'activerecord' to make it work on a plain ruby+pg setup.
Nice work, by the way. Thanks for this valuable gem.