stoplight 2.1.2 → 2.1.3

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: 63cf1781eee3560f3c9c349bf68c8775d7abc504
4
- data.tar.gz: 87de1b959d4f19c8213578ffcf33bdbcacd65934
3
+ metadata.gz: e73b740e1d020caa3c2231d358358f7f1405d339
4
+ data.tar.gz: f228a34259327f769ee5a43630815ee31ec754ee
5
5
  SHA512:
6
- metadata.gz: add9f9034758b48d505b6b6ad3f2d4d776f26bf151a2fa15f81498f97aeed583094a3e86fa1a5d919d484bcc68f3dbd425a9098b4c3124816d7586821b554774
7
- data.tar.gz: 05e604d3704db8185dd02f891806511bef83c62c4e51c15dbba8d2fcbafaf24e295ae5dcbc7b5b6651e89e73184f678b9d05f92c473a5ada774d6091c9f5d358
6
+ metadata.gz: ef7a7ec7291ffc27d4b12c2900e52927abe9b9faf93e26f5086959742e57c69c4b8d05a880e66eba7439193686983bd516f429d1c4e6eb61067b86d5870c9f9d
7
+ data.tar.gz: 68ef1c8e9583434ae5da043aa0c7ef3f5e0a23a9b9bef40ac58bdffac57fa83de4d9d148e3bfbf68bda3caaf8f831cd10a5d28882952a533655a47fb3b7f21f2
@@ -16,8 +16,9 @@ module Stoplight
16
16
  state_names = @redis.hkeys(states_key)
17
17
 
18
18
  pattern = key('failures', '*')
19
+ prefix_regex = /^#{key('failures', '')}/
19
20
  failure_names = @redis.scan_each(match: pattern).to_a.map do |key|
20
- key.split(KEY_SEPARATOR).last
21
+ key.sub(prefix_regex, '')
21
22
  end
22
23
 
23
24
  (state_names + failure_names).uniq
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Stoplight
4
- VERSION = Gem::Version.new('2.1.2')
4
+ VERSION = Gem::Version.new('2.1.3')
5
5
  end
@@ -36,6 +36,12 @@ RSpec.describe Stoplight::DataStore::Memory do
36
36
  data_store.set_state(light, Stoplight::State::UNLOCKED)
37
37
  expect(data_store.names).to eql([light.name])
38
38
  end
39
+
40
+ it 'supports names containing colons' do
41
+ light = Stoplight::Light.new('http://api.example.com/some/action')
42
+ data_store.record_failure(light, failure)
43
+ expect(data_store.names).to eql([light.name])
44
+ end
39
45
  end
40
46
 
41
47
  describe '#get_all' do
@@ -40,6 +40,12 @@ RSpec.describe Stoplight::DataStore::Redis do
40
40
  data_store.set_state(light, Stoplight::State::UNLOCKED)
41
41
  expect(data_store.names).to eql([light.name])
42
42
  end
43
+
44
+ it 'supports names containing colons' do
45
+ light = Stoplight::Light.new('http://api.example.com/some/action')
46
+ data_store.record_failure(light, failure)
47
+ expect(data_store.names).to eql([light.name])
48
+ end
43
49
  end
44
50
 
45
51
  describe '#get_all' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stoplight
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Desautels