We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e38140 commit 98793d9Copy full SHA for 98793d9
stdlib/open3/0/open3.rbs
@@ -48,6 +48,8 @@
48
# Options](rdoc-ref:Process@Execution+Options).
49
#
50
module Open3
51
+ type env = Hash[String, String]
52
+
53
# <!--
54
# rdoc-file=lib/open3.rb
55
# - Open3.capture2([env, ] command_line, options = {}) -> [stdout_s, status]
@@ -144,6 +146,7 @@ module Open3
144
146
# # => ["hello world\n", #<Process::Status: pid 2326299 exit 0>]
145
147
148
def self?.capture2: (*String, ?stdin_data: String, ?binmode: boolish) -> [String, Process::Status]
149
+ | (env, *String, ?stdin_data: String, ?binmode: boolish) -> [String, Process::Status]
150
151
152
@@ -241,4 +244,5 @@ module Open3
241
244
# # => ["hello world\n", #<Process::Status: pid 2371894 exit 0>]
242
245
243
246
def self?.capture2e: (*String, ?stdin_data: String, ?binmode: boolish) -> [String, Process::Status]
247
248
end
test/stdlib/Open3_test.rb
@@ -13,6 +13,8 @@ def test_capture2
13
Open3, :capture2, 'echo "Foo"', binmode: true
14
assert_send_type "(*::String, stdin_data: ::String) -> [ ::String, ::Process::Status ]",
15
Open3, :capture2, "#{RUBY_EXECUTABLE} -e 'puts STDIN.read'", stdin_data: 'Foo'
16
+ assert_send_type "(::Hash[::String, ::String], *::String) -> [ ::String, ::Process::Status ]",
17
+ Open3, :capture2, { 'FOO' => 'BAR' }, "echo $FOO"
18
19
20
def test_capture2e
@@ -22,6 +24,8 @@ def test_capture2e
22
24
Open3, :capture2e, 'echo "Foo"', binmode: true
23
25
26
Open3, :capture2e, "#{RUBY_EXECUTABLE} -e 'puts STDIN.read'", stdin_data: 'Foo'
27
28
+ Open3, :capture2e, { 'FOO' => 'BAR' }, "echo $FOO"
29
30
31
0 commit comments