Module: RuboCop::Util

Included in:
Cop::Base
Defined in:
lib/rubocop/util.rb

Overview

This module contains a collection of useful utility methods.

Class Method Summary collapse

Class Method Details

.silence_warningsObject



6
7
8
9
10
11
12
13
14
# File 'lib/rubocop/util.rb', line 6

def self.silence_warnings
  # Replaces Kernel::silence_warnings since it hides any warnings,
  # including the RuboCop ones
  old_verbose = $VERBOSE
  $VERBOSE = nil
  yield
ensure
  $VERBOSE = old_verbose
end