Top Level Namespace

Defined Under Namespace

Modules: RTM, XML Classes: Float, String

Instance Method Summary collapse

Instance Method Details

#no_outputObject

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