Class: Gem::Guardian::ReportBuilder
- Inherits:
-
Object
- Object
- Gem::Guardian::ReportBuilder
- Defined in:
- lib/gem/guardian/report_builder.rb
Overview
Builds machine-readable verification reports.
Instance Method Summary collapse
-
#build(results, lockfile_data:, provenance_results: [], lockfile_path: nil) ⇒ Object
Returns a JSON-friendly hash for the current verification run.
-
#initialize(version:) ⇒ ReportBuilder
constructor
A new instance of ReportBuilder.
Constructor Details
#initialize(version:) ⇒ ReportBuilder
Returns a new instance of ReportBuilder.
8 9 10 |
# File 'lib/gem/guardian/report_builder.rb', line 8 def initialize(version:) @version = version end |
Instance Method Details
#build(results, lockfile_data:, provenance_results: [], lockfile_path: nil) ⇒ Object
Returns a JSON-friendly hash for the current verification run.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gem/guardian/report_builder.rb', line 13 def build(results, lockfile_data:, provenance_results: [], lockfile_path: nil) { version: @version, command: "verify", mode: lockfile_data ? "lockfile" : "explicit", lockfile: lockfile_path, checksums: checksum_summary(lockfile_data), results: results.map.with_index { |result, index| build_result(result, provenance_results[index]) } } end |