Class: Ucode::Commands::FetchCommand
- Inherits:
-
Object
- Object
- Ucode::Commands::FetchCommand
- Defined in:
- lib/ucode/commands/fetch.rb
Overview
ucode fetch — downloads UCD/Unihan/Code-Charts sources into the
per-version cache, plus the specialist Tier 1 fonts referenced by
the curated source config.
Thin shell over Ucode::Fetch::*. The command takes a resolved
version string; CLI callers resolve via VersionResolver.resolve
once and thread it through. See Candidate 4 of the 2026-06-29
architecture review.
Instance Method Summary collapse
-
#fetch_charts(version, block_first_cps: nil, force: false) ⇒ Hash
{ version:, downloaded: }.
-
#fetch_fonts(manifest_path: nil, only_label: nil, allow_proprietary: false, dry_run: false) ⇒ Hash
Fetch specialist Tier 1 fonts listed in the manifest.
-
#fetch_ucd(version, force: false) ⇒ Hash
{ version:, ucd_dir: }.
-
#fetch_unihan(version, force: false) ⇒ Hash
{ version:, unihan_dir: }.
Instance Method Details
#fetch_charts(version, block_first_cps: nil, force: false) ⇒ Hash
Returns { version:, downloaded: }.
47 48 49 50 51 52 53 |
# File 'lib/ucode/commands/fetch.rb', line 47 def fetch_charts(version, block_first_cps: nil, force: false) Cache.ensure_version_dir!(version) cps = block_first_cps || default_block_first_cps(version) count = Fetch::CodeCharts.call(version, block_first_cps: cps, force: force) { version: version, downloaded: count } end |
#fetch_fonts(manifest_path: nil, only_label: nil, allow_proprietary: false, dry_run: false) ⇒ Hash
Fetch specialist Tier 1 fonts listed in the manifest. Returns a structured summary; per-font detail lives on the returned results array (one Fetch::FontFetcher::Result per entry).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ucode/commands/fetch.rb', line 66 def fetch_fonts(manifest_path: nil, only_label: nil, allow_proprietary: false, dry_run: false) path = Pathname.new(manifest_path || DEFAULT_SPECIALIST_FONTS_MANIFEST) results = Fetch::SpecialistFontFetcher.new( manifest_path: path, allow_proprietary: allow_proprietary, dry_run: dry_run, ).call(only_label: only_label) { manifest: path.to_s, total: results.size, downloaded: results.count(&:downloaded?), skipped: results.count(&:skipped?), failed: results.count(&:failed?), local: results.count(&:local?), planned: results.count(&:planned?), results: results } end |
#fetch_ucd(version, force: false) ⇒ Hash
Returns { version:, ucd_dir: }.
28 29 30 31 32 |
# File 'lib/ucode/commands/fetch.rb', line 28 def fetch_ucd(version, force: false) Cache.ensure_version_dir!(version) path = Fetch::UcdZip.call(version, force: force) { version: version, ucd_dir: path } end |
#fetch_unihan(version, force: false) ⇒ Hash
Returns { version:, unihan_dir: }.
37 38 39 40 41 |
# File 'lib/ucode/commands/fetch.rb', line 37 def fetch_unihan(version, force: false) Cache.ensure_version_dir!(version) path = Fetch::UnihanZip.call(version, force: force) { version: version, unihan_dir: path } end |