Sha256: 672f70608772e541924793d45190d8cfb18fbf7efe36ac2cbb2bd78fb121a32c

Contents?: true

Size: 328 Bytes

Versions: 4

Compression:

Stored size: 328 Bytes

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0

# Executes the given block while suppressing all standard output.
def no_output
  $stdout = File.open( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null", "w" )
  yield if block_given?
  $stdout.close
  $stdout = STDOUT
end
    

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rtm-0.3.0 lib/rtm/helpers/no_output.rb
rtm-0.2.1 lib/rtm/helpers/no_output.rb
rtm-0.2.0 lib/rtm/helpers/no_output.rb
rtm-0.2 lib/rtm/helpers/no_output.rb