Class: Ucode::Commands::UniversalSet::BuildCommand
- Inherits:
-
Object
- Object
- Ucode::Commands::UniversalSet::BuildCommand
- Defined in:
- lib/ucode/commands/universal_set.rb
Overview
ucode universal-set build action class. Pure Ruby — Thor
(in lib/ucode/cli.rb) is responsible only for argument
parsing and dispatch.
Instance Method Summary collapse
-
#call(version, output_root:, source_config_path: nil, resolver: nil, block_filter: nil, parallel_workers: default_workers, skip_pre_check: false) ⇒ Hash
{ version:, manifest_path:, totals:, by_tier:, coverage:, validation: }.
Instance Method Details
#call(version, output_root:, source_config_path: nil, resolver: nil, block_filter: nil, parallel_workers: default_workers, skip_pre_check: false) ⇒ Hash
Returns { version:, manifest_path:, totals:, by_tier:, coverage:, validation: }.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/ucode/commands/universal_set.rb', line 61 def call(version, output_root:, source_config_path: nil, resolver: nil, block_filter: nil, parallel_workers: default_workers, skip_pre_check: false) root = Pathname.new(output_root) config_path = source_config_path_or_default(source_config_path) sha = source_config_sha256(config_path) database = Database.open(version) run_pre_check(config_path, database) unless skip_pre_check resolved_resolver = resolver || build_resolver(version, config_path, database) builder = Glyphs::UniversalSet::Builder.new( output_root: root, resolver: resolved_resolver, unicode_version: version, ucode_version: Ucode::VERSION, source_config_sha256: sha, parallel_workers: parallel_workers, block_filter: block_filter, ) manifest_path = builder.build(codepoint_enum(version)) manifest = Ucode::Models::UniversalSetManifest.from_hash( JSON.parse(manifest_path.read), ) coverage = Glyphs::UniversalSet::CoverageReport .new(root, database: database).emit(manifest) validation = Glyphs::UniversalSet::Validator .new(root, unicode_version: version).validate { version: version, manifest_path: manifest_path, totals: manifest.totals.to_hash, by_tier: manifest.by_tier, coverage: coverage, validation: validation, } end |