Class: RuboCop::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/runner.rb

Overview

This class handles the processing of files, which includes dealing with formatters and letting cops inspect the files.

Defined Under Namespace

Classes: InfiniteCorrectionLoop

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, config_store) ⇒ Runner

Returns a new instance of Runner.



21
22
23
24
25
26
# File 'lib/rubocop/runner.rb', line 21

def initialize(options, config_store)
  @options = options
  @config_store = config_store
  @errors = []
  @aborting = false
end

Instance Attribute Details

#abortingObject (readonly) Also known as: aborting?

Returns the value of attribute aborting.



18
19
20
# File 'lib/rubocop/runner.rb', line 18

def aborting
  @aborting
end

#errorsObject (readonly)

Returns the value of attribute errors.



18
19
20
# File 'lib/rubocop/runner.rb', line 18

def errors
  @errors
end

Instance Method Details

#abortObject



37
38
39
# File 'lib/rubocop/runner.rb', line 37

def abort
  @aborting = true
end

#run(paths) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/rubocop/runner.rb', line 28

def run(paths)
  target_files = find_target_files(paths)
  if @options[:list_target_files]
    list_files(target_files)
  else
    inspect_files(target_files)
  end
end