Closed
Description
The newest version of JRuby fixes the old issue where popen3
would not pass a status object to the block, which is awesome. Unfortunately, while this makes capture3
run, it is not quite correct:
jruby-1.7.8 :001 > require 'open3' => true jruby-1.7.8 :002 > Open3.capture3('echo') => ["{}\n", "", #] jruby-1.7.8 :003 > Open3.capture3('echo', :foo => :bar) => ["{:foo=>:bar}\n", "", #]
As you will observe, the output includes a stringified hash, which is the "options" part of handling the thing. It seems like your IO::popen3
implementation should either handle those appropriately, or you should move the "RUBY_ENGINE" part down below the "if Hash === cmd.last" part to handle (by ignoring) the options passed. :)
Another option, perhaps better, might be to go down and implement popen_run
instead of popen3
, which is invoked by the rest of the methods to handle the actual I/O process.