Module: Fontisan::Ucd::Downloader

Defined in:
lib/fontisan/ucd/downloader.rb

Overview

Fetches UCDXML zips from unicode.org and unpacks them into the cache.

Single entry point: Downloader.download(version, force:). Idempotent unless force: true. Returns the path to the unpacked ucd.all.flat.xml.

Class Method Summary collapse

Class Method Details

.download(version, force: false) ⇒ Pathname

Download and unpack UCDXML for version.

Parameters:

  • version (String)

    e.g. "17.0.0"

  • force (Boolean) (defaults to: false)

    if false and cache already has the file, return the existing path without re-fetching.

Returns:

  • (Pathname)

    path to the unpacked ucd.all.flat.xml

Raises:



27
28
29
30
31
32
33
34
35
# File 'lib/fontisan/ucd/downloader.rb', line 27

def download(version, force: false)
  target = CacheManager.ucdxml_path(version)
  return target if target.exist? && !force

  CacheManager.ensure_version_dir!(version)
  zip_data = fetch_zip(version)
  extract_xml(zip_data, target)
  target
end