promise.rb 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.devtools +0 -2
- data/lib/promise.rb +7 -0
- data/lib/promise/version.rb +1 -1
- data/spec/promise_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGFmYWVmYmRmNWEyMjkyYmMwY2Y0NjA2OWE1YzBjZTM2NTlkNzFmMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODg2NzU0ZjFmZTZjY2YzODFlYzJiYzUwMWE1OGQ2NWE4MGVlYTM0ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzA4MmZhMGJiNTliYWIxZjQ5NmY1YTc2NTE5ZTQzY2Y1MTEzNzEyZGVjY2Yy
|
10
|
+
MjdkODk5ZGYxMjMwMjZiYjUzODdmZmY2YzIxNDk1M2Y3ZWQ1M2RkMjdhY2Jl
|
11
|
+
MTRhNzY2M2E4NWExNjY1OTg3OTYzYmI2NzY0MzZlNDE3ZmI2YWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2MxOTAzZWMzMmUyNGY4MTVhODEwZWYwODNhNmRkYmMwYjU1MWNjNTI3ZGQz
|
14
|
+
MTZhZDliZWQyZWRjNmVkN2E4MDA5YzhhZjBmMDkxMTYxNTQzYTRkZWU3N2Ix
|
15
|
+
MTgyZGMyZTNiMjJiMTczZDRmNTA4ZjEzMDE2MDZhMjc4YmI4ZWY=
|
data/Gemfile.devtools
CHANGED
data/lib/promise.rb
CHANGED
@@ -63,6 +63,13 @@ class Promise
|
|
63
63
|
arg.freeze
|
64
64
|
callbacks.each { |callback| defer(callback, arg) }
|
65
65
|
end
|
66
|
+
|
67
|
+
# Callback#assume_state uses #dispatch as returned_promise's on_fulfill
|
68
|
+
# and on_reject callback. Without an explicit return value, the implicit
|
69
|
+
# return value might be the callbacks array, and thus returned_promise
|
70
|
+
# would be fulfilled (or rejected) with that array. It would be frozen
|
71
|
+
# from then on, letting further calls to #then crash.
|
72
|
+
nil
|
66
73
|
end
|
67
74
|
|
68
75
|
def maybe_dispatch(fulfill_callback, reject_callback)
|
data/lib/promise/version.rb
CHANGED
data/spec/promise_spec.rb
CHANGED
@@ -332,4 +332,16 @@ describe Promise do
|
|
332
332
|
expect(called).to eq(false)
|
333
333
|
end
|
334
334
|
end
|
335
|
+
|
336
|
+
describe '#fulfill' do
|
337
|
+
it 'does not return anything' do
|
338
|
+
expect(subject.fulfill(nil)).to eq(nil)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
describe '#reject' do
|
343
|
+
it 'does not return anything' do
|
344
|
+
expect(subject.reject(nil)).to eq(nil)
|
345
|
+
end
|
346
|
+
end
|
335
347
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promise.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Gierth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|