class Mutiny::Isolation::Vacuum
A mechanism for temporarily silencing a stream by redirecting the output to the OS’s null device (e.g., /dev/null)
Public Class Methods
silence(stream, &block)
click to toggle source
# File lib/mutiny/isolation/vacuum.rb, line 6 def self.silence(stream, &block) File.open(File::NULL, File::WRONLY) do |file| stream.reopen(file) block.call end end