Module: Fontisan::Cldr::Downloader
- Defined in:
- lib/fontisan/cldr/downloader.rb
Overview
Fetches CLDR JSON archives from unicode-org/cldr-json GitHub releases and unpacks them into the cache.
Single entry point: Downloader.download(version, force:).
Idempotent unless force: true. Returns the path to the extracted
main/ characters directory.
Class Method Summary collapse
-
.download(version, force: false) ⇒ Pathname
Download and unpack CLDR JSON for
version.
Class Method Details
.download(version, force: false) ⇒ Pathname
Download and unpack CLDR JSON for version.
25 26 27 28 29 30 31 32 33 |
# File 'lib/fontisan/cldr/downloader.rb', line 25 def download(version, force: false) target = CacheManager.characters_main_dir(version) return target if target.exist? && !force CacheManager.ensure_version_dir!(version) zip_data = fetch_zip(version) extract_archive(zip_data, CacheManager.json_dir(version)) target end |