Method: Util#with_captured_console
- Defined in:
- lib/predicsis_ml_sdk/util.rb
#with_captured_console ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/predicsis_ml_sdk/util.rb', line 8 def with_captured_console old_stdout = $stdout old_stderr = $stderr $stdout = $stderr = StringIO.new('', 'w') yield $stdout.string ensure $stdout = old_stdout $stderr = old_stderr end |