Module: Warning

Defined in:
lib/rubocop/rubycw/warning_capturer.rb

Class Method Summary collapse

Class Method Details

.warn(*message, **kwargs) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rubocop/rubycw/warning_capturer.rb', line 8

def self.warn(*message, **kwargs)
  if WarningCapturer.warnings
    WarningCapturer.warnings.concat message
  else
    if RUBY_VERSION >= '3'
      # kwargs is available since Ruby 3
      super(*message, **kwargs)
    else
      super(*message)
    end
  end
end