Sha256: 3ef08b3cfa19641c24c49b9e012c1d0c2ec0ffc9db30ceecfec6f445b31c20e1
Contents?: true
Size: 797 Bytes
Versions: 30
Compression:
Stored size: 797 Bytes
Contents
module Scrivito module Cache class FileStore include Chainable attr_reader :internal_store, :next_store def initialize(options = {}) @internal_store = ActiveSupport::Cache::FileStore.new( options[:path] || Rails.root + 'tmp/scrivito_cache') @next_store = options[:next_store] end delegate :clear, to: :internal_store private delegate :read, to: :internal_store, prefix: :internal def internal_write(key, value, expires_in = nil) internal_store.write(key, value, expires_in: expires_in) end def transform_key(key) # Workaround for rails/rails#15616. Will be fixed in Rails 4.2. Digest::SHA1.hexdigest(key) end def forward_write?(key, value, expires_in) super && !expires_in end end end end
Version data entries
30 entries across 30 versions & 1 rubygems