silent
silent is a Ruby gem to silently execute a piece of code, that is, without any visible output.
Install
gem install silent
Usage
require 'silent'
silent(:stdout) do
puts "this will never be displayed"
end
silent(:stderr) do
# do bad things without apparent warnings
ARGV = 42
end
silent(:stdout, :stderr) do
puts "Everything is silent here"
$stderr.write "is anyone listening to me?"
end
Tests
$ git clone https://github.com/bfontaine/silent.git
$ cd silent
$ bundle install
$ bundle exec rake test