1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
akr 2014-05-30 14:06:39 +00:00
parent ab4c6921cb
commit 9a51bc62f9

View file

@ -18,12 +18,13 @@ module RubyRunner
def run_ruby(option_list) def run_ruby(option_list)
puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
inn, out, err, wait = Open3.popen3(RUBY, *option_list) Open3.popen3(RUBY, *option_list) {|inn, out, err, wait|
inn.close inn.close
@exit = wait ? wait.value : $? @exit = wait ? wait.value : $?
@out = out.read @out = out.read
@err = err.read @err = err.read
}
puts "OUTPUT: [#{@out}]" if @verbose puts "OUTPUT: [#{@out}]" if @verbose
puts "ERROR: [#{@err}]" if @verbose puts "ERROR: [#{@err}]" if @verbose