Top Level Namespace

Defined Under Namespace

Modules: Fast

Instance Method Summary collapse

Instance Method Details

#suppress_outputObject

suppress output to avoid parser gem warnings’



8
9
10
11
12
13
14
15
16
17
# File 'lib/fast.rb', line 8

def suppress_output
  original_stdout = $stdout.clone
  original_stderr = $stderr.clone
  $stderr.reopen File.new('/dev/null', 'w')
  $stdout.reopen File.new('/dev/null', 'w')
  yield
ensure
  $stdout.reopen original_stdout
  $stderr.reopen original_stderr
end