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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 44f5b503e0f1a8763a429eac6f2b36a7cea4ac94
4
- data.tar.gz: f2158bcb16256e0f2179df5ca8a012ffa4ca4a6d
2
+ SHA256:
3
+ metadata.gz: 02b58bb5f5d2ed76658b0d6c8f5d8e8fe88cfcfbfaf725c71192505186a61981
4
+ data.tar.gz: 5ba37a1132b070d75002f48aeb8f140f7244011219079a50de455fb4c538a00b
5
5
  SHA512:
6
- metadata.gz: 04b3c2c4cd1ba2e1915f655ecc516b8c73ca9757373717174fbe7fd963e2bd19ac90ff4cffd9993e07db1b0165428e6bcbf4e23c4d46d147f33bf7d2add80955
7
- data.tar.gz: 96bdbc109a5314f299eb1daf2064fb585b24224a91969e70bec1f9bd5d4460a88b95533121c45bddf989fbd13ac4d0109967b4afc55b88156cd72e447bf49f11
6
+ metadata.gz: 9fb100ea7f324ec173d78230345efd9e5d9650d3a9b064a74e297174709830e04eea1c9b442d6a91c3883fddf650445bf766c6d3a1a9b6112ec5dc32a504c5cb
7
+ data.tar.gz: ca02c5272f09358e0361b0fb98cd60b8de5281cc1d98887b04e261aa11c30e2f5aa557b66f5305c454f5c820a3655e539411d7f188a6f9faa59bc4e5c6f8a5d3
@@ -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
@@ -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
  [![Code Climate](https://codeclimate.com/github/enkessler/childprocess.svg)](https://codeclimate.com/github/enkessler/childprocess)
13
13
  [![Coverage Status](https://coveralls.io/repos/enkessler/childprocess/badge.svg?branch=master)](https://coveralls.io/r/enkessler/childprocess?branch=master)
14
14
 
15
- ***
16
- **This project currently needs a new maintainer. If anyone is interested, please contact me, [enkessler](https://github.com/enkessler).**
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
- begin
76
- loop { print r.readpartial(8192) }
77
- rescue EOFError
78
- end
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.
@@ -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%
@@ -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
- STDOUT.reopen(stdout || "/dev/null")
33
- STDERR.reopen(stderr || "/dev/null")
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(_pid, ::Process::WNOHANG | ::Process::WUNTRACED)
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 _pid
53
+ _, status = ::Process.waitpid2(@pid)
54
+
54
55
  set_exit_code(status)
55
56
  end
56
57
  end
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = '1.0.1'
2
+ VERSION = '2.0.0'
3
3
  end
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: 1.0.1
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-02-03 00:00:00.000000000 Z
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: '0'
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
- rubyforge_project: childprocess
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