Skip to content

Instantly share code, notes, and snippets.

@adamstegman
Created March 30, 2011 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamstegman/895032 to your computer and use it in GitHub Desktop.
Save adamstegman/895032 to your computer and use it in GitHub Desktop.
def silence
orig_stdout = $stdout
$stdout = File.new('/dev/null', 'w')
yield
ensure
$stdout = orig_stdout
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment