Class: Herb::Project::ResultTracker
- Inherits:
-
Object
- Object
- Herb::Project::ResultTracker
- Defined in:
- lib/herb/project.rb
Instance Attribute Summary collapse
-
#analyze_parse_error ⇒ Object
readonly
Returns the value of attribute analyze_parse_error.
-
#compilation_errors ⇒ Object
readonly
Returns the value of attribute compilation_errors.
-
#compilation_failed ⇒ Object
readonly
Returns the value of attribute compilation_failed.
-
#error_outputs ⇒ Object
readonly
Returns the value of attribute error_outputs.
-
#failed ⇒ Object
readonly
Returns the value of attribute failed.
-
#file_contents ⇒ Object
readonly
Returns the value of attribute file_contents.
-
#file_diagnostics ⇒ Object
readonly
Returns the value of attribute file_diagnostics.
-
#invalid_ruby ⇒ Object
readonly
Returns the value of attribute invalid_ruby.
-
#parse_errors ⇒ Object
readonly
Returns the value of attribute parse_errors.
-
#skip_reasons ⇒ Object
readonly
Returns the value of attribute skip_reasons.
-
#skipped ⇒ Object
readonly
Returns the value of attribute skipped.
-
#strict_compilation_failed ⇒ Object
readonly
Returns the value of attribute strict_compilation_failed.
-
#strict_parse_error ⇒ Object
readonly
Returns the value of attribute strict_parse_error.
-
#successful ⇒ Object
readonly
Returns the value of attribute successful.
-
#template_error ⇒ Object
readonly
Returns the value of attribute template_error.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#unexpected_error ⇒ Object
readonly
Returns the value of attribute unexpected_error.
-
#validation_error ⇒ Object
readonly
Returns the value of attribute validation_error.
Instance Method Summary collapse
- #diagnostic_counts ⇒ Object
- #file_issue_type(file) ⇒ Object
-
#initialize ⇒ ResultTracker
constructor
A new instance of ResultTracker.
- #problem_files ⇒ Object
Constructor Details
#initialize ⇒ ResultTracker
Returns a new instance of ResultTracker.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/herb/project.rb', line 78 def initialize @successful = [] @failed = [] @timeout = [] @template_error = [] @unexpected_error = [] @strict_parse_error = [] @analyze_parse_error = [] @validation_error = [] @compilation_failed = [] @strict_compilation_failed = [] @invalid_ruby = [] @skipped = [] @error_outputs = {} @file_contents = {} @parse_errors = {} @compilation_errors = {} @file_diagnostics = {} @skip_reasons = {} end |
Instance Attribute Details
#analyze_parse_error ⇒ Object (readonly)
Returns the value of attribute analyze_parse_error.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def analyze_parse_error @analyze_parse_error end |
#compilation_errors ⇒ Object (readonly)
Returns the value of attribute compilation_errors.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def compilation_errors @compilation_errors end |
#compilation_failed ⇒ Object (readonly)
Returns the value of attribute compilation_failed.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def compilation_failed @compilation_failed end |
#error_outputs ⇒ Object (readonly)
Returns the value of attribute error_outputs.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def error_outputs @error_outputs end |
#failed ⇒ Object (readonly)
Returns the value of attribute failed.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def failed @failed end |
#file_contents ⇒ Object (readonly)
Returns the value of attribute file_contents.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def file_contents @file_contents end |
#file_diagnostics ⇒ Object (readonly)
Returns the value of attribute file_diagnostics.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def file_diagnostics @file_diagnostics end |
#invalid_ruby ⇒ Object (readonly)
Returns the value of attribute invalid_ruby.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def invalid_ruby @invalid_ruby end |
#parse_errors ⇒ Object (readonly)
Returns the value of attribute parse_errors.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def parse_errors @parse_errors end |
#skip_reasons ⇒ Object (readonly)
Returns the value of attribute skip_reasons.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def skip_reasons @skip_reasons end |
#skipped ⇒ Object (readonly)
Returns the value of attribute skipped.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def skipped @skipped end |
#strict_compilation_failed ⇒ Object (readonly)
Returns the value of attribute strict_compilation_failed.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def strict_compilation_failed @strict_compilation_failed end |
#strict_parse_error ⇒ Object (readonly)
Returns the value of attribute strict_parse_error.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def strict_parse_error @strict_parse_error end |
#successful ⇒ Object (readonly)
Returns the value of attribute successful.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def successful @successful end |
#template_error ⇒ Object (readonly)
Returns the value of attribute template_error.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def template_error @template_error end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def timeout @timeout end |
#unexpected_error ⇒ Object (readonly)
Returns the value of attribute unexpected_error.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def unexpected_error @unexpected_error end |
#validation_error ⇒ Object (readonly)
Returns the value of attribute validation_error.
71 72 73 |
# File 'lib/herb/project.rb', line 71 def validation_error @validation_error end |
Instance Method Details
#diagnostic_counts ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/herb/project.rb', line 108 def diagnostic_counts counts = Hash.new { |hash, key| hash[key] = { count: 0, files: Set.new } } file_diagnostics.each do |file, diagnostics| diagnostics.each do |diagnostic| counts[diagnostic[:name]][:count] += 1 counts[diagnostic[:name]][:files] << file end end counts.sort_by { |_name, value| -value[:count] } end |
#file_issue_type(file) ⇒ Object
104 105 106 |
# File 'lib/herb/project.rb', line 104 def file_issue_type(file) ISSUE_TYPES.find { |type| send(type[:key]).include?(file) } end |
#problem_files ⇒ Object
99 100 101 102 |
# File 'lib/herb/project.rb', line 99 def problem_files failed + timeout + template_error + unexpected_error + strict_parse_error + analyze_parse_error + validation_error + compilation_failed + strict_compilation_failed + invalid_ruby end |