lib/sad/config.rb in sad-1.1.0 vs lib/sad/config.rb in sad-1.2.0

- old
+ new

@@ -7,28 +7,15 @@ def namespace @_namespace || 'SadQueue' end - def default_rds_opts(inopts={}) - opts = { - :host => 'localhost', - :port => 6379, - :db => 0 - }.update inopts.dup - if opts[:password] - url = "redis://#{opts[:password]}@#{opts[:host]}:#{opts[:port]}/#{opts[:db]}" - else - url = "redis://#{opts[:host]}:#{opts[:port]}/#{opts[:db]}" - end + def redis=(uri) + @_redis = EM::Hiredis.connect uri end - def redis=(opts={}) - @_redis = EM::Hiredis.connect default_rds_opts(opts) - end - def redis - @_redis || EM::Hiredis.connect + @_redis ||= EM::Hiredis.connect end end end end \ No newline at end of file