Top Level Namespace
Defined Under Namespace
Modules: RTM, XML Classes: Float, String
Instance Method Summary collapse
-
#no_output ⇒ Object
Executes the given block while suppressing all standard output.
Instance Method Details
#no_output ⇒ Object
Executes the given block while suppressing all standard output.
5 6 7 8 9 10 |
# File 'lib/rtm/helpers/no_output.rb', line 5 def no_output $stdout = File.open( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null", "w" ) yield if block_given? $stdout.close $stdout = STDOUT end |