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

envutil.rb: precommand in invoke_ruby [ci skip]

* test/lib/envutil.rb (invoke_ruby): add precommand option to
  invoke ruby via some other commands, e.g., sudo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-10-15 02:20:20 +00:00
parent 8b182a7f7d
commit b1ef4d8096

View file

@ -59,7 +59,7 @@ module EnvUtil
encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error,
stdout_filter: nil, stderr_filter: nil,
signal: :TERM,
rubybin: EnvUtil.rubybin,
rubybin: EnvUtil.rubybin, precommand: nil,
**opt)
timeout = apply_timeout_scale(timeout)
reprieve = apply_timeout_scale(reprieve) if reprieve
@ -81,7 +81,7 @@ module EnvUtil
child_env.update(args.shift)
end
args = [args] if args.kind_of?(String)
pid = spawn(child_env, rubybin, *args, **opt)
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
in_c.close
out_c.close if capture_stdout
err_c.close if capture_stderr && capture_stderr != :merge_to_stdout