captainu-tincan 0.8.0 → 0.8.1

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: 81b4ca24c5fc0416c16995f2b9ceeb774d4e1fec
4
- data.tar.gz: 5b685303cb058bc07739d6ab76992dcf543c6457
3
+ metadata.gz: 1b929c88f6a7ec74fb30d0da1fa49907c8a12a68
4
+ data.tar.gz: d405d5dab938552c06929657e25f4d8b2d190ff6
5
5
  SHA512:
6
- metadata.gz: d0a21eec95dae01fad91ecfb7f21cbf4b0952b91c8a6a0c3a67394660f5a6a2e1f77b0e4a94ade22c88d41d5f1a1f0a5e3983845b5cb893202727b1a06879a68
7
- data.tar.gz: 38c722a480c7a98c17c9835489c307df19a55d8e10a6467c47d1b445911df1f5e17f12dafb70ff01339812cbb5fb928fe566d96e0a6b807ccf0e38f5de61b4ff
6
+ metadata.gz: 4f133f80912c16ab83d91a1caf20eeeb08c8face23a89a40044f73c1f9348ecd346126c4011f5a647d7c376ff17ed979e897b58829b009f80c7dd617a8b8efa2
7
+ data.tar.gz: c49f562ec6d0fa8110540f85155368102490d1a2427648cf0aedd2c7f94ede77f82570a4b1a55591d663bd3855347fe79e95b49e55a72ebc16f7eb19ac34e34a
data/lib/tincan/sender.rb CHANGED
@@ -43,6 +43,7 @@ module Tincan
43
43
  # from the returned list of receiver list keys.
44
44
  # @return [Array] An array of keys identifying all receiver pointer lists.
45
45
  def keys_for_receivers(object_name, exclude: [])
46
+ exclude ||= []
46
47
  receiver_list_key = key_for_elements(object_name, 'receivers')
47
48
  receivers = redis_client.smembers(receiver_list_key)
48
49
  receivers.reject { |r| exclude.include?(r) }.map do |receiver|
@@ -1,3 +1,3 @@
1
1
  module Tincan
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -143,8 +143,8 @@ describe Tincan::Receiver do
143
143
  thread.kill
144
144
  end
145
145
 
146
- xit 'calls a stored exception block on failure and keeps on ticking' do
147
- pending 'Fails when part of an entire run, but not by itself.'
146
+ it 'calls a stored exception block on failure and keeps on ticking' do
147
+ pending 'Sometimes fails when part of an entire run, but not by itself.'
148
148
  thread = Thread.new { receiver.listen }
149
149
 
150
150
  get_receivers = -> { redis.smembers('data:object_one:receivers') }
data/spec/sender_spec.rb CHANGED
@@ -57,6 +57,12 @@ describe Tincan::Sender do
57
57
  result = sender.keys_for_receivers('object', exclude: 'bork')
58
58
  expect(result).to eq(%w(data:object:some_client:messages))
59
59
  end
60
+
61
+ it 'can handle an nil list of clients to exclude' do
62
+ redis.sadd('data:object:receivers', 'bork')
63
+ result = sender.keys_for_receivers('object', exclude: nil)
64
+ expect(result).to eq(%w(data:object:bork:messages data:object:some_client:messages))
65
+ end
60
66
  end
61
67
 
62
68
  describe :flush_all_queues_for_object do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captainu-tincan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Kreeger