mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Always redirect stderr in jruby
This commit is contained in:
parent
900da3c817
commit
0ef664e93d
1 changed files with 15 additions and 0 deletions
|
@ -169,6 +169,21 @@ module ExecJS
|
|||
arg
|
||||
}.join(" ")
|
||||
end
|
||||
elsif RUBY_ENGINE == 'jruby'
|
||||
require 'shellwords'
|
||||
|
||||
def exec_runtime(filename)
|
||||
command = "#{Shellwords.join(binary.split(' ') << filename)} 2>&1"
|
||||
io = IO.popen(command, @popen_options)
|
||||
output = io.read
|
||||
io.close
|
||||
|
||||
if $?.success?
|
||||
output
|
||||
else
|
||||
raise RuntimeError, output
|
||||
end
|
||||
end
|
||||
else
|
||||
def exec_runtime(filename)
|
||||
io = IO.popen(binary.split(' ') << filename, @popen_options.merge({err: [:child, :out]}))
|
||||
|
|
Loading…
Reference in a new issue