tiny_bus 3.9.0 → 3.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tiny_bus.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1da58fd94dfa2c8ad51e0b0031ee4e8372a04f2fd8f9089ef605f2e5827cc85
4
- data.tar.gz: 6cc67c07bf48e25acc9ec74da88a0012cc967f150746c6c54aae32ce3ccec309
3
+ metadata.gz: 1f6201eb2bc53b029c8dcc27548450d434d13570e5872eebd518afda1334f6a6
4
+ data.tar.gz: 16e57d782d5d2de01f2797eb43c045a90c3e5f5d8e69c1f3a5f96e0c393aced7
5
5
  SHA512:
6
- metadata.gz: 19208ab76103862362cf7eefe6707717521222b4f5ae657ac92606b77647dbb3a308c12dba6ff1fe47184d4ceab3c3d2bf80aaed9fed7eed53b7d06666b51325
7
- data.tar.gz: a1e704fc61c63c2bdc9b471b3befd96deb5b0497514e8a38be437c6b2a57529e0c1d3d851b19942604e64592f24ff919aa78b53eac7bfd068e85435dcc8139c0
6
+ metadata.gz: 126de1cfa30575a46c1a8bf5f8eeb4fbe2692b2bd03650570f7830a603df3a34096c5b26437e762163a25fb350f5863e56fb7346ad1b4975271d99cd42c4ae6b
7
+ data.tar.gz: d2b26c2b70ad93c57a4e1e328584e1ed8beacd463e46c970e591e3d74062a1d1340d38d132a5ba427b4a47c27fbf57cacfb4827f0c3137fbf167eddf479e4dad
data/lib/tiny_bus.rb CHANGED
@@ -101,10 +101,14 @@ class TinyBus
101
101
 
102
102
  # removes a subscriber from a topic
103
103
  def unsub(topic, subber)
104
- @subs[topic]&.delete(subber)
105
- @dead_topics << topic if @subs[topic].empty?
104
+ topics = topic.is_a?(Array) ? topic : [topic]
105
+
106
+ topics.each do |t|
107
+ @subs[t]&.delete(subber)
108
+ @dead_topics << t if @subs[t]&.empty?
106
109
 
107
- msg({ @topic_key => 'unsub', 'from_topic' => topic, 'subber' => _to_subber_id(subber) }, 'TINYBUS-UNSUB')
110
+ msg({ @topic_key => 'unsub', 'from_topic' => t, 'subber' => _to_subber_id(subber) }, 'TINYBUS-UNSUB')
111
+ end
108
112
  end
109
113
 
110
114
  def _to_subber_id(subber)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-29 00:00:00.000000000 Z
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tiny_log