Class: Ucode::Glyphs::UniversalSet::ManifestWriter
- Inherits:
-
Object
- Object
- Ucode::Glyphs::UniversalSet::ManifestWriter
- Includes:
- Idempotency
- Defined in:
- lib/ucode/glyphs/universal_set/manifest_writer.rb
Overview
Writes the final manifest + reports under the output root.
One manifest, three reports:
manifest.json— full Models::UniversalSetManifest.reports/by_tier.json—by_tiercounts alone (small file for quick "how much of the set is tier 1?" inspection).reports/by_block.json— per-block built/skipped totals, computed from the manifest's entries + the codepoint's block_id (resolved by the Builder).reports/gaps.json— array of codepoint integers that resolved to nil (should be empty for a healthy run).
All writes are atomic via Idempotency (which includes
Repo::AtomicWrites). Re-running on an unchanged
manifest is a no-op modulo generated_at.
Instance Method Summary collapse
-
#initialize(output_root) ⇒ ManifestWriter
constructor
A new instance of ManifestWriter.
-
#write(manifest, by_block:, gaps:, failures:) ⇒ Pathname
Write the manifest + reports atomically.
Methods included from Idempotency
#by_block_report_path, #by_tier_report_path, #gaps_report_path, #glyph_path, #manifest_path, #write_glyph
Methods included from Repo::AtomicWrites
#same_content?, #to_pretty_json, #write_atomic
Constructor Details
#initialize(output_root) ⇒ ManifestWriter
Returns a new instance of ManifestWriter.
31 32 33 |
# File 'lib/ucode/glyphs/universal_set/manifest_writer.rb', line 31 def initialize(output_root) @output_root = Pathname.new(output_root) end |
Instance Method Details
#write(manifest, by_block:, gaps:, failures:) ⇒ Pathname
Write the manifest + reports atomically.
44 45 46 47 48 49 50 51 |
# File 'lib/ucode/glyphs/universal_set/manifest_writer.rb', line 44 def write(manifest, by_block:, gaps:, failures:) write_atomic(manifest_path(@output_root), manifest_to_json(manifest)) write_atomic(by_tier_report_path(@output_root), to_pretty_json(manifest.by_tier)) write_atomic(by_block_report_path(@output_root), to_pretty_json(by_block)) write_atomic(gaps_report_path(@output_root), to_pretty_json(gaps: gaps, failures: failures)) manifest_path(@output_root) end |