Method: Etch::Client#stop_output_capture

Defined in:
lib/etch/client.rb

#stop_output_captureObject



2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
# File 'lib/etch/client.rb', line 2482

def stop_output_capture
  oread, oldstdout, oldstderr = @output_pipes.pop
  # The reopen and close closes the parent's end of the pipe to the child
  STDOUT.reopen(oldstdout)
  STDERR.reopen(oldstderr)
  oldstdout.close
  oldstderr.close
  # Which triggers the child to send us the gathered output over the
  # second pipe
  output = oread.read
  oread.close
  # And then the child exits
  Process.wait
  output
end