lib/picky/backends/redis.rb in picky-3.1.13 vs lib/picky/backends/redis.rb in picky-3.2.0
- old
+ new
@@ -7,10 +7,13 @@
class Redis < Backend
attr_reader :client
def initialize options = {}
+ require 'redis'
@client = options[:client] || ::Redis.new(:db => (options[:db] || 15))
+ rescue LoadError => e
+ warn_gem_missing 'redis', 'the Redis client'
end
# Returns an object that on #initial, #load returns an object that responds to:
# [:token] # => [id, id, id, id, id] (an array of ids)
#
\ No newline at end of file