1
0
Fork 0
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:
Joshua Peek 2014-12-23 00:22:53 -06:00
parent 900da3c817
commit 0ef664e93d

View file

@ -169,6 +169,21 @@ module ExecJS
arg arg
}.join(" ") }.join(" ")
end 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 else
def exec_runtime(filename) def exec_runtime(filename)
io = IO.popen(binary.split(' ') << filename, @popen_options.merge({err: [:child, :out]})) io = IO.popen(binary.split(' ') << filename, @popen_options.merge({err: [:child, :out]}))