Module: Reek::CLI::Silencer

Defined in:
lib/reek/cli/silencer.rb

Overview

CLI silencer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.silentlyObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/reek/cli/silencer.rb', line 12

def silently
  old_verbose = $VERBOSE
  old_stderr = $stderr
  old_stdout = $stdout

  $VERBOSE = false
  $stderr = StringIO.new
  $stdout = StringIO.new
  yield
ensure
  $VERBOSE = old_verbose
  $stderr = old_stderr
  $stdout = old_stdout
end

.without_warningsObject



27
28
29
30
31
32
33
# File 'lib/reek/cli/silencer.rb', line 27

def without_warnings
  old_verbose = $VERBOSE
  $VERBOSE = false
  yield
ensure
  $VERBOSE = old_verbose
end

Instance Method Details

#silentlyObject (private)



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/reek/cli/silencer.rb', line 12

def silently
  old_verbose = $VERBOSE
  old_stderr = $stderr
  old_stdout = $stdout

  $VERBOSE = false
  $stderr = StringIO.new
  $stdout = StringIO.new
  yield
ensure
  $VERBOSE = old_verbose
  $stderr = old_stderr
  $stdout = old_stdout
end

#without_warningsObject (private)



27
28
29
30
31
32
33
# File 'lib/reek/cli/silencer.rb', line 27

def without_warnings
  old_verbose = $VERBOSE
  $VERBOSE = false
  yield
ensure
  $VERBOSE = old_verbose
end