[前][次][番号順一覧][スレッド一覧]

ruby-changes:34176

From: akr <ko1@a...>
Date: Fri, 30 May 2014 23:06:50 +0900 (JST)
Subject: [ruby-changes:34176] akr:r46257 (trunk): Use the block form of Open3.popen3 to close FDs.

akr	2014-05-30 23:06:39 +0900 (Fri, 30 May 2014)

  New Revision: 46257

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46257&view=revision

  Log:
    Use the block form of Open3.popen3 to close FDs.

  Modified files:
    trunk/test/rake/support/ruby_runner.rb
Index: test/rake/support/ruby_runner.rb
===================================================================
--- test/rake/support/ruby_runner.rb	(revision 46256)
+++ test/rake/support/ruby_runner.rb	(revision 46257)
@@ -18,12 +18,13 @@ module RubyRunner https://github.com/ruby/ruby/blob/trunk/test/rake/support/ruby_runner.rb#L18
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]