Parser::AST::Processor
Commissioner class is responsible for processing the AST and delegating work to the specified cops.
Methods that are not defined in Parser::AST::Processor won't have a `super` to call. So we should not attempt to invoke `super` when defining them.
# File lib/rubocop/cop/commissioner.rb, line 22 def self.call_super(callback) if METHODS_NOT_DEFINED_IN_PARSER_PROCESSOR.include?(callback) '' else 'super' end end
# File lib/rubocop/cop/commissioner.rb, line 52 def investigate(processed_source) reset_errors prepare(processed_source) invoke_custom_processing(@cops, processed_source) invoke_custom_processing(@forces, processed_source) process(processed_source.ast) if processed_source.ast @cops.each_with_object([]) do |cop, offenses| filename = processed_source.buffer.name # ignore files that are of no interest to the cop in question offenses.concat(cop.offenses) if cop.relevant_file?(filename) end end
Generated with the Darkfish Rdoc Generator 2.