em-promise 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -20
- data/lib/em-promise/q.rb +2 -1
- data/lib/em-promise/version.rb +2 -2
- data/spec/defer_spec.rb +2 -2
- metadata +1 -1
data/MIT-LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright 2012 YOURNAME
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright 2012 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/em-promise/q.rb
CHANGED
@@ -33,6 +33,7 @@ module EventMachine
|
|
33
33
|
# The callbacks are called with a single argument, the result or rejection reason.
|
34
34
|
#
|
35
35
|
# @param [Proc, Proc, &blk] callbacks success, error, success_block
|
36
|
+
# @return [Promise] Returns an unresolved promise for chaining
|
36
37
|
def then(callback = nil, errback = nil, &blk)
|
37
38
|
result = Q.defer
|
38
39
|
|
@@ -168,7 +169,7 @@ module EventMachine
|
|
168
169
|
# Combines multiple promises into a single promise that is resolved when all of the input
|
169
170
|
# promises are resolved.
|
170
171
|
#
|
171
|
-
# @param [Promise] a number of promises that will be combined into a single promise
|
172
|
+
# @param [*Promise] Promises a number of promises that will be combined into a single promise
|
172
173
|
# @return [Promise] Returns a single promise that will be resolved with an array of values,
|
173
174
|
# each value corresponding to the promise at the same index in the `promises` array. If any of
|
174
175
|
# the promises is resolved with a rejection, this resulting promise will be resolved with the
|
data/lib/em-promise/version.rb
CHANGED
data/spec/defer_spec.rb
CHANGED
@@ -21,7 +21,7 @@ describe EventMachine::Q do
|
|
21
21
|
|
22
22
|
|
23
23
|
it "should call the callback in the next turn" do
|
24
|
-
deferred2 = EM::
|
24
|
+
deferred2 = EM::Q.defer
|
25
25
|
EventMachine.run {
|
26
26
|
@promise.then(proc {|result|
|
27
27
|
@log << result
|
@@ -285,7 +285,7 @@ describe EventMachine::Q do
|
|
285
285
|
}, @default_fail)
|
286
286
|
@promise.then(proc {|result|
|
287
287
|
@log << result
|
288
|
-
EM::
|
288
|
+
EM::Q.reject('some reason')
|
289
289
|
}, @default_fail)
|
290
290
|
@promise.then(proc {|result|
|
291
291
|
@log << result
|