Class: Quality::CommandOutputProcessor
- Inherits:
-
Object
- Object
- Quality::CommandOutputProcessor
- 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
-
#emacs_format ⇒ Object
Returns the value of attribute emacs_format.
-
#file ⇒ Object
Returns the value of attribute file.
-
#found_output ⇒ Object
readonly
Returns the value of attribute found_output.
-
#violations ⇒ Object
readonly
Returns the value of attribute violations.
Instance Method Summary collapse
-
#initialize ⇒ CommandOutputProcessor
constructor
A new instance of CommandOutputProcessor.
- #process(&count_violations_on_line) ⇒ Object
Constructor Details
#initialize ⇒ CommandOutputProcessor
Returns a new instance of CommandOutputProcessor.
11 12 13 14 15 |
# File 'lib/quality/command_output_processor.rb', line 11 def initialize @emacs_format = false @found_output = false @violations = 0 end |
Instance Attribute Details
#emacs_format ⇒ Object
Returns the value of attribute emacs_format.
6 7 8 |
# File 'lib/quality/command_output_processor.rb', line 6 def emacs_format @emacs_format end |
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/quality/command_output_processor.rb', line 7 def file @file end |
#found_output ⇒ Object (readonly)
Returns the value of attribute found_output.
8 9 10 |
# File 'lib/quality/command_output_processor.rb', line 8 def found_output @found_output end |
#violations ⇒ Object (readonly)
Returns the value of attribute violations.
9 10 11 |
# File 'lib/quality/command_output_processor.rb', line 9 def violations @violations end |
Instance Method Details
#process(&count_violations_on_line) ⇒ Object
17 18 19 |
# File 'lib/quality/command_output_processor.rb', line 17 def process(&count_violations_on_line) process_file(file, &count_violations_on_line) end |