Class: Ucode::Cli::Audit
- Inherits:
-
Thor
- Object
- Thor
- Ucode::Cli::Audit
- Defined in:
- lib/ucode/cli.rb
Overview
─────────────── audit ───────────────
Instance Method Summary collapse
- #browser ⇒ Object
- #collection(path) ⇒ Object
- #compare(left, right) ⇒ Object
- #font(path) ⇒ Object
- #library(dir) ⇒ Object
Instance Method Details
#browser ⇒ Object
482 483 484 485 486 487 488 489 |
# File 'lib/ucode/cli.rb', line 482 def browser result = Commands::Audit::BrowserCommand.new.call( input: [:input], faces_only: [:faces_only], library_only: [:library_only], ) puts JSON.pretty_generate(result_to_h(result)) end |
#collection(path) ⇒ Object
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/ucode/cli.rb', line 400 def collection(path) reference = Ucode::Audit::ReferenceFactory.build_from_cli( flag: [:reference_universal_set], version: [:unicode_version], ) result = Commands::Audit::CollectionCommand.new.call( path, font_index: [:font_index], label: [:label], unicode_version: [:unicode_version], verbose: [:verbose], with_glyphs: [:with_glyphs], brief: [:brief], output_root: [:output], browse: [:browse], reference: reference, universal_set_root: [:universal_set_root], with_missing_glyph_pages: [:with_missing_glyph_pages], ) puts JSON.pretty_generate(result_to_h(result)) end |
#compare(left, right) ⇒ Object
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/ucode/cli.rb', line 462 def compare(left, right) result = Commands::Audit::CompareCommand.new.call( left, right, unicode_version: [:unicode_version], output_file: [:output], ) if result.error warn "compare failed: #{result.error}" exit 1 elsif [:output].nil? puts result.text else puts "wrote #{[:output]}" end end |
#font(path) ⇒ Object
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/ucode/cli.rb', line 362 def font(path) reference = Ucode::Audit::ReferenceFactory.build_from_cli( flag: [:reference_universal_set], version: [:unicode_version], ) result = Commands::Audit::FontCommand.new.call( path, label: [:label], unicode_version: [:unicode_version], verbose: [:verbose], with_glyphs: [:with_glyphs], brief: [:brief], output_root: [:output], browse: [:browse], install: ![:no_install], reference: reference, universal_set_root: [:universal_set_root], with_missing_glyph_pages: [:with_missing_glyph_pages], ) puts JSON.pretty_generate(result_to_h(result)) end |
#library(dir) ⇒ Object
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/ucode/cli.rb', line 437 def library(dir) reference = Ucode::Audit::ReferenceFactory.build_from_cli( flag: [:reference_universal_set], version: [:unicode_version], ) result = Commands::Audit::LibraryCommand.new.call( dir, recursive: [:recursive], unicode_version: [:unicode_version], verbose: [:verbose], with_glyphs: [:with_glyphs], brief: [:brief], output_root: [:output], browse: [:browse], reference: reference, universal_set_root: [:universal_set_root], with_missing_glyph_pages: [:with_missing_glyph_pages], ) puts JSON.pretty_generate(result_to_h(result)) end |