ruby-changes:65413
From: Nobuyoshi <ko1@a...>
Date: Mon, 8 Mar 2021 10:03:25 +0900 (JST)
Subject: [ruby-changes:65413] 21e255913c (master): [ruby/stringio] Pass IOs as separate list for ruby 2.x
https://git.ruby-lang.org/ruby.git/commit/?id=21e255913c From 21e255913c5d00426bcc4d69e3d444b45635a534 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 7 Mar 2021 13:45:38 +0900 Subject: [ruby/stringio] Pass IOs as separate list for ruby 2.x https://github.com/ruby/stringio/commit/74e39858eb --- tool/lib/envutil.rb | 6 ++++-- tool/lib/test/unit/core_assertions.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb index 937e112..0391b90 100644 --- a/tool/lib/envutil.rb +++ b/tool/lib/envutil.rb @@ -125,7 +125,7 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/tool/lib/envutil.rb#L125 def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false, encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error, - stdout_filter: nil, stderr_filter: nil, + stdout_filter: nil, stderr_filter: nil, ios: nil, signal: :TERM, rubybin: EnvUtil.rubybin, precommand: nil, **opt) @@ -141,6 +141,8 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/tool/lib/envutil.rb#L141 out_p.set_encoding(encoding) if out_p err_p.set_encoding(encoding) if err_p end + ios.each {|i, o = i|opt[i] = o} if ios + c = "C" child_env = {} LANG_ENVS.each {|lc| child_env[lc] = c} @@ -152,7 +154,7 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/tool/lib/envutil.rb#L154 end child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS'] args = [args] if args.kind_of?(String) - pid = spawn(child_env, *precommand, rubybin, *args, **opt) + pid = spawn(child_env, *precommand, rubybin, *args, opt) in_c.close out_c&.close out_c = nil diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb index 118c0d1..c7762f0 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -278,7 +278,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L278 capture_stdout = false opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit) res_p, res_c = IO.pipe - opt[res_c.fileno] = res_c.fileno + opt[:ios] = [res_c] end src = <<eom # -*- coding: #{line += __LINE__; src.encoding}; -*- -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/