promiscuous 0.50.1 → 0.50.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,8 +16,16 @@ module Promiscuous::Redis
16
16
  def self.new_connection
17
17
  return Null.new if Promiscuous::Config.backend == :null
18
18
 
19
- redis = ::Redis.new(:url => Promiscuous::Config.redis_url,
20
- :tcp_keepalive => 60)
19
+ redis_url = Promiscuous::Config.redis_url || 'redis://localhost/'
20
+ url = URI.parse(redis_url)
21
+ raise "Please use redis://:password@host:port/db" if url.scheme != 'redis'
22
+
23
+ redis_options = { :host => url.host,
24
+ :port => url.port,
25
+ :password => url.password,
26
+ :db => url.path.empty? ? nil : url.path,
27
+ :tcp_keepalive => 60}
28
+ redis = ::Redis.new(redis_options)
21
29
  redis.client.connect
22
30
  redis
23
31
  end
@@ -1,3 +1,3 @@
1
1
  module Promiscuous
2
- VERSION = '0.50.1'
2
+ VERSION = '0.50.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promiscuous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.50.1
4
+ version: 0.50.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -231,9 +231,9 @@ files:
231
231
  - lib/promiscuous/publisher.rb
232
232
  - lib/promiscuous/amqp.rb
233
233
  - lib/promiscuous/subscriber.rb
234
- - lib/promiscuous/redis.rb
235
234
  - lib/promiscuous/config.rb
236
235
  - lib/promiscuous/cli.rb
236
+ - lib/promiscuous/redis.rb
237
237
  - lib/promiscuous/version.rb
238
238
  - lib/promiscuous.rb
239
239
  - bin/promiscuous