childprocess icon indicating copy to clipboard operation
childprocess copied to clipboard

Use with StringIO

Open alexeyr-ci1 opened this issue 1 year ago • 0 comments

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)

alexeyr-ci1 avatar Sep 16 '22 10:09 alexeyr-ci1