Sha256: 884ccf476a83819590b459bf4c8ca3d21de5e4345d6bdc8bedc6cce0a507990d

Contents?: true

Size: 499 Bytes

Versions: 12

Compression:

Stored size: 499 Bytes

Contents

require 'active_support/cache'
require 'singleton'

module Reviewed
  class Cache
    include Singleton

    def self.store
      @store ||= if ENV['REVIEWED_CACHE_REDIS_URL']
                   puts "Reviewed::Cache - connecting to #{ENV['REVIEWED_CACHE_REDIS_URL']}"
                   ActiveSupport::Cache.lookup_store(:redis_store, ENV['REVIEWED_CACHE_REDIS_URL'])
                 else
                   ActiveSupport::Cache.lookup_store(:memory_store)
                 end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
reviewed-1.0.2 lib/reviewed/cache.rb
reviewed-1.0.1 lib/reviewed/cache.rb
reviewed-1.0.0 lib/reviewed/cache.rb
reviewed-0.9.1 lib/reviewed/cache.rb
reviewed-0.9.0 lib/reviewed/cache.rb
reviewed-0.8.0 lib/reviewed/cache.rb
reviewed-0.7.1 lib/reviewed/cache.rb
reviewed-0.7 lib/reviewed/cache.rb
reviewed-0.6.4 lib/reviewed/cache.rb
reviewed-0.6.3 lib/reviewed/cache.rb
reviewed-0.6.2 lib/reviewed/cache.rb
reviewed-0.6.1 lib/reviewed/cache.rb