tiny_bus 3.7.0 → 3.7.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 +3 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10175a5f3eb8391e273b860aefdccd67ff469fb603a063fecdeb58858af6066b
4
- data.tar.gz: 2b2a8e6babff0734b57f0b91e2d12bd0782133e0291f4a561441969815deed0e
3
+ metadata.gz: 803568daf9dd822ea55895b457386681ca10188a55fc23e906837b3fbce106fa
4
+ data.tar.gz: 9377bf6ace10208f47140c30df9ac826d9fa268e668da1bc589d143cb2571366
5
5
  SHA512:
6
- metadata.gz: 9b1a67cd7b2d5a5e9a93f245c4f9f5b14c70edfcb99a0c64d0b145f3b4349865db668846b5cc9399fbf32f6ddf9ea399f245232535c999c4f8a65754ca9545e0
7
- data.tar.gz: 0a22452c404f6e61664b2ce84b4b21f8b686537625c8bbb43c38294e2303262bdab72482d92025f88be4e3a23eac1004a39b1c59850303d01aa76c7d656213df
6
+ metadata.gz: ec5d4689105f2b985f79906e7ed027dea7409b3d75077c9ce71b8e8ee7d48b30e8f5b10a81ff8f9335a7ce0996e5a0fd71dfaf3c5f8c140c36987e97ef61e692
7
+ data.tar.gz: 92cedd46357367de1ce95e830f835d483cec6c765576c34e93facf4f711ec353255205ce4ba2d51b545ca5b8f03f9563ac3ad6042e321d2162a0947355f58be7
data/lib/tiny_bus.rb CHANGED
@@ -115,12 +115,12 @@ class TinyBus
115
115
  msg = @translator&.pipe(msg) || msg
116
116
 
117
117
  topic = msg[@topic_key]
118
-
119
118
  subbers = @subs[topic]
120
119
 
120
+ @stats[topic] ||= 0
121
121
  @stats[@total_key] += 1
122
+ @stats[topic] += 1
122
123
  if (subbers&.length || 0) > 0
123
- @stats[topic] += 1
124
124
  subbers.each{|s| s.msg(msg) }
125
125
  @log.send(lvl, "S #{msg}")
126
126
  else
@@ -146,7 +146,7 @@ class TinyBus
146
146
  <<~DEBUG
147
147
  TinyBus stats: #{@stats.keys.length > 0 ? "\n " + @stats.keys.sort.map{|t| "#{t.rjust(12)}: #{@stats[t]}" }.join("\n ") : '<NONE>'}
148
148
  Topics & Subscribers:
149
- #{@subs.map{|topic, subbers| "#{topic}\n #{subbers.map(&:to_s).join("\n ")}" }.join("\n ") }
149
+ #{@subs.map{|topic, subbers| "#{topic}:\n #{subbers.map(&:to_s).join("\n ")}" }.join("\n ") }
150
150
  DEBUG
151
151
  end
152
152
  end
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.7.0
4
+ version: 3.7.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-04 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tiny_log