childprocess 1.0.1 → 2.0.0
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.
- checksums.yaml +5 -5
- data/.travis.yml +1 -10
- data/CHANGELOG.md +6 -0
- data/README.md +12 -8
- data/appveyor.yml +6 -18
- data/childprocess.gemspec +2 -0
- data/lib/childprocess/unix/fork_exec_process.rb +10 -2
- data/lib/childprocess/unix/process.rb +3 -2
- data/lib/childprocess/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 02b58bb5f5d2ed76658b0d6c8f5d8e8fe88cfcfbfaf725c71192505186a61981
|
4
|
+
data.tar.gz: 5ba37a1132b070d75002f48aeb8f140f7244011219079a50de455fb4c538a00b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb100ea7f324ec173d78230345efd9e5d9650d3a9b064a74e297174709830e04eea1c9b442d6a91c3883fddf650445bf766c6d3a1a9b6112ec5dc32a504c5cb
|
7
|
+
data.tar.gz: ca02c5272f09358e0361b0fb98cd60b8de5281cc1d98887b04e261aa11c30e2f5aa557b66f5305c454f5c820a3655e539411d7f188a6f9faa59bc4e5c6f8a5d3
|
data/.travis.yml
CHANGED
@@ -5,12 +5,10 @@ os:
|
|
5
5
|
rvm:
|
6
6
|
- jruby-9.1.9.0
|
7
7
|
- rbx-3
|
8
|
-
- 2.0.0
|
9
|
-
- 2.1
|
10
|
-
- 2.2
|
11
8
|
- 2.3
|
12
9
|
- 2.4
|
13
10
|
- 2.5
|
11
|
+
- 2.6
|
14
12
|
- ruby-head
|
15
13
|
|
16
14
|
sudo: false
|
@@ -42,10 +40,3 @@ matrix:
|
|
42
40
|
- rvm: jruby-9.2.5.0
|
43
41
|
jdk: openjdk11
|
44
42
|
env: "JAVA_OPTS_FOR_SPECS='--add-opens java.base/java.io=org.jruby.dist --add-opens java.base/sun.nio.ch=org.jruby.dist'"
|
45
|
-
exclude:
|
46
|
-
# Travis does not provide 1.9.3 on OSX
|
47
|
-
- rvm: 1.9.3
|
48
|
-
os: osx
|
49
|
-
# Travis does not provide 2.0.0 on it latest version of OSX
|
50
|
-
- rvm: 2.0.0
|
51
|
-
os: osx
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### Version 2.0.0 / 2019-07-11
|
2
|
+
|
3
|
+
* [#148](https://github.com/enkessler/childprocess/pull/148): Drop support for Ruby 2.0, 2.1, and 2.2
|
4
|
+
* [#149](https://github.com/enkessler/childprocess/pull/149): Fix Unix fork reopen to be compatible with Ruby 2.6
|
5
|
+
* [#152](https://github.com/enkessler/childprocess/pull/152)/[#154](https://github.com/enkessler/childprocess/pull/154): Fix hangs and permission errors introduced in Ruby 2.6 for leader processes of process groups
|
6
|
+
|
1
7
|
### Version 1.0.1 / 2019-02-03
|
2
8
|
|
3
9
|
* [#143](https://github.com/enkessler/childprocess/pull/144): Fix installs by adding `rake` gem as runtime dependency
|
data/README.md
CHANGED
@@ -12,9 +12,9 @@ a standalone library.
|
|
12
12
|
[](https://codeclimate.com/github/enkessler/childprocess)
|
13
13
|
[](https://coveralls.io/r/enkessler/childprocess?branch=master)
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# Requirements
|
16
|
+
|
17
|
+
* Ruby 2.3+, JRuby 9+
|
18
18
|
|
19
19
|
# Usage
|
20
20
|
|
@@ -70,14 +70,18 @@ r, w = IO.pipe
|
|
70
70
|
proc = ChildProcess.build("echo", "foo")
|
71
71
|
proc.io.stdout = proc.io.stderr = w
|
72
72
|
proc.start
|
73
|
-
w.close
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
Thread.new {
|
75
|
+
begin
|
76
|
+
loop do
|
77
|
+
print r.readpartial(8192)
|
78
|
+
end
|
79
|
+
rescue EOFError
|
80
|
+
end
|
81
|
+
}
|
79
82
|
|
80
83
|
proc.wait
|
84
|
+
w.close
|
81
85
|
```
|
82
86
|
|
83
87
|
Note that if you just want to get the output of a command, the backtick method on Kernel may be a better fit.
|
data/appveyor.yml
CHANGED
@@ -2,24 +2,6 @@ version: '1.0.{build}'
|
|
2
2
|
|
3
3
|
environment:
|
4
4
|
matrix:
|
5
|
-
- CHILDPROCESS_POSIX_SPAWN: true
|
6
|
-
CHILDPROCESS_UNSET: should-be-unset
|
7
|
-
RUBY_VERSION: 200-x64
|
8
|
-
- CHILDPROCESS_POSIX_SPAWN: false
|
9
|
-
CHILDPROCESS_UNSET: should-be-unset
|
10
|
-
RUBY_VERSION: 200-x64
|
11
|
-
- CHILDPROCESS_POSIX_SPAWN: true
|
12
|
-
CHILDPROCESS_UNSET: should-be-unset
|
13
|
-
RUBY_VERSION: 21-x64
|
14
|
-
- CHILDPROCESS_POSIX_SPAWN: false
|
15
|
-
CHILDPROCESS_UNSET: should-be-unset
|
16
|
-
RUBY_VERSION: 21-x64
|
17
|
-
- CHILDPROCESS_POSIX_SPAWN: true
|
18
|
-
CHILDPROCESS_UNSET: should-be-unset
|
19
|
-
RUBY_VERSION: 22-x64
|
20
|
-
- CHILDPROCESS_POSIX_SPAWN: false
|
21
|
-
CHILDPROCESS_UNSET: should-be-unset
|
22
|
-
RUBY_VERSION: 22-x64
|
23
5
|
- CHILDPROCESS_POSIX_SPAWN: true
|
24
6
|
CHILDPROCESS_UNSET: should-be-unset
|
25
7
|
RUBY_VERSION: 23-x64
|
@@ -38,6 +20,12 @@ environment:
|
|
38
20
|
- CHILDPROCESS_POSIX_SPAWN: false
|
39
21
|
CHILDPROCESS_UNSET: should-be-unset
|
40
22
|
RUBY_VERSION: 25-x64
|
23
|
+
- CHILDPROCESS_POSIX_SPAWN: true
|
24
|
+
CHILDPROCESS_UNSET: should-be-unset
|
25
|
+
RUBY_VERSION: 26-x64
|
26
|
+
- CHILDPROCESS_POSIX_SPAWN: false
|
27
|
+
CHILDPROCESS_UNSET: should-be-unset
|
28
|
+
RUBY_VERSION: 26-x64
|
41
29
|
|
42
30
|
install:
|
43
31
|
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
data/childprocess.gemspec
CHANGED
@@ -19,6 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
+
s.required_ruby_version = '>= 2.3.0'
|
23
|
+
|
22
24
|
s.add_development_dependency "rspec", "~> 3.0"
|
23
25
|
s.add_development_dependency "yard", "~> 0.0"
|
24
26
|
s.add_development_dependency 'coveralls', '< 1.0'
|
@@ -29,8 +29,16 @@ module ChildProcess
|
|
29
29
|
exec_r.close
|
30
30
|
set_env
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
if stdout
|
33
|
+
STDOUT.reopen(stdout)
|
34
|
+
else
|
35
|
+
STDOUT.reopen("/dev/null", "a+")
|
36
|
+
end
|
37
|
+
if stderr
|
38
|
+
STDERR.reopen(stderr)
|
39
|
+
else
|
40
|
+
STDERR.reopen("/dev/null", "a+")
|
41
|
+
end
|
34
42
|
|
35
43
|
if duplex?
|
36
44
|
STDIN.reopen(reader)
|
@@ -29,7 +29,7 @@ module ChildProcess
|
|
29
29
|
return true if @exit_code
|
30
30
|
|
31
31
|
assert_started
|
32
|
-
pid, status = ::Process.waitpid2(
|
32
|
+
pid, status = ::Process.waitpid2(@pid, ::Process::WNOHANG | ::Process::WUNTRACED)
|
33
33
|
pid = nil if pid == 0 # may happen on jruby
|
34
34
|
|
35
35
|
log(:pid => pid, :status => status)
|
@@ -50,7 +50,8 @@ module ChildProcess
|
|
50
50
|
if exited?
|
51
51
|
exit_code
|
52
52
|
else
|
53
|
-
_, status = ::Process.waitpid2
|
53
|
+
_, status = ::Process.waitpid2(@pid)
|
54
|
+
|
54
55
|
set_exit_code(status)
|
55
56
|
end
|
56
57
|
end
|
data/lib/childprocess/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childprocess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -139,15 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
139
|
requirements:
|
140
140
|
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
142
|
+
version: 2.3.0
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
|
-
|
150
|
-
rubygems_version: 2.5.2.3
|
149
|
+
rubygems_version: 3.0.3
|
151
150
|
signing_key:
|
152
151
|
specification_version: 4
|
153
152
|
summary: A simple and reliable solution for controlling external programs running
|