async-await 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/async-await.gemspec +4 -2
- data/lib/async/await.rb +11 -5
- data/lib/async/await/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 982110e1afe4ee24f5931671df9df8036170b4b2b3cb4dcc8bc1e924739c2099
|
4
|
+
data.tar.gz: d6fd5e852edadf8a2b48090847225ac1df2e372ac37c4fbd126b0dc6970c9637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f05e45a97e6cac339a4f6a1bba1e59d2a78ebe7f8f0741adb95525f9c376b5c358685d7a3b68ef3df98ece474f269903fd205bc74d7002b0c6a77183f0cd943f
|
7
|
+
data.tar.gz: 0c43a301fb491a90611d14717885913c6934c943f2616d744e23e360bc86b43cb33cd6752dddd7edbcbff370220bbd916f23fa994d302d938f9b9f7719921e89
|
data/.travis.yml
CHANGED
data/async-await.gemspec
CHANGED
@@ -15,10 +15,12 @@ Gem::Specification.new do |spec|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
spec.require_paths = ["lib"]
|
18
|
-
|
18
|
+
|
19
19
|
spec.add_dependency "async", "~> 1.3"
|
20
20
|
spec.add_development_dependency "async-rspec", "~> 1.1"
|
21
|
-
|
21
|
+
|
22
|
+
spec.add_dependency "ruby2_keywords"
|
23
|
+
|
22
24
|
spec.add_development_dependency "covered"
|
23
25
|
spec.add_development_dependency "bundler"
|
24
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/async/await.rb
CHANGED
@@ -21,6 +21,8 @@
|
|
21
21
|
require_relative 'await/version'
|
22
22
|
require_relative 'await/methods'
|
23
23
|
|
24
|
+
require 'ruby2_keywords'
|
25
|
+
|
24
26
|
module Async
|
25
27
|
module Await
|
26
28
|
def self.included(klass)
|
@@ -33,15 +35,17 @@ module Async
|
|
33
35
|
|
34
36
|
remove_method(name)
|
35
37
|
|
36
|
-
define_method(name) do |*
|
38
|
+
define_method(name) do |*arguments, &block|
|
37
39
|
if task = Task.current?
|
38
|
-
original_method.bind(self).call(*
|
40
|
+
original_method.bind(self).call(*arguments, &block)
|
39
41
|
else
|
40
42
|
Async::Reactor.run do
|
41
|
-
original_method.bind(self).call(*
|
43
|
+
original_method.bind(self).call(*arguments, &block)
|
42
44
|
end.wait
|
43
45
|
end
|
44
46
|
end
|
47
|
+
|
48
|
+
ruby2_keywords(name)
|
45
49
|
end
|
46
50
|
|
47
51
|
def async(name)
|
@@ -49,11 +53,13 @@ module Async
|
|
49
53
|
|
50
54
|
remove_method(name)
|
51
55
|
|
52
|
-
define_method(name) do |*
|
56
|
+
define_method(name) do |*arguments, &block|
|
53
57
|
Async::Reactor.run do |task|
|
54
|
-
original_method.bind(self).call(*
|
58
|
+
original_method.bind(self).call(*arguments, &block)
|
55
59
|
end
|
56
60
|
end
|
61
|
+
|
62
|
+
ruby2_keywords(name)
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
data/lib/async/await/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-await
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ruby2_keywords
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: covered
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|