lib/rubocop/rubycw/warning_capturer.rb in rubocop-rubycw-0.1.5 vs lib/rubocop/rubycw/warning_capturer.rb in rubocop-rubycw-0.1.6

- old
+ new

@@ -3,14 +3,19 @@ module RuboCop module Rubycw module WarningCapturer if defined?(RubyVM::AbstractSyntaxTree) module ::Warning - def self.warn(*message) + def self.warn(*message, **kwargs) if WarningCapturer.warnings WarningCapturer.warnings.concat message else - super + if RUBY_VERSION >= '3' + # kwargs is available since Ruby 3 + super(*message, **kwargs) + else + super(*message) + end end end end def self.capture(source)