Class: Quality::CommandOutputProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/quality/command_output_processor.rb

Overview

Class processes output from a code quality command, tweaking it for editor output and counting the number of violations found

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandOutputProcessor

Returns a new instance of CommandOutputProcessor.



12
13
14
15
16
# File 'lib/quality/command_output_processor.rb', line 12

def initialize
  @emacs_format = false
  @found_output = false
  @violations = 0
end

Instance Attribute Details

#emacs_formatObject

Returns the value of attribute emacs_format.



7
8
9
# File 'lib/quality/command_output_processor.rb', line 7

def emacs_format
  @emacs_format
end

#fileObject

Returns the value of attribute file.



8
9
10
# File 'lib/quality/command_output_processor.rb', line 8

def file
  @file
end

#found_outputObject (readonly)

Returns the value of attribute found_output.



9
10
11
# File 'lib/quality/command_output_processor.rb', line 9

def found_output
  @found_output
end

#violationsObject (readonly)

Returns the value of attribute violations.



10
11
12
# File 'lib/quality/command_output_processor.rb', line 10

def violations
  @violations
end

Instance Method Details

#process(&count_violations_on_line) ⇒ Object



18
19
20
# File 'lib/quality/command_output_processor.rb', line 18

def process(&count_violations_on_line)
  process_file(file, &count_violations_on_line)
end