event_bus 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +0 -7
- data/README.md +4 -1
- data/lib/event_bus.rb +35 -0
- data/lib/event_bus/registrations.rb +40 -9
- data/spec/lib/event_bus_spec.rb +170 -101
- data/spec/spec_helper.rb +2 -5
- metadata +32 -28
- data/Gemfile.lock +0 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4f2564b2f02ca631c0946ce255404047cdca69c1
|
4
|
+
data.tar.gz: 513f9d5702367b1d8848aab1fa957a94c6696112
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 743af19ba1318b886d7915ac7a9f04a463a5fdde5c517b619d9104f0b4c082c3389c8e4413521c00cbd8b20b7a18577ceccb770d99aa50ace5347d16ff06cff8
|
7
|
+
data.tar.gz: dc8bb15ce2f0e581332de4dac97d159d4f202633958ab7aefcb1711b3da3ad3ad915a3d389d23441f87634a5e15ba57c2f1f52bad963a1e45f2ee4a79070a256
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,9 @@ Climate](https://codeclimate.com/github/kevinrutherford/event_bus.png)](https://
|
|
20
20
|
* Subscribe to events using names or regex patterns.
|
21
21
|
* Works with Rails.
|
22
22
|
* Works without Rails.
|
23
|
+
* Completely synchronous (use the
|
24
|
+
[event_bg_bus](https://rubygems.org/gems/event_bg_bus) gem for async operation
|
25
|
+
using Sidekiq).
|
23
26
|
|
24
27
|
## Installation
|
25
28
|
|
@@ -123,7 +126,7 @@ See the specs for more detailed usage scenarios.
|
|
123
126
|
|
124
127
|
## Compatibility
|
125
128
|
|
126
|
-
Tested with Ruby 1.9.x, JRuby
|
129
|
+
Tested with Ruby 2.1, 2.0, 1.9.x, JRuby.
|
127
130
|
See the [build status](https://travis-ci.org/kevinrutherford/event_bus)
|
128
131
|
for details.
|
129
132
|
|
data/lib/event_bus.rb
CHANGED
@@ -68,6 +68,22 @@ class EventBus
|
|
68
68
|
|
69
69
|
alias :listen_for :subscribe
|
70
70
|
|
71
|
+
#
|
72
|
+
# Register a global error handler
|
73
|
+
#
|
74
|
+
# The supplied block will be called once for each error that is raised by
|
75
|
+
# any listener, for any event.
|
76
|
+
#
|
77
|
+
# The block will be provided with two parameters, the listener that errored,
|
78
|
+
# and the payload of the event.
|
79
|
+
#
|
80
|
+
# @param blk the block to be called when any unhandled error occurs in a listener
|
81
|
+
# @return [EventBus] the EventBus, ready to be called again
|
82
|
+
def on_error(&blk)
|
83
|
+
registrations.on_error &blk
|
84
|
+
self
|
85
|
+
end
|
86
|
+
|
71
87
|
#
|
72
88
|
# Delete all current listener registrations
|
73
89
|
#
|
@@ -78,6 +94,25 @@ class EventBus
|
|
78
94
|
self
|
79
95
|
end
|
80
96
|
|
97
|
+
#
|
98
|
+
# Adds a subscriber that only listens for the duration of the block. Mostly
|
99
|
+
# useful for testing event dispatching.
|
100
|
+
#
|
101
|
+
# @param pattern [String, Regexp] listen for any events whose name matches this pattern
|
102
|
+
# @param listener the object to be notified when a matching event occurs
|
103
|
+
# @param method_name [Symbol] the method to be called on +listener+ when a matching event occurs
|
104
|
+
# @return [EventBus] the EventBus, ready to be called again.
|
105
|
+
def with_temporary_subscriber(pattern, listener = nil, method_name = nil)
|
106
|
+
subscribe(pattern, listener, method_name)
|
107
|
+
temporary_subscriber = registrations.last_subscriber
|
108
|
+
|
109
|
+
yield
|
110
|
+
|
111
|
+
self
|
112
|
+
ensure
|
113
|
+
registrations.remove_subscriber(temporary_subscriber)
|
114
|
+
end
|
115
|
+
|
81
116
|
private
|
82
117
|
|
83
118
|
def subscribe_pattern(pattern, listener, method_name, &blk)
|
@@ -7,41 +7,72 @@ class EventBus
|
|
7
7
|
class Registrations
|
8
8
|
include Singleton
|
9
9
|
|
10
|
-
def initialize
|
11
|
-
clear
|
12
|
-
end
|
13
|
-
|
14
10
|
def announce(event_name, payload)
|
15
11
|
full_payload = {event_name: event_name}.merge(payload)
|
16
|
-
|
17
|
-
listener
|
12
|
+
listeners.each do |listener|
|
13
|
+
pass_event_to listener, event_name, full_payload
|
18
14
|
end
|
19
15
|
end
|
20
16
|
|
21
17
|
def clear
|
22
|
-
|
18
|
+
listeners.clear
|
23
19
|
end
|
24
20
|
|
25
21
|
def add_method(pattern, listener, method_name)
|
26
|
-
|
22
|
+
listeners << Registration.new(pattern, listener, method_name)
|
27
23
|
end
|
28
24
|
|
29
25
|
def add_block(pattern, &blk)
|
30
|
-
|
26
|
+
listeners << BlockRegistration.new(pattern, blk)
|
27
|
+
end
|
28
|
+
|
29
|
+
def on_error(&blk)
|
30
|
+
@error_handler = blk
|
31
|
+
end
|
32
|
+
|
33
|
+
def remove_subscriber(subscriber)
|
34
|
+
listeners.delete subscriber
|
35
|
+
end
|
36
|
+
|
37
|
+
def last_subscriber
|
38
|
+
listeners.last
|
31
39
|
end
|
32
40
|
|
33
41
|
private
|
42
|
+
def listeners
|
43
|
+
@listeners ||= []
|
44
|
+
end
|
45
|
+
|
46
|
+
def error_handler
|
47
|
+
@error_handler
|
48
|
+
end
|
49
|
+
|
50
|
+
def pass_event_to(listener, event_name, payload)
|
51
|
+
begin
|
52
|
+
listener.respond(event_name, payload)
|
53
|
+
rescue => error
|
54
|
+
error_handler.call(listener.receiver, payload.merge(error: error)) if error_handler
|
55
|
+
end
|
56
|
+
end
|
34
57
|
|
35
58
|
Registration = Struct.new(:pattern, :listener, :method_name) do
|
36
59
|
def respond(event_name, payload)
|
37
60
|
listener.send(method_name, payload) if pattern === event_name
|
38
61
|
end
|
62
|
+
|
63
|
+
def receiver
|
64
|
+
listener
|
65
|
+
end
|
39
66
|
end
|
40
67
|
|
41
68
|
BlockRegistration = Struct.new(:pattern, :block) do
|
42
69
|
def respond(event_name, payload)
|
43
70
|
block.call(payload) if pattern === event_name
|
44
71
|
end
|
72
|
+
|
73
|
+
def receiver
|
74
|
+
block
|
75
|
+
end
|
45
76
|
end
|
46
77
|
|
47
78
|
end
|
data/spec/lib/event_bus_spec.rb
CHANGED
@@ -1,159 +1,208 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe EventBus do
|
4
|
-
let(:listener) { double(:listener) }
|
5
|
-
let(:event_name) { 'aa123bb' }
|
6
|
-
let(:receiving_method) { :receiving_method_name }
|
4
|
+
let(:listener) { double(:listener, handler: true) }
|
7
5
|
|
8
6
|
before do
|
9
7
|
EventBus.clear
|
10
8
|
end
|
11
9
|
|
12
|
-
describe
|
10
|
+
describe "a temporary subscriber" do
|
11
|
+
context "receives events during the subscription block" do
|
12
|
+
When { EventBus.with_temporary_subscriber(/test/, listener, :handler) { EventBus.publish 'test'} }
|
13
|
+
Then { listener.should have_received(:handler).with(event_name: 'test') }
|
14
|
+
end
|
13
15
|
|
14
|
-
|
15
|
-
EventBus.
|
16
|
-
|
17
|
-
|
16
|
+
context "does not receive events after the subscription block" do
|
17
|
+
Given { EventBus.with_temporary_subscriber(/test/, listener, :handler) { } }
|
18
|
+
When { EventBus.publish 'test' }
|
19
|
+
Then { listener.should_not have_received(:handler).with(event_name: 'test') }
|
18
20
|
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'publishing' do
|
26
|
+
|
27
|
+
context 'accepts a string for the event name' do
|
28
|
+
Given { EventBus.subscribe(/aa123bb/, listener, :handler) }
|
29
|
+
When { EventBus.publish('aa123bb') }
|
30
|
+
Then { listener.should have_received(:handler).with(event_name: 'aa123bb') }
|
25
31
|
end
|
26
32
|
|
27
|
-
|
28
|
-
|
33
|
+
context 'accepts a symbol for the event name' do
|
34
|
+
Given { EventBus.subscribe(/aa123bb/, listener, :handler) }
|
35
|
+
When { EventBus.publish(:aa123bb) }
|
36
|
+
Then { listener.should have_received(:handler).with(event_name: :aa123bb) }
|
29
37
|
end
|
30
38
|
|
31
|
-
|
32
|
-
EventBus.publish(
|
39
|
+
context 'rejects any other type as the event name' do
|
40
|
+
When(:result) { EventBus.publish(123) }
|
41
|
+
Then { result.should have_failed(ArgumentError) }
|
33
42
|
end
|
34
43
|
|
35
|
-
|
36
|
-
EventBus.subscribe(
|
37
|
-
|
38
|
-
|
44
|
+
context 'adds the event name to the payload' do
|
45
|
+
Given { EventBus.subscribe('aa123bb', listener, :handler) }
|
46
|
+
When { EventBus.publish('aa123bb', a: 56) }
|
47
|
+
Then { listener.should have_received(:handler).with(event_name: 'aa123bb', a: 56) }
|
39
48
|
end
|
40
49
|
|
41
|
-
|
42
|
-
EventBus.subscribe(
|
43
|
-
|
44
|
-
|
50
|
+
context 'allows the payload to be omitted' do
|
51
|
+
Given { EventBus.subscribe('aa123bb', listener, :handler) }
|
52
|
+
When { EventBus.publish('aa123bb') }
|
53
|
+
Then { listener.should have_received(:handler).with(event_name: 'aa123bb') }
|
45
54
|
end
|
46
55
|
|
47
56
|
end
|
48
57
|
|
49
|
-
describe '
|
58
|
+
describe 'publishing with errors' do
|
59
|
+
Given(:error) { RuntimeError.new }
|
60
|
+
Given(:erroring_listener) { double(:erroring_listener) }
|
61
|
+
Given(:error_handler) { double(:error_handler, handle_error: true) }
|
62
|
+
Given { erroring_listener.stub(:handler) { raise error } }
|
63
|
+
|
64
|
+
context 'sends the event to the second listener when the first errors' do
|
65
|
+
Given { EventBus.subscribe('aa123bb', erroring_listener, :handler) }
|
66
|
+
Given { EventBus.subscribe('aa123bb', listener, :handler) }
|
67
|
+
When { EventBus.publish('aa123bb') }
|
68
|
+
Then { listener.should have_received(:handler).with(event_name: 'aa123bb') }
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'with an error handler' do
|
72
|
+
Given { EventBus.on_error do |listener, payload|
|
73
|
+
error_handler.handle_error(listener, payload)
|
74
|
+
end }
|
75
|
+
|
76
|
+
context 'when the listener is an object' do
|
77
|
+
Given { EventBus.subscribe('aa123bb', erroring_listener, :handler) }
|
78
|
+
When { EventBus.publish('aa123bb') }
|
79
|
+
Then { error_handler.should have_received(:handle_error).with(erroring_listener, event_name: 'aa123bb', error: error ) }
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'when the listener is a block' do
|
83
|
+
Given { EventBus.subscribe('aa123bb') {|info| raise error } }
|
84
|
+
When { EventBus.publish('aa123bb') }
|
85
|
+
Then { error_handler.should have_received(:handle_error).with(instance_of(Proc), event_name: 'aa123bb', error: error) }
|
86
|
+
end
|
50
87
|
|
51
|
-
it 'returns itself, to facilitate cascades' do
|
52
|
-
EventBus.subscribe(event_name, listener, receiving_method).should == EventBus
|
53
88
|
end
|
54
89
|
|
90
|
+
end
|
91
|
+
|
92
|
+
describe 'subscribing' do
|
93
|
+
|
55
94
|
context 'with a regex pattern' do
|
56
|
-
|
57
|
-
EventBus.subscribe(/123b/, listener,
|
58
|
-
|
59
|
-
|
95
|
+
context 'sends the event to a matching listener' do
|
96
|
+
Given { EventBus.subscribe(/123b/, listener, :handler) }
|
97
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2) }
|
98
|
+
Then { listener.should have_received(:handler).with(a: 1, b: 2, event_name: 'aa123bb') }
|
60
99
|
end
|
61
100
|
|
62
|
-
|
63
|
-
EventBus.subscribe(/123a/, listener,
|
64
|
-
|
65
|
-
|
101
|
+
context 'does not send the event to non-matching listeners' do
|
102
|
+
Given { EventBus.subscribe(/123a/, listener, :handler) }
|
103
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2, event_name: 'aa123bb') }
|
104
|
+
Then { listener.should_not have_received(:handler) }
|
66
105
|
end
|
67
106
|
end
|
68
107
|
|
69
108
|
context 'with a string pattern' do
|
70
|
-
|
71
|
-
EventBus.subscribe(
|
72
|
-
|
73
|
-
|
109
|
+
context 'sends the event to a matching listener' do
|
110
|
+
Given { EventBus.subscribe('aa123bb', listener, :handler) }
|
111
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2) }
|
112
|
+
Then { listener.should have_received(:handler).with(a: 1, b: 2, event_name: 'aa123bb') }
|
74
113
|
end
|
75
114
|
|
76
|
-
|
77
|
-
EventBus.subscribe('blah', listener,
|
78
|
-
|
79
|
-
|
115
|
+
context 'does not send the event to non-matching listeners' do
|
116
|
+
Given { EventBus.subscribe('blah', listener, :handler) }
|
117
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2, event_name: 'aa123bb') }
|
118
|
+
Then { listener.should_not have_received(:handler) }
|
80
119
|
end
|
81
120
|
end
|
82
121
|
|
83
122
|
context 'with a symbol pattern' do
|
84
|
-
|
85
|
-
|
86
|
-
EventBus.
|
87
|
-
listener.
|
88
|
-
EventBus.publish(event_name, a: 1, b: 2)
|
123
|
+
context 'sends the event to a matching listener' do
|
124
|
+
Given { EventBus.subscribe(:aa123bb, listener, :handler) }
|
125
|
+
When { EventBus.publish(:aa123bb, a: 1, b: 2) }
|
126
|
+
Then { listener.should have_received(:handler).with(a: 1, b: 2, event_name: :aa123bb) }
|
89
127
|
end
|
90
128
|
|
91
|
-
|
92
|
-
EventBus.subscribe(:blah, listener,
|
93
|
-
|
94
|
-
|
129
|
+
context 'does not send the event to non-matching listeners' do
|
130
|
+
Given { EventBus.subscribe(:blah, listener, :handler) }
|
131
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2, event_name: 'aa123bb') }
|
132
|
+
Then { listener.should_not have_received(:handler) }
|
95
133
|
end
|
96
134
|
end
|
97
135
|
|
98
|
-
context '
|
99
|
-
|
100
|
-
|
136
|
+
context 'subscribing a block' do
|
137
|
+
Given(:spy) { double(:spy, block_called: nil) }
|
138
|
+
Given {
|
139
|
+
EventBus.subscribe('aa123bb') {|info| spy.block_called(info) }
|
140
|
+
}
|
141
|
+
|
142
|
+
context 'calls the block when the event matches' do
|
143
|
+
When { EventBus.publish('aa123bb', a: 1, b: 2) }
|
144
|
+
Then { spy.should have_received(:block_called).with(a: 1, b: 2, event_name: 'aa123bb') }
|
101
145
|
end
|
102
146
|
|
103
|
-
|
104
|
-
|
147
|
+
context 'does not call the block when the event does not match' do
|
148
|
+
When { EventBus.publish('blah') }
|
149
|
+
Then { spy.should_not have_received(:block_called) }
|
105
150
|
end
|
106
151
|
end
|
107
152
|
|
108
|
-
context 'with a
|
109
|
-
|
110
|
-
|
153
|
+
context 'with a listener object' do
|
154
|
+
Given { EventBus.subscribe(listener) }
|
155
|
+
|
156
|
+
context 'calls a listener method whose name matches the event name' do
|
157
|
+
When { EventBus.publish('handler', a: 2, b: 3) }
|
158
|
+
Then { listener.should have_received(:handler).with(a: 2, b: 3, event_name: 'handler') }
|
111
159
|
end
|
112
160
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
block_called = true
|
117
|
-
info.should == {a: 1, b: 2, event_name: event_name}
|
118
|
-
end
|
119
|
-
EventBus.publish(event_name, a: 1, b: 2)
|
120
|
-
block_called.should be_true
|
161
|
+
context 'calls a listener method with symbol whose name matches the event name' do
|
162
|
+
When { EventBus.publish(:handler, a: 2, b: 3) }
|
163
|
+
Then { listener.should have_received(:handler).with(a: 2, b: 3, event_name: :handler) }
|
121
164
|
end
|
122
165
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
EventBus.publish(event_name)
|
127
|
-
block_called.should be_false
|
166
|
+
context 'calls no method when there is no name match' do
|
167
|
+
When { EventBus.publish('b_method') }
|
168
|
+
Then { listener.should_not have_received(:handler) }
|
128
169
|
end
|
170
|
+
|
129
171
|
end
|
130
172
|
|
131
|
-
context '
|
173
|
+
context 'when called incorrectly' do
|
132
174
|
|
133
|
-
|
134
|
-
listener.should_receive(:a_method).with(a: 2, b: 3, event_name: 'a_method')
|
135
|
-
EventBus.subscribe(listener)
|
136
|
-
EventBus.publish('a_method', a: 2, b: 3)
|
137
|
-
end
|
175
|
+
context 'when specifying the event name' do
|
138
176
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
end
|
177
|
+
context 'must provide a method or a block' do
|
178
|
+
When(:subscribe) { EventBus.subscribe('blah', listener) }
|
179
|
+
Then { subscribe.should have_failed(ArgumentError) }
|
180
|
+
end
|
144
181
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
182
|
+
context 'cannot provide a method AND a block' do
|
183
|
+
When(:subscribe) { EventBus.subscribe('blah', listener, :handler) {|info| }}
|
184
|
+
Then { subscribe.should have_failed(ArgumentError) }
|
185
|
+
end
|
186
|
+
|
187
|
+
context 'must provide a block when no method is supplied' do
|
188
|
+
When(:subscribe) { EventBus.subscribe('blah') }
|
189
|
+
Then { subscribe.should have_failed(ArgumentError) }
|
190
|
+
end
|
150
191
|
|
151
|
-
it 'will not accept other arguments' do
|
152
|
-
expect { EventBus.subscribe(listener, double) }.to raise_error(ArgumentError)
|
153
192
|
end
|
154
193
|
|
155
|
-
|
156
|
-
|
194
|
+
context 'when specifying a listener object' do
|
195
|
+
|
196
|
+
context 'when a method is also provided' do
|
197
|
+
When(:subscribe) { EventBus.subscribe(listener, double) }
|
198
|
+
Then { subscribe.should have_failed(ArgumentError) }
|
199
|
+
end
|
200
|
+
|
201
|
+
context 'when a block is also provided' do
|
202
|
+
When(:subscribe) { EventBus.subscribe(listener) {|info| } }
|
203
|
+
Then { subscribe.should have_failed(ArgumentError) }
|
204
|
+
end
|
205
|
+
|
157
206
|
end
|
158
207
|
|
159
208
|
end
|
@@ -161,15 +210,35 @@ describe EventBus do
|
|
161
210
|
end
|
162
211
|
|
163
212
|
describe '.clear' do
|
164
|
-
|
165
|
-
EventBus.subscribe(
|
166
|
-
EventBus.clear
|
167
|
-
|
168
|
-
|
213
|
+
context 'removes all previous registrants' do
|
214
|
+
Given { EventBus.subscribe('aa123bb', listener, :handler) }
|
215
|
+
Given { EventBus.clear }
|
216
|
+
When { EventBus.publish('aa123bb', {}) }
|
217
|
+
Then { listener.should_not have_received(:handler) }
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
context 'EventBus methods cascade' do
|
223
|
+
|
224
|
+
context 'clear' do
|
225
|
+
When(:result) { EventBus.clear }
|
226
|
+
Then { result.should == EventBus }
|
227
|
+
end
|
228
|
+
|
229
|
+
context 'publish' do
|
230
|
+
When(:result) { EventBus.publish('aa123bb', {}) }
|
231
|
+
Then { result.should == EventBus }
|
232
|
+
end
|
233
|
+
|
234
|
+
context 'subscribe' do
|
235
|
+
When(:result) { EventBus.subscribe('aa123bb', listener, :handler) }
|
236
|
+
Then { result.should == EventBus }
|
169
237
|
end
|
170
238
|
|
171
|
-
|
172
|
-
EventBus.
|
239
|
+
context 'with_temporary_subscriber' do
|
240
|
+
When(:result) { EventBus.with_temporary_subscriber('aa123bb', listener, :handler) { } }
|
241
|
+
Then { result.should == EventBus }
|
173
242
|
end
|
174
243
|
end
|
175
244
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,62 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_bus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kevin Rutherford
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '2.12'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '2.12'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
42
|
+
name: rspec-given
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-spies
|
48
57
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
58
|
requirements:
|
51
|
-
- -
|
59
|
+
- - ">="
|
52
60
|
- !ruby/object:Gem::Version
|
53
61
|
version: '0'
|
54
62
|
type: :development
|
55
63
|
prerelease: false
|
56
64
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
65
|
requirements:
|
59
|
-
- -
|
66
|
+
- - ">="
|
60
67
|
- !ruby/object:Gem::Version
|
61
68
|
version: '0'
|
62
69
|
description: event_bus provides support for application-wide events, without coupling
|
@@ -66,10 +73,9 @@ executables: []
|
|
66
73
|
extensions: []
|
67
74
|
extra_rdoc_files: []
|
68
75
|
files:
|
69
|
-
- .rspec
|
70
|
-
- .yardopts
|
76
|
+
- ".rspec"
|
77
|
+
- ".yardopts"
|
71
78
|
- Gemfile
|
72
|
-
- Gemfile.lock
|
73
79
|
- README.md
|
74
80
|
- Rakefile
|
75
81
|
- lib/event_bus.rb
|
@@ -78,29 +84,27 @@ files:
|
|
78
84
|
- spec/spec_helper.rb
|
79
85
|
homepage: http://github.com/kevinrutherford/event_bus
|
80
86
|
licenses: []
|
87
|
+
metadata: {}
|
81
88
|
post_install_message:
|
82
89
|
rdoc_options: []
|
83
90
|
require_paths:
|
84
91
|
- lib
|
85
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
93
|
requirements:
|
88
|
-
- -
|
94
|
+
- - ">="
|
89
95
|
- !ruby/object:Gem::Version
|
90
96
|
version: '0'
|
91
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
98
|
requirements:
|
94
|
-
- -
|
99
|
+
- - ">="
|
95
100
|
- !ruby/object:Gem::Version
|
96
101
|
version: '0'
|
97
102
|
requirements: []
|
98
103
|
rubyforge_project:
|
99
|
-
rubygems_version:
|
104
|
+
rubygems_version: 2.2.2
|
100
105
|
signing_key:
|
101
|
-
specification_version:
|
106
|
+
specification_version: 4
|
102
107
|
summary: A simple pubsub event bus for Ruby applications
|
103
108
|
test_files:
|
104
109
|
- spec/lib/event_bus_spec.rb
|
105
110
|
- spec/spec_helper.rb
|
106
|
-
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
event_bus (0.1.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.3)
|
10
|
-
multi_json (1.7.2)
|
11
|
-
rake (10.0.4)
|
12
|
-
rspec (2.13.0)
|
13
|
-
rspec-core (~> 2.13.0)
|
14
|
-
rspec-expectations (~> 2.13.0)
|
15
|
-
rspec-mocks (~> 2.13.0)
|
16
|
-
rspec-core (2.13.1)
|
17
|
-
rspec-expectations (2.13.0)
|
18
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
19
|
-
rspec-mocks (2.13.1)
|
20
|
-
simplecov (0.7.1)
|
21
|
-
multi_json (~> 1.0)
|
22
|
-
simplecov-html (~> 0.7.1)
|
23
|
-
simplecov-html (0.7.1)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
event_bus!
|
30
|
-
rake (~> 10.0.1)
|
31
|
-
rspec (~> 2.12)
|
32
|
-
simplecov
|