Module: Fontisan::Cldr::Config
- Defined in:
- lib/fontisan/cldr/config.rb
Overview
Single source of truth for CLDR version selection.
Wraps lib/fontisan/config/cldr.yml. Loads the YAML once at first
access and memoizes. All other Cldr::* classes resolve versions,
URLs, and known-version validation through this module.
Class Method Summary collapse
-
.archive_url_for(version) ⇒ String
Full URL to the CLDR JSON full archive for a version.
-
.base_url ⇒ Object
Base URL for fetching CLDR JSON artifacts.
-
.default_version ⇒ Object
The CLDR version Fontisan uses by default for auto-download and
fontisan cldr download(no args). -
.known?(version) ⇒ Boolean
True if the version appears in
known_versions. -
.known_versions ⇒ Object
Array of CLDR version strings this Fontisan release recognizes.
-
.listing_url ⇒ Object
Listing URL for
--latestprobing.
Class Method Details
.archive_url_for(version) ⇒ String
Full URL to the CLDR JSON full archive for a version.
42 43 44 |
# File 'lib/fontisan/cldr/config.rb', line 42 def archive_url_for(version) "#{base_url}/#{version}/cldr-#{version}-json-full.zip" end |
.base_url ⇒ Object
Base URL for fetching CLDR JSON artifacts.
30 31 32 |
# File 'lib/fontisan/cldr/config.rb', line 30 def base_url data[:base_url] end |
.default_version ⇒ Object
The CLDR version Fontisan uses by default for auto-download and
fontisan cldr download (no args). String like "46.0.0".
19 20 21 |
# File 'lib/fontisan/cldr/config.rb', line 19 def default_version data[:default_version] end |
.known?(version) ⇒ Boolean
True if the version appears in known_versions.
47 48 49 |
# File 'lib/fontisan/cldr/config.rb', line 47 def known?(version) known_versions.include?(version) end |
.known_versions ⇒ Object
Array of CLDR version strings this Fontisan release recognizes. Used by VersionResolver to reject unknown versions early.
25 26 27 |
# File 'lib/fontisan/cldr/config.rb', line 25 def known_versions data[:known_versions] end |
.listing_url ⇒ Object
Listing URL for --latest probing.
35 36 37 |
# File 'lib/fontisan/cldr/config.rb', line 35 def listing_url data[:listing_url] end |