signal 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/signal.rb +1 -1
- data/lib/signal/version.rb +1 -1
- data/spec/signal/signal_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bab949237a86fb74f7d3d89ce215a614f87f725
|
4
|
+
data.tar.gz: cc343238a6eacaa010c910ebff962729baa62f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1358d2e51f6f5fb757fdad35e74325adc15be310d6a1b56ea7dd432b7861afee4ffd2b32fbe41d473bd8335eb39b11d7957ce29fb587cdfdbb7012e191c34034
|
7
|
+
data.tar.gz: 55b1bd38fbb3b9ac9eb10c29feb6f3cfb5bf4116e30400e91da211571661080132ba3edd5bbd780139747c0271fcc9497e5bd1c15e717d810f2b66743210cf10
|
data/lib/signal.rb
CHANGED
@@ -38,7 +38,7 @@ module Signal
|
|
38
38
|
def emit_signal(type, event, *args)
|
39
39
|
listeners.each do |listener|
|
40
40
|
method_name = "#{type}_#{event}"
|
41
|
-
listener.send(method_name, *args) if listener.respond_to?(method_name)
|
41
|
+
listener.send(method_name, *args) if listener.respond_to?(method_name, true)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/signal/version.rb
CHANGED
data/spec/signal/signal_spec.rb
CHANGED
@@ -105,4 +105,19 @@ describe Signal do
|
|
105
105
|
observable.emit(:ready, 1, 2, 3)
|
106
106
|
end
|
107
107
|
end
|
108
|
+
|
109
|
+
context 'mixed listeners' do
|
110
|
+
it 'calls all listeners' do
|
111
|
+
callable.respond_to(:on_ready)
|
112
|
+
another_callable = Callable.new
|
113
|
+
|
114
|
+
expect(callable).to receive(:called).ordered
|
115
|
+
expect(another_callable).to receive(:called).ordered
|
116
|
+
|
117
|
+
observable
|
118
|
+
.add_listener(callable)
|
119
|
+
.on(:ready, &another_callable)
|
120
|
+
.emit(:ready)
|
121
|
+
end
|
122
|
+
end
|
108
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|