Sha256: a165bda2333f80a055a575d1aae1e922a066f0aeeef1c3d4ca6c4ccace55bde7
Contents?: true
Size: 964 Bytes
Versions: 2
Compression:
Stored size: 964 Bytes
Contents
module Legion module Cache module Settings Legion::Settings.merge_settings(:cache, default) if Legion::Settings.method_defined? :merge_settings def self.default { driver: driver, servers: ['127.0.0.1:11211'], connected: false, enabled: true, namespace: 'legion', compress: false, failover: true, threadsafe: true, expires_in: 0, cache_nils: false, pool_size: 5, serializer: Legion::JSON } end def self.driver(prefer = 'dalli') secondary = prefer == 'dalli' ? 'redis' : 'dalli' if Gem::Specification.find_all_by_name(prefer).count.positive? prefer elsif Gem::Specification.find_all_by_name(secondary).count.positive? secondary else raise NameError('Legion::Cache.driver is nil') end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
legion-cache-1.0.0 | lib/legion/cache/settings.rb |
legion-cache-0.2.1 | lib/legion/cache/settings.rb |