Module: Debtective::StderrHelper

Included in:
Comments::Export
Defined in:
lib/debtective/stderr_helper.rb

Overview

Silence the $stderr

Instance Method Summary collapse

Instance Method Details

#suppress_stderrObject

Prevent logs in stderr

Returns:

  • void



8
9
10
11
12
13
14
# File 'lib/debtective/stderr_helper.rb', line 8

def suppress_stderr
  original_stderr = $stderr.clone
  $stderr.reopen(File.new("/dev/null", "w"))
  yield
ensure
  $stderr.reopen(original_stderr)
end