Class: Ucode::Glyphs::UniversalSet::PreBuildCheck
- Inherits:
-
Object
- Object
- Ucode::Glyphs::UniversalSet::PreBuildCheck
- Defined in:
- lib/ucode/glyphs/universal_set/pre_build_check.rb
Overview
Pre-flight validation for a universal-set build. Runs the three checks TODO 31 specifies:
- Source config loads cleanly.
SourceConfig.new(path:)returns a map without raising, and the file exists. - All fonts present. Every source in the map resolves to a file on disk (kind=path) or via fontist's index (kind=fontist, install: false). Missing fonts are listed.
- Coverage assertion runs. TODO 29's CoverageAssertion walks every assigned codepoint; gaps are surfaced but do not abort (expected for residual curation cases).
The check raises UniversalSetPreBuildError when
missing_fonts is non-empty or the config fails to load. The
CLI catches this and renders the failing checks; the build
never starts with known-bad inputs.
Instance Method Summary collapse
- #call ⇒ PreBuildReport
-
#initialize(source_config_path:, database:, cmaps: nil, font_locator: RealFonts::FontLocator.new) ⇒ PreBuildCheck
constructor
A new instance of PreBuildCheck.
Constructor Details
#initialize(source_config_path:, database:, cmaps: nil, font_locator: RealFonts::FontLocator.new) ⇒ PreBuildCheck
Returns a new instance of PreBuildCheck.
51 52 53 54 55 56 57 |
# File 'lib/ucode/glyphs/universal_set/pre_build_check.rb', line 51 def initialize(source_config_path:, database:, cmaps: nil, font_locator: RealFonts::FontLocator.new) @source_config_path = Pathname.new(source_config_path) @database = database @cmaps = cmaps || RealFonts::CmapCache.new @font_locator = font_locator end |
Instance Method Details
#call ⇒ PreBuildReport
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ucode/glyphs/universal_set/pre_build_check.rb', line 62 def call report = build_report unless report.ok? raise Ucode::UniversalSetPreBuildError.new( "pre-build validation failed", context: { source_config_path: @source_config_path.to_s, missing_fonts: report.missing_fonts, config_loaded: report.config_loaded, }, ) end report end |