cf-message-bus 0.3.2 → 0.3.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: 3f44b8edf33ee0f3ade43fb6c5bfa11220852138
4
- data.tar.gz: 4932e90cd8c99ec5dc77406edf0faca2653f211c
3
+ metadata.gz: 8b94ffc1cf8ce05972ef1a379d85dceed24f1445
4
+ data.tar.gz: 69f3396dd9525f9e5af0698995339e54525eed7a
5
5
  SHA512:
6
- metadata.gz: d0f4874010fc8fb44f62384bc74ebaec31d4ab013e0219a4bfd341cbd1a9a24fa1199be68a27308b5a53796b00a0f359a2216bb24d16ce986cf6f1d7017430a3
7
- data.tar.gz: d4717ddabca602a0c29e9a6333cb7064692eee0254292063e81e7d2e5d17b0d5d70746aeeb398fc27f0a32dbd156588c2b6e96f8ab6d23ec65ec6a36b669c365
6
+ metadata.gz: bc6b734d5fe581a6bb7609eddc0d8608474eb6fa662252b7c192e95a3d7e2e1c976c4a9367d1f18d5db3c4996dcd288b8b4130f58229ef02a6f35ff73c58e0a4
7
+ data.tar.gz: a6de8e2871c1a8ec6532b3c02e77adc2af64a67503b24a5d5738ddcb04fc1ca225957bebd497ed26de14c25f75185d310e64ecc314634d4dcd5e717b68776997
@@ -4,11 +4,11 @@ module CfMessageBus
4
4
 
5
5
  def initialize(config = {})
6
6
  @logger = config[:logger]
7
- @subscriptions = Hash.new { |hash, key| hash[key] = [] }
8
7
  @requests = {}
9
8
  @synchronous_requests = {}
10
9
  @published_messages = []
11
10
  @published_synchronous_messages = []
11
+ reset
12
12
  end
13
13
 
14
14
  def subscribe(subject, opts = {}, &blk)
@@ -17,7 +17,7 @@ module CfMessageBus
17
17
  end
18
18
 
19
19
  def publish(subject, message = nil, inbox = nil, &callback)
20
- @subscriptions.fetch(subject, []).each do |subscription|
20
+ @subscriptions[subject].each do |subscription|
21
21
  subscription.call(stringify_keys(message))
22
22
  end
23
23
 
@@ -87,7 +87,7 @@ module CfMessageBus
87
87
  end
88
88
 
89
89
  def reset
90
- @subscriptions = {}
90
+ @subscriptions = Hash.new { |hash, key| hash[key] = [] }
91
91
  end
92
92
 
93
93
  private
@@ -1,3 +1,3 @@
1
1
  module CfMessageBus
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-message-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudFoundry Core Team