Class: Ibex::VerifiableGenerationBundle
- Inherits:
-
Object
- Object
- Ibex::VerifiableGenerationBundle
- Defined in:
- lib/ibex/verifiable_generation_bundle.rb
Overview
Explicitly renders and publishes one manifest-bound verification bundle.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(automaton, wrapper_path:, wrapper_source:, table_path:, report_path:, manifest_path:, source_records:, manifest_options: {}, wrapper_mode: nil, representation: :compact, cst_trivia: nil, omit_action_call: nil, strict: false, max_states: VerificationReport::DEFAULT_MAX_STATES, max_items: VerificationReport::DEFAULT_MAX_ITEMS) ⇒ VerifiableGenerationBundle
constructor
rubocop:disable Metrics/ParameterLists -- persisted artifact paths and verification bounds are explicit inputs.
- #publish(warning: ->(_message) {}, stability_check: -> { @source_records.all?(&:current?) }) ⇒ Object
-
#render ⇒ Object
Render table, wrapper, and report before the non-cyclic manifest marker.
Constructor Details
#initialize(automaton, wrapper_path:, wrapper_source:, table_path:, report_path:, manifest_path:, source_records:, manifest_options: {}, wrapper_mode: nil, representation: :compact, cst_trivia: nil, omit_action_call: nil, strict: false, max_states: VerificationReport::DEFAULT_MAX_STATES, max_items: VerificationReport::DEFAULT_MAX_ITEMS) ⇒ VerifiableGenerationBundle
rubocop:disable Metrics/ParameterLists -- persisted artifact paths and verification bounds are explicit inputs.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ibex/verifiable_generation_bundle.rb', line 19 def initialize(automaton, wrapper_path:, wrapper_source:, table_path:, report_path:, manifest_path:, source_records:, manifest_options: {}, wrapper_mode: nil, representation: :compact, cst_trivia: nil, omit_action_call: nil, strict: false, max_states: VerificationReport::DEFAULT_MAX_STATES, max_items: VerificationReport::DEFAULT_MAX_ITEMS) @automaton = automaton @wrapper_path = wrapper_path @wrapper_source = wrapper_source @table_path = table_path VerificationReport::LogicalPath.table(table_path) if source_records.length > VerificationReport::LogicalPath::MAX_INPUT_FILES raise ArgumentError, "verification reports support at most #{VerificationReport::LogicalPath::MAX_INPUT_FILES} input files" end @report_path = report_path @manifest_path = manifest_path @source_records = source_records @manifest_options = @wrapper_mode = wrapper_mode @representation = representation @cst_trivia = cst_trivia @omit_action_call = omit_action_call @strict = strict @max_states = max_states @max_items = max_items end |
Class Method Details
.validate_file(manifest_path) ⇒ Object
82 83 84 |
# File 'lib/ibex/verifiable_generation_bundle.rb', line 82 def self.validate_file(manifest_path) VerificationReport.validate_bundle_file(manifest_path) end |
Instance Method Details
#publish(warning: ->(_message) {}, stability_check: -> { @source_records.all?(&:current?) }) ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/ibex/verifiable_generation_bundle.rb', line 73 def publish(warning: ->() {}, stability_check: -> { @source_records.all?(&:current?) }) artifacts = render GenerationTransaction.new( artifacts, warning: warning, stability_check: stability_check, source_records: @source_records ).commit artifacts end |
#render ⇒ Object
Render table, wrapper, and report before the non-cyclic manifest marker.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ibex/verifiable_generation_bundle.rb', line 49 def render canonical_automaton = VerificationReport.canonical_automaton( @automaton, source_records: @source_records ) table = TableArtifact.build( canonical_automaton, representation: @representation, cst_trivia: @cst_trivia, omit_action_call: @omit_action_call ) artifacts = ArtifactSet.new artifacts.add(kind: :parser_table, path: @table_path, content: table.dump) artifacts.add(kind: :parser, path: @wrapper_path, content: @wrapper_source, mode: @wrapper_mode) report = VerificationReport.render( canonical_automaton, table: table, source_records: @source_records, table_path: @table_path, strict: @strict, max_states: @max_states, max_items: @max_items ) artifacts.add(kind: :verification_report, path: @report_path, content: report) manifest = GenerationManifest.render( artifacts, source_records: @source_records, options: @manifest_options ) artifacts.add(kind: :manifest, path: @manifest_path, content: manifest) artifacts end |