childprocess 0.2.4 → 0.2.5
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/.travis.yml +2 -1
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/childprocess/jruby/process.rb +3 -3
- data/lib/childprocess/version.rb +1 -1
- data/spec/childprocess_spec.rb +26 -1
- data/spec/spec_helper.rb +1 -1
- metadata +5 -6
data/.travis.yml
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -80,8 +80,8 @@ module ChildProcess
|
|
80
80
|
|
81
81
|
def setup_io
|
82
82
|
if @io
|
83
|
-
|
84
|
-
|
83
|
+
redirect(@process.getErrorStream, @io.stderr)
|
84
|
+
redirect(@process.getInputStream, @io.stdout)
|
85
85
|
else
|
86
86
|
@process.getErrorStream.close
|
87
87
|
@process.getInputStream.close
|
@@ -103,7 +103,7 @@ module ChildProcess
|
|
103
103
|
return
|
104
104
|
end
|
105
105
|
|
106
|
-
Pump.new(input, output.to_outputstream).run
|
106
|
+
@pumps << Pump.new(input, output.to_outputstream).run
|
107
107
|
end
|
108
108
|
|
109
109
|
def stop_pumps
|
data/lib/childprocess/version.rb
CHANGED
data/spec/childprocess_spec.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require File.expand_path('../spec_helper', __FILE__)
|
4
4
|
|
5
5
|
describe ChildProcess do
|
6
|
-
|
7
6
|
EXIT_TIMEOUT = 10
|
8
7
|
|
9
8
|
it "returns self when started" do
|
@@ -145,6 +144,32 @@ describe ChildProcess do
|
|
145
144
|
end
|
146
145
|
end
|
147
146
|
|
147
|
+
it "can redirect stdout only" do
|
148
|
+
process = ruby(<<-CODE)
|
149
|
+
[STDOUT, STDERR].each_with_index do |io, idx|
|
150
|
+
io.sync = true
|
151
|
+
io.puts idx
|
152
|
+
end
|
153
|
+
|
154
|
+
sleep 0.2
|
155
|
+
CODE
|
156
|
+
|
157
|
+
out = Tempfile.new("stdout-spec")
|
158
|
+
|
159
|
+
begin
|
160
|
+
process.io.stdout = out
|
161
|
+
|
162
|
+
process.start
|
163
|
+
process.wait
|
164
|
+
|
165
|
+
out.rewind
|
166
|
+
|
167
|
+
out.read.should == "0\n"
|
168
|
+
ensure
|
169
|
+
out.close
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
148
173
|
it "can write to stdin if duplex = true" do
|
149
174
|
process = cat
|
150
175
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childprocess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jari Bakken
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements: []
|
155
155
|
|
156
156
|
rubyforge_project: childprocess
|
157
|
-
rubygems_version: 1.8.
|
157
|
+
rubygems_version: 1.8.9
|
158
158
|
signing_key:
|
159
159
|
specification_version: 3
|
160
160
|
summary: This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.
|
@@ -166,4 +166,3 @@ test_files:
|
|
166
166
|
- spec/spec_helper.rb
|
167
167
|
- spec/unix_spec.rb
|
168
168
|
- spec/windows_spec.rb
|
169
|
-
has_rdoc:
|