event_object 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/event_object/array.rb +5 -0
- data/lib/event_object/object.rb +1 -1
- data/lib/event_object/version.rb +1 -1
- data/spec/event_object_spec.rb +25 -1
- 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: e81c485937d85b0c9cd88b13cac0567f4aa0e03f
|
4
|
+
data.tar.gz: 7ce74e45fd9f99329ffb8db70cf1c1852027307a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a40e1cdc625aea5a08916da033eb5cc600a2b0255f9f1d84914baf57263e0fa6b0beb2c61e641d80ade7469ab5c2027f5de70d25da3e6d1a1140868b4a56bf
|
7
|
+
data.tar.gz: 2956ba950da83365cef180a7788e02b6eeb0ffa93003dcb7a8b97cc144bdbf21043c42728cb1011d80e97a78d7d471dd6a828d2e3c47632af6c21e554f65a1d7
|
data/lib/event_object/array.rb
CHANGED
data/lib/event_object/object.rb
CHANGED
data/lib/event_object/version.rb
CHANGED
data/spec/event_object_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe EventObject do
|
|
4
4
|
using EventObject
|
5
5
|
|
6
6
|
class EventEmitter
|
7
|
-
events :success, :error
|
7
|
+
events :success, :error, :data
|
8
8
|
end
|
9
9
|
|
10
10
|
class ParentObject
|
@@ -83,4 +83,28 @@ describe EventObject do
|
|
83
83
|
obj.stop_listen(emitter, :success)
|
84
84
|
expect(emitter.success!).to be_empty
|
85
85
|
end
|
86
|
+
|
87
|
+
it "events chain" do
|
88
|
+
emitter = EventEmitter.new
|
89
|
+
emitter.on :data do |chunk|
|
90
|
+
chunk + " world"
|
91
|
+
end
|
92
|
+
emitter.on :data do |chunk|
|
93
|
+
chunk + "!!!"
|
94
|
+
end
|
95
|
+
|
96
|
+
data = emitter.data.chain('Hello')
|
97
|
+
|
98
|
+
expect(data).to eq('Hello world!!!')
|
99
|
+
end
|
100
|
+
|
101
|
+
it "define singleton method" do
|
102
|
+
expect {
|
103
|
+
object = Object.new
|
104
|
+
object.def :foo do
|
105
|
+
1
|
106
|
+
end
|
107
|
+
expect(object.foo).to be 1
|
108
|
+
}.to_not raise_error
|
109
|
+
end
|
86
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- che
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|