Class: Ucode::Cli::UniversalSetCmd
- Inherits:
-
Thor
- Object
- Thor
- Ucode::Cli::UniversalSetCmd
- Defined in:
- lib/ucode/cli.rb
Overview
─────────────── universal-set ───────────────
Instance Method Summary collapse
- #build(version = nil) ⇒ Object
- #pre_check(version = nil) ⇒ Object
- #report(version = nil) ⇒ Object
- #validate(output_root = "./output/universal_glyph_set") ⇒ Object
Instance Method Details
#build(version = nil) ⇒ Object
549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/ucode/cli.rb', line 549 def build(version = nil) result = Commands::UniversalSet::BuildCommand.new.call( VersionResolver.resolve(version), output_root: [:to], source_config_path: [:source_config], block_filter: [:block], parallel_workers: [:parallel] || Ucode.configuration.parallel_workers, ) puts JSON.pretty_generate(result) rescue Ucode::UniversalSetPreBuildError => e warn "pre-build validation failed:" warn JSON.pretty_generate(e.context) exit 1 end |
#pre_check(version = nil) ⇒ Object
567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/ucode/cli.rb', line 567 def pre_check(version = nil) report = Commands::UniversalSet::PreCheckCommand.new.call( VersionResolver.resolve(version), source_config_path: [:source_config], ) puts JSON.pretty_generate(report.to_h) rescue Ucode::UniversalSetPreBuildError => e warn "pre-build validation failed:" warn JSON.pretty_generate(e.context) exit 1 end |
#report(version = nil) ⇒ Object
582 583 584 585 586 587 588 |
# File 'lib/ucode/cli.rb', line 582 def report(version = nil) result = Commands::UniversalSet::ReportCommand.new.call( VersionResolver.resolve(version), output_root: [:from], ) puts JSON.pretty_generate(result) end |
#validate(output_root = "./output/universal_glyph_set") ⇒ Object
593 594 595 596 597 598 599 600 |
# File 'lib/ucode/cli.rb', line 593 def validate(output_root = "./output/universal_glyph_set") result = Commands::UniversalSet::ValidateCommand.new.call( output_root, version: [:version] && VersionResolver.resolve([:version]), ) puts JSON.pretty_generate(result) exit 1 unless result[:passed] end |