summaryrefslogtreecommitdiff
path: root/test/rake/support
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 14:06:39 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-30 14:06:39 +0000
commit9a51bc62f9c3965754ce98ff844f95a55b01d4ad (patch)
tree5d48c64ebbe71226477246ba379a9432f0d4cc57 /test/rake/support
parentab4c6921cb97be13be874a78a5a0bcc450ca9b84 (diff)
Use the block form of Open3.popen3 to close FDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/support')
-rw-r--r--test/rake/support/ruby_runner.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/rake/support/ruby_runner.rb b/test/rake/support/ruby_runner.rb
index 404e61a668..d51dd24b89 100644
--- a/test/rake/support/ruby_runner.rb
+++ b/test/rake/support/ruby_runner.rb
@@ -18,12 +18,13 @@ module RubyRunner
def run_ruby(option_list)
puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
- inn, out, err, wait = Open3.popen3(RUBY, *option_list)
- inn.close
+ Open3.popen3(RUBY, *option_list) {|inn, out, err, wait|
+ inn.close
- @exit = wait ? wait.value : $?
- @out = out.read
- @err = err.read
+ @exit = wait ? wait.value : $?
+ @out = out.read
+ @err = err.read
+ }
puts "OUTPUT: [#{@out}]" if @verbose
puts "ERROR: [#{@err}]" if @verbose