childprocess 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,5 @@ rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
4
  - 1.9.3
5
- - jruby
5
+ - jruby
6
+ - rbx
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2011 Jari Bakken
1
+ Copyright (c) 2010-2012 Jari Bakken
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -65,4 +65,4 @@ Note on Patches/Pull Requests
65
65
  Copyright
66
66
  ---------
67
67
 
68
- Copyright (c) 2010-2011 Jari Bakken. See LICENSE for details.
68
+ Copyright (c) 2010-2012 Jari Bakken. See LICENSE for details.
@@ -80,8 +80,8 @@ module ChildProcess
80
80
 
81
81
  def setup_io
82
82
  if @io
83
- @pumps << redirect(@process.getErrorStream, @io.stderr)
84
- @pumps << redirect(@process.getInputStream, @io.stdout)
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
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -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
 
@@ -19,7 +19,7 @@ module ChildProcessSpecHelper
19
19
  end
20
20
 
21
21
  def invalid_process
22
- @process = ChildProcess.build("unlikely-to-exist")
22
+ @process = ChildProcess.build("unlikelytoexist")
23
23
  end
24
24
 
25
25
  def ignored(signal)
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
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: 2011-12-27 00:00:00 Z
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.10
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: