Method: Kennel::Utils.tee_output
- Defined in:
- lib/kennel/utils.rb
.tee_output ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/kennel/utils.rb', line 80 def tee_output old_stdout = Kennel.out old_stderr = Kennel.err capture = StringIO.new Kennel.out = TeeIO.new([capture, Kennel.out]) Kennel.err = TeeIO.new([capture, Kennel.err]) yield capture.string ensure Kennel.out = old_stdout Kennel.err = old_stderr end |