mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
c3c1800708
commit
21e255913c
2 changed files with 5 additions and 3 deletions
|
@ -125,7 +125,7 @@ module EnvUtil
|
||||||
|
|
||||||
def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
|
def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
|
||||||
encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error,
|
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,
|
signal: :TERM,
|
||||||
rubybin: EnvUtil.rubybin, precommand: nil,
|
rubybin: EnvUtil.rubybin, precommand: nil,
|
||||||
**opt)
|
**opt)
|
||||||
|
@ -141,6 +141,8 @@ module EnvUtil
|
||||||
out_p.set_encoding(encoding) if out_p
|
out_p.set_encoding(encoding) if out_p
|
||||||
err_p.set_encoding(encoding) if err_p
|
err_p.set_encoding(encoding) if err_p
|
||||||
end
|
end
|
||||||
|
ios.each {|i, o = i|opt[i] = o} if ios
|
||||||
|
|
||||||
c = "C"
|
c = "C"
|
||||||
child_env = {}
|
child_env = {}
|
||||||
LANG_ENVS.each {|lc| child_env[lc] = c}
|
LANG_ENVS.each {|lc| child_env[lc] = c}
|
||||||
|
@ -152,7 +154,7 @@ module EnvUtil
|
||||||
end
|
end
|
||||||
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
|
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
|
||||||
args = [args] if args.kind_of?(String)
|
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
|
in_c.close
|
||||||
out_c&.close
|
out_c&.close
|
||||||
out_c = nil
|
out_c = nil
|
||||||
|
|
|
@ -278,7 +278,7 @@ module Test
|
||||||
capture_stdout = false
|
capture_stdout = false
|
||||||
opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit)
|
opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit)
|
||||||
res_p, res_c = IO.pipe
|
res_p, res_c = IO.pipe
|
||||||
opt[res_c.fileno] = res_c.fileno
|
opt[:ios] = [res_c]
|
||||||
end
|
end
|
||||||
src = <<eom
|
src = <<eom
|
||||||
# -*- coding: #{line += __LINE__; src.encoding}; -*-
|
# -*- coding: #{line += __LINE__; src.encoding}; -*-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue