9 lines
167 B
Ruby
9 lines
167 B
Ruby
module Silencer
|
|
def silenced
|
|
@stdout = $stdout
|
|
$stdout = File.new(File.join('tmp', 'stdout'), 'w')
|
|
yield if block_given?
|
|
$stdout = @stdout
|
|
end
|
|
end
|