childprocess
childprocess copied to clipboard
Use with StringIO
The basic example says
# ...or pass an IO
process.io.stdout = Tempfile.new("child-output")
This sounds like a StringIO
should work. But
irb(main):001:0> p = ChildProcess.build("ls")
=> #<ChildProcess::Unix::PosixSpawnProcess:0x000055e6766ab500 @args=["ls"], @started=false, @exit_code=nil, @io=nil, @cwd=nil, @detach=false, @dupl...
irb(main):002:0> p.io.stdout = StringIO.new
Traceback (most recent call last):
1: from (irb):2
ArgumentError (expected #<StringIO:0x000055e6799b3448> to respond to :to_io)