sensu-redis 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ce0ff19e7c8830d29b20b946cd8933de107bff
4
- data.tar.gz: b918d767da3035f7ee98f3ba7a5d2899a5850be0
3
+ metadata.gz: 90aa0b49d4c41c42ff2ff4d1113375a162d09bb6
4
+ data.tar.gz: de473c8a502f084f9df1b9f3d5f607c7ca86bcd2
5
5
  SHA512:
6
- metadata.gz: 54641708adc456dcd6402e8a97a9ab3bfdf196a793a3c316200f51048403eb293b9b473f8d73f5aecdc90bd3d25362967886c57782641b65f0cc3107bba12f8e
7
- data.tar.gz: d8e4628f555bacb07a930ea4e433ba6654b2fcc0a25c1f3e15dd62439eaf232f0a984a5c945ebba512c687c84dbefc1ff5e29f9498dfa36c21982490aa74554e
6
+ metadata.gz: b124a3ccc401a0b28a5872bb95938d860c2530e831bda4326bb605fefb251703c01fd48b9b21c4a8ed766efe18ca38b0b1ce6f8de8ff943c657a845d66fdc5bc
7
+ data.tar.gz: 2909f6bc52bafb7f599b812208125efd3fe854f51e70cde09106a68fb99e8d8ea048ec35692324ec54e125abe4865e1b51c7636745486181c150b4877e6c48b8
data/lib/sensu/redis.rb CHANGED
@@ -61,7 +61,11 @@ module Sensu
61
61
  end
62
62
  options[:host] ||= "127.0.0.1"
63
63
  options[:port] ||= 6379
64
- if options[:sentinels].is_a?(Array) && options[:sentinels].length > 0
64
+ case
65
+ when options[:sentinels].is_a?(String)
66
+ raw_urls = options[:sentinels]
67
+ options[:sentinels] = raw_urls.split(',').map { |url| parse_url(url) }
68
+ when options[:sentinels].is_a?(Array) && options[:sentinels].length > 0
65
69
  connect_via_sentinel(options, &block)
66
70
  else
67
71
  connect_direct(options, &block)
data/sensu-redis.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-redis"
5
- spec.version = "1.5.0"
5
+ spec.version = "1.6.0"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu Redis client library"
data/spec/redis_spec.rb CHANGED
@@ -25,4 +25,15 @@ describe "Sensu::Redis" do
25
25
  end
26
26
  end
27
27
  end
28
+
29
+ it "can connect to a redis master via comma-separated sentinel URL string", :sentinel => true do
30
+ async_wrapper do
31
+ Sensu::Redis.connect(:sentinels => "redis://127.0.0.1:26379,redis://127.0.0.1:26379") do |redis|
32
+ redis.callback do
33
+ expect(redis.connected?).to eq(true)
34
+ async_done
35
+ end
36
+ end
37
+ end
38
+ end
28
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-13 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine