fix
This commit is contained in:
@ -1,8 +1,11 @@
|
|||||||
module Silencer
|
module Silencer
|
||||||
def silenced
|
def silenced
|
||||||
@stdout = $stdout
|
@stdout = $stdout
|
||||||
$stdout = File.new(File.join('tmp', 'stdout'), 'w')
|
$stdout = Tempfile.new('stdout')
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
|
ensure
|
||||||
|
$stdout.close
|
||||||
|
$stdout.unlink
|
||||||
$stdout = @stdout
|
$stdout = @stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user