-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
Many methods in the Open3 module allow us to optionally pass a Hash
as the first positional argument (the hash is used to set the environment for the spawned process) e.g.
stdin, stdout, stderr, wait_thr = Open3.popen3([env,] cmd... [, opts])
The type signatures for these methods currently forbid this e.g.
sorbet-typed/lib/ruby/all/open3.rbi
Lines 3 to 11 in 22dd994
module Open3 | |
sig do | |
params( | |
cmd: T.any(String, T::Array[String]), | |
opts: T::Hash[Symbol, T.untyped], | |
block: T.proc.params(stdin: IO, stdout: IO, stderr: IO, wait_thr: Thread).void | |
).returns([IO, IO, IO, Thread]) | |
end | |
def self.popen3(*cmd, **opts, &block); end |
I can "fix" this by changing the type of the cmd
from T.any(String, T::Array[String])
to cmd: T.any(String, T::Array[String], T::Hash[String, String])
but that seems wrong to me. Is there a better way to express these method signatures?
I'm happy to attempt a PR for this.
benoittgt
Metadata
Metadata
Assignees
Labels
No labels