async-process 1.2.0 → 1.3.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 +11 -10
- data/README.md +3 -5
- data/async-process.gemspec +3 -2
- data/lib/async/process.rb +23 -2
- data/lib/async/process/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17677c56f62cf2c52800b8f5c170ae9a33cc5831a9411e6da18111ad0583d839
|
4
|
+
data.tar.gz: 05321edace94d4e4e702ff8cb085c5d3d7142895a7b72c5ba4910491c1c49870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d52fc598599bf650b26e11c35937afc9f5e72d93efce4e73599479274f2b22777e6b0e7ba3862e9bcead6b24750a93b163e9146779b0a3d40fc0b86017abaef8
|
7
|
+
data.tar.gz: ec44c938e36b7893cda558eeb19a941817fc724400636092b942c09189e216438a720288ea843bb5ed47b0e0dd2cf489e93f0fbb1e7da5413c61b311d41f2356
|
data/.travis.yml
CHANGED
@@ -2,17 +2,18 @@ language: ruby
|
|
2
2
|
dist: xenial
|
3
3
|
cache: bundler
|
4
4
|
|
5
|
-
rvm:
|
6
|
-
- 2.3
|
7
|
-
- 2.4
|
8
|
-
- 2.5
|
9
|
-
- 2.6
|
10
|
-
- jruby-head
|
11
|
-
- ruby-head
|
12
|
-
- rbx-3
|
13
|
-
|
14
5
|
matrix:
|
6
|
+
include:
|
7
|
+
- rvm: 2.5
|
8
|
+
- rvm: 2.6
|
9
|
+
- rvm: 2.7
|
10
|
+
- rvm: 2.6
|
11
|
+
env: COVERAGE=PartialSummary,Coveralls
|
12
|
+
- rvm: jruby-head
|
13
|
+
env: JRUBY_OPTS="--debug -X+O"
|
14
|
+
- rvm: truffleruby
|
15
|
+
- rvm: ruby-head
|
15
16
|
allow_failures:
|
17
|
+
- rvm: truffleruby
|
16
18
|
- rvm: ruby-head
|
17
19
|
- rvm: jruby-head
|
18
|
-
- rvm: rbx-3
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Async::Process
|
2
2
|
|
3
|
-
Implements `Process.spawn` for [async].
|
3
|
+
Implements `Process.spawn` and `Process.capture` for [async].
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://travis-ci.com/socketry/async-process.svg?branch=master)](https://travis-ci.com/socketry/async-process)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/socketry/async-process.svg)](https://codeclimate.com/github/socketry/async-process)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/socketry/async-process/badge.svg)](https://coveralls.io/r/socketry/async-process)
|
8
8
|
|
@@ -48,9 +48,7 @@ Internally, we use a thread, since `nio4r` doesn't support monitoring pids.
|
|
48
48
|
|
49
49
|
## See Also
|
50
50
|
|
51
|
-
- [async-
|
52
|
-
- [async-dns](https://github.com/socketry/async-dns) — Asynchronous DNS resolver and server.
|
53
|
-
- [async-rspec](https://github.com/socketry/async-rspec) — Shared contexts for running async specs.
|
51
|
+
- [async-container](https://github.com/socketry/async-container) — Execute multiple isolated threads and/or processes.
|
54
52
|
|
55
53
|
## License
|
56
54
|
|
data/async-process.gemspec
CHANGED
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_dependency "async-io", "~> 1.0"
|
21
21
|
spec.add_development_dependency "async-rspec", "~> 1.1"
|
22
22
|
|
23
|
-
spec.add_development_dependency "
|
24
|
-
spec.add_development_dependency "
|
23
|
+
spec.add_development_dependency "covered"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "rake", "~> 11.0"
|
25
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
27
|
end
|
data/lib/async/process.rb
CHANGED
@@ -21,10 +21,31 @@
|
|
21
21
|
require 'async/process/version'
|
22
22
|
require 'async/process/child'
|
23
23
|
|
24
|
+
require 'async/io'
|
25
|
+
require 'kernel/sync'
|
26
|
+
|
24
27
|
module Async
|
25
28
|
module Process
|
26
|
-
def self.spawn(*
|
27
|
-
Child.new(*
|
29
|
+
def self.spawn(*arguments, **options)
|
30
|
+
Child.new(*arguments, **options).wait
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.capture(*arguments, **options)
|
34
|
+
input, output = Async::IO.pipe
|
35
|
+
options[:out] = output.io
|
36
|
+
|
37
|
+
runner = Async do
|
38
|
+
spawn(*arguments, **options)
|
39
|
+
ensure
|
40
|
+
output.close
|
41
|
+
end
|
42
|
+
|
43
|
+
Sync do
|
44
|
+
input.read
|
45
|
+
ensure
|
46
|
+
runner.wait
|
47
|
+
input.close
|
48
|
+
end
|
28
49
|
end
|
29
50
|
end
|
30
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-process
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2020-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -52,34 +52,48 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: covered
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - "
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - "
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '11.0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '11.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
144
|
- !ruby/object:Gem::Version
|
131
145
|
version: '0'
|
132
146
|
requirements: []
|
133
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.1.2
|
134
148
|
signing_key:
|
135
149
|
specification_version: 4
|
136
150
|
summary: Asynchronous process spawning.
|