capistrano/sshkit — pull request #104 by etehtsea (2014-02-05 12:55:26+00:00)
Title: Add open3 JRuby bugs workaround

There are a couple bugs related to `Open3.capture3` and `Open3.popen3`.

```
>> SSHKit::Backend::Local.new.execute('uname -a')
INFO [341e3662] Running /usr/bin/env uname -a on
IOError: Cannot run program "uname -a" (in directory "/private/tmp/sshkit"): error=2, No such file or directory
from org/jruby/RubyIO.java:4375:in `popen3'
from /Users/kes/.rbenv/versions/jruby-1.7.10/lib/ruby/1.9/open3.rb:74:in `popen3'
from /Users/kes/.rbenv/versions/jruby-1.7.10/lib/ruby/1.9/open3.rb:272:in `capture3'
from /Users/kes/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/sshkit-1.3.0/lib/sshkit/backends/local.rb:41:in `_execute'
from org/jruby/RubyKernel.java:1891:in `tap'
from /Users/kes/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/sshkit-1.3.0/lib/sshkit/backends/local.rb:36:in `_execute'
from /Users/kes/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/sshkit-1.3.0/lib/sshkit/backends/local.rb:25:in `execute'
from (irb):3:in `evaluate'
from org/jruby/RubyKernel.java:1119:in `eval'
from org/jruby/RubyKernel.java:1519:in `loop'
from org/jruby/RubyKernel.java:1282:in `catch'
from org/jruby/RubyKernel.java:1282:in `catch'
from /Users/kes/.rbenv/versions/jruby-1.7.10/bin/irb:13:in `(root)'
```

https://github.com/jruby/jruby/issues/1187#issuecomment-31816243
The other one is that `Open3.popen3` returns empty output if output read inside `popen3` block.

So I added temporary hack that fixes (I hope) this problem.