module RuboCop::Rubycw::WarningCapturer

Public Class Methods

capture(source) click to toggle source
# File lib/rubocop/rubycw/warning_capturer.rb, line 22
def self.capture(source)
  start
  RubyVM::AbstractSyntaxTree.parse(source)
  warnings
ensure
  stop
end
start() click to toggle source
# File lib/rubocop/rubycw/warning_capturer.rb, line 30
def self.start
  @verbose = $VERBOSE
  $VERBOSE = true
  @warnings = []
end
stop() click to toggle source
# File lib/rubocop/rubycw/warning_capturer.rb, line 36
def self.stop
  $VERBOSE = @verbose if defined?(@verbose)
  @warnings = nil
end
warnings() click to toggle source
# File lib/rubocop/rubycw/warning_capturer.rb, line 41
def self.warnings
  @warnings
end