Module: Kernel
- Defined in:
- lib/ext/ext.rb
Instance Method Summary collapse
Instance Method Details
#silence_stream(stream) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/ext/ext.rb', line 49 def silence_stream(stream) old_stream = stream.dup stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') stream.sync = true yield ensure stream.reopen(old_stream) end |