Class: CovLoupe::Presenters::ProjectCoveragePresenter
- Inherits:
-
Object
- Object
- CovLoupe::Presenters::ProjectCoveragePresenter
- Includes:
- PayloadCaching
- Defined in:
- lib/cov_loupe/presenters/project_coverage_presenter.rb
Overview
Presenter for project-wide coverage summaries (list/coverage table).
Wraps CoverageModel#list and enriches the output with:
- File counts (total, ok, stale) for quick overview
- Relativized paths for all file lists (skipped, missing, newer, deleted, etc.)
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#raise_on_stale ⇒ Object
readonly
Returns the value of attribute raise_on_stale.
-
#sort_order ⇒ Object
readonly
Returns the value of attribute sort_order.
-
#tracked_globs ⇒ Object
readonly
Returns the value of attribute tracked_globs.
Instance Method Summary collapse
-
#initialize(model:, sort_order:, raise_on_stale:, tracked_globs:) ⇒ ProjectCoveragePresenter
constructor
A new instance of ProjectCoveragePresenter.
-
#relative_counts ⇒ Object
Returns the coverage counts with relative file paths.
-
#relative_deleted_files ⇒ Object
Returns the relativized deleted files.
-
#relative_files ⇒ Object
Returns the relativized file rows.
-
#relative_length_mismatch_files ⇒ Object
Returns the relativized length-mismatch files.
-
#relative_missing_tracked_files ⇒ Object
Returns the relativized missing tracked files.
-
#relative_newer_files ⇒ Object
Returns the relativized newer files.
-
#relative_skipped_files ⇒ Object
Returns the relativized skipped files.
-
#relative_unreadable_files ⇒ Object
Returns the relativized unreadable files.
-
#timestamp_status ⇒ Object
Returns the timestamp status indicating whether coverage timestamps are available.
Methods included from PayloadCaching
#absolute_payload, #relativized_payload
Constructor Details
#initialize(model:, sort_order:, raise_on_stale:, tracked_globs:) ⇒ ProjectCoveragePresenter
Returns a new instance of ProjectCoveragePresenter.
19 20 21 22 23 24 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 19 def initialize(model:, sort_order:, raise_on_stale:, tracked_globs:) @model = model @sort_order = sort_order @raise_on_stale = raise_on_stale @tracked_globs = tracked_globs end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
17 18 19 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 17 def model @model end |
#raise_on_stale ⇒ Object (readonly)
Returns the value of attribute raise_on_stale.
17 18 19 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 17 def raise_on_stale @raise_on_stale end |
#sort_order ⇒ Object (readonly)
Returns the value of attribute sort_order.
17 18 19 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 17 def sort_order @sort_order end |
#tracked_globs ⇒ Object (readonly)
Returns the value of attribute tracked_globs.
17 18 19 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 17 def tracked_globs @tracked_globs end |
Instance Method Details
#relative_counts ⇒ Object
Returns the coverage counts with relative file paths.
32 33 34 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 32 def relative_counts relativized_payload['counts'] end |
#relative_deleted_files ⇒ Object
Returns the relativized deleted files.
52 53 54 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 52 def relative_deleted_files relativized_payload['deleted_files'] end |
#relative_files ⇒ Object
Returns the relativized file rows.
27 28 29 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 27 def relative_files relativized_payload['files'] end |
#relative_length_mismatch_files ⇒ Object
Returns the relativized length-mismatch files.
57 58 59 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 57 def relative_length_mismatch_files relativized_payload['length_mismatch_files'] end |
#relative_missing_tracked_files ⇒ Object
Returns the relativized missing tracked files.
42 43 44 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 42 def relative_missing_tracked_files relativized_payload['missing_tracked_files'] end |
#relative_newer_files ⇒ Object
Returns the relativized newer files.
47 48 49 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 47 def relative_newer_files relativized_payload['newer_files'] end |
#relative_skipped_files ⇒ Object
Returns the relativized skipped files.
37 38 39 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 37 def relative_skipped_files relativized_payload['skipped_files'] end |
#relative_unreadable_files ⇒ Object
Returns the relativized unreadable files.
62 63 64 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 62 def relative_unreadable_files relativized_payload['unreadable_files'] end |
#timestamp_status ⇒ Object
Returns the timestamp status indicating whether coverage timestamps are available. Can be 'ok' (timestamps available) or 'missing' (no timestamps, staleness checks skipped).
68 69 70 |
# File 'lib/cov_loupe/presenters/project_coverage_presenter.rb', line 68 def relativized_payload['timestamp_status'] end |