Class: Ucode::Cli::CodeChartCmd
- Inherits:
-
Thor
- Object
- Thor
- Ucode::Cli::CodeChartCmd
- Defined in:
- lib/ucode/cli.rb
Overview
─────────────── code-chart ─────────────── Extract per-codepoint SVG glyphs from a Unicode Code Charts PDF. One folder per block under --to, with <U+XXXX>.svg + .json pairs.
Instance Method Summary collapse
Instance Method Details
#extract(version = nil) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/ucode/cli.rb', line 161 def extract(version = nil) with_codechart_errors do version_str = VersionResolver.resolve(version) if [:missing_from] run_batch_extract(version: version_str, manifest_path: [:missing_from], to: [:to], verify: [:verify]) else raise Thor::Error, "--block is required when --missing-from is not set" unless [:block] run_single_block_extract(version: version_str, block_id: [:block], to: [:to], verify: [:verify]) end end end |
#fetch(version = nil) ⇒ Object
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/ucode/cli.rb', line 140 def fetch(version = nil) with_codechart_errors do block_first_cp = resolve_block_first_cp!([:block], version) result = Commands::FetchCommand.new.fetch_charts( VersionResolver.resolve(version), block_first_cps: [block_first_cp], ) puts JSON.pretty_generate(result) end end |
#list ⇒ Object
184 185 186 187 188 189 190 191 192 |
# File 'lib/ucode/cli.rb', line 184 def list with_codechart_errors do if [:coverage_gap_only] run_coverage_gap_list else run_simple_list end end end |