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

* lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.

Fixed by Josh Cheek.  [Fix GH-808]
  Related to [ruby-core:67347] [Bug #10699]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2015-01-07 15:29:28 +00:00
parent 48ad25568f
commit 1ade9cad02
3 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Thu Jan 8 00:13:52 2015 Tanaka Akira <akr@fsij.org>
* lib/open3.rb: Open3 properly passes non-keyword hash args to spawn.
Fixed by Josh Cheek. [Fix GH-808]
Related to [ruby-core:67347] [Bug #10699]
Wed Jan 7 19:19:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (dir_initialize): workaround of opendir failure at symlink

View file

@ -190,6 +190,7 @@ module Open3
module_function :popen2e
def popen_run(cmd, opts, child_io, parent_io) # :nodoc:
opts = opts.merge(cmd.pop) if cmd.last.kind_of? Hash
pid = spawn(*cmd, opts)
wait_thr = Process.detach(pid)
child_io.each {|io| io.close }

View file

@ -80,6 +80,14 @@ class TestOpen3 < Test::Unit::TestCase
end
end
def test_numeric_file_descriptors
with_pipe { |r, w|
Open3.popen3(RUBY, '-e', 'IO.open(3).puts "foo"', 3 => w) {|i,o,e,t|
assert_equal("foo\n", r.gets, "[GH-808] [ruby-core:67347] [Bug #10699]")
}
}
end
def with_pipe
r, w = IO.pipe
yield r, w