Class: Henitai::Reporter::Base
- Inherits:
-
Object
- Object
- Henitai::Reporter::Base
- Defined in:
- lib/henitai/reporter.rb,
sig/henitai.rbs
Overview
Base class for all reporters.
Instance Attribute Summary collapse
-
#config ⇒ Configuration
readonly
Returns the value of attribute config.
-
#history_store ⇒ MutantHistoryStore?
readonly
Returns the value of attribute history_store.
Instance Method Summary collapse
-
#authoritative?(result) ⇒ Boolean
Authoritative (full) runs fully replace the canonical report; scoped/partial runs merge into it (CanonicalReportMerger) so findings for files outside this run's scope aren't lost.
-
#canonical_path ⇒ String
The merge source of truth is always the JSON canonical report, even for the HTML reporter, which embeds the same merged schema.
-
#initialize(config:, history_store: nil) ⇒ Base
constructor
A new instance of Base.
- #report(result) ⇒ void
Constructor Details
#initialize(config:, history_store: nil) ⇒ Base
Returns a new instance of Base.
46 47 48 49 |
# File 'lib/henitai/reporter.rb', line 46 def initialize(config:, history_store: nil) @config = config @history_store = history_store end |
Instance Attribute Details
#config ⇒ Configuration (readonly)
Returns the value of attribute config.
58 59 60 |
# File 'lib/henitai/reporter.rb', line 58 def config @config end |
#history_store ⇒ MutantHistoryStore? (readonly)
Returns the value of attribute history_store.
58 59 60 |
# File 'lib/henitai/reporter.rb', line 58 def history_store @history_store end |
Instance Method Details
#authoritative?(result) ⇒ Boolean
Authoritative (full) runs fully replace the canonical report; scoped/partial runs merge into it (CanonicalReportMerger) so findings for files outside this run's scope aren't lost.
63 64 65 66 67 |
# File 'lib/henitai/reporter.rb', line 63 def (result) return true unless result.respond_to?(:authoritative?) result. end |
#canonical_path ⇒ String
The merge source of truth is always the JSON canonical report, even for the HTML reporter, which embeds the same merged schema.
71 72 73 |
# File 'lib/henitai/reporter.rb', line 71 def canonical_path File.join(config.reports_dir, "mutation-report.json") end |
#report(result) ⇒ void
This method returns an undefined value.
52 53 54 |
# File 'lib/henitai/reporter.rb', line 52 def report(result) raise NotImplementedError, "#{self.class}#report must be implemented" end |