Module: TwitterCldr::Resources

Defined in:
lib/twitter_cldr/resources.rb,
lib/twitter_cldr/resources/loader.rb,
lib/twitter_cldr/resources/cldr_dtd.rb,
lib/twitter_cldr/resources/importer.rb,
lib/twitter_cldr/resources/properties.rb,
lib/twitter_cldr/resources/cldr_locale.rb,
lib/twitter_cldr/resources/requirements.rb,
lib/twitter_cldr/resources/units_importer.rb,
lib/twitter_cldr/resources/import_resolver.rb,
lib/twitter_cldr/resources/readme_renderer.rb,
lib/twitter_cldr/resources/aliases_importer.rb,
lib/twitter_cldr/resources/cldr_data_builder.rb,
lib/twitter_cldr/resources/cldr_document_set.rb,
lib/twitter_cldr/resources/bidi_test_importer.rb,
lib/twitter_cldr/resources/calendars_importer.rb,
lib/twitter_cldr/resources/rbnf_test_importer.rb,
lib/twitter_cldr/resources/tailoring_importer.rb,
lib/twitter_cldr/resources/timezones_importer.rb,
lib/twitter_cldr/resources/transforms_importer.rb,
lib/twitter_cldr/resources/unicode_file_parser.rb,
lib/twitter_cldr/resources/hyphenation_importer.rb,
lib/twitter_cldr/resources/regexp_ast_generator.rb,
lib/twitter_cldr/resources/territories_importer.rb,
lib/twitter_cldr/resources/list_formats_importer.rb,
lib/twitter_cldr/resources/postal_codes_importer.rb,
lib/twitter_cldr/resources/unicode_data_importer.rb,
lib/twitter_cldr/resources/segment_rules_importer.rb,
lib/twitter_cldr/resources/segment_tests_importer.rb,
lib/twitter_cldr/resources/validity_data_importer.rb,
lib/twitter_cldr/resources/language_codes_importer.rb,
lib/twitter_cldr/resources/number_formats_importer.rb,
lib/twitter_cldr/resources/parent_locales_importer.rb,
lib/twitter_cldr/resources/timezone_tests_importer.rb,
lib/twitter_cldr/resources/collation_tests_importer.rb,
lib/twitter_cldr/resources/collation_tries_importer.rb,
lib/twitter_cldr/resources/requirements/pom_manager.rb,
lib/twitter_cldr/resources/transform_tests_importer.rb,
lib/twitter_cldr/resources/currency_symbols_importer.rb,
lib/twitter_cldr/resources/day_period_rules_importer.rb,
lib/twitter_cldr/resources/properties/emoji_importer.rb,
lib/twitter_cldr/resources/timezone_regions_importer.rb,
lib/twitter_cldr/resources/casefolder_class_generator.rb,
lib/twitter_cldr/resources/locales_resources_importer.rb,
lib/twitter_cldr/resources/properties/property_importer.rb,
lib/twitter_cldr/resources/requirements/git_requirement.rb,
lib/twitter_cldr/resources/requirements/icu_requirement.rb,
lib/twitter_cldr/resources/requirements/uca_requirement.rb,
lib/twitter_cldr/resources/properties/prop_list_importer.rb,
lib/twitter_cldr/resources/requirements/cldr_requirement.rb,
lib/twitter_cldr/resources/segment_dictionaries_importer.rb,
lib/twitter_cldr/resources/requirements/emoji_requirement.rb,
lib/twitter_cldr/resources/bcp47_timezone_metadata_importer.rb,
lib/twitter_cldr/resources/properties/age_property_importer.rb,
lib/twitter_cldr/resources/requirements/unicode_requirement.rb,
lib/twitter_cldr/resources/properties/jamo_property_importer.rb,
lib/twitter_cldr/resources/unicode_property_aliases_importer.rb,
lib/twitter_cldr/resources/properties/blocks_property_importer.rb,
lib/twitter_cldr/resources/properties/script_property_importer.rb,
lib/twitter_cldr/resources/requirements/dependency_requirement.rb,
lib/twitter_cldr/resources/properties/line_break_property_importer.rb,
lib/twitter_cldr/resources/properties/word_break_property_importer.rb,
lib/twitter_cldr/resources/properties/bidi_brackets_property_importer.rb,
lib/twitter_cldr/resources/properties/arabic_shaping_property_importer.rb,
lib/twitter_cldr/resources/properties/derived_core_properties_importer.rb,
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb,
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb,
lib/twitter_cldr/resources/properties/unicode_data_properties_importer.rb,
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb,
lib/twitter_cldr/resources/properties/script_extensions_property_importer.rb,
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb,
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb,
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb

Defined Under Namespace

Modules: Properties, Requirements Classes: AliasesImporter, Bcp47TimezoneMetadataImporter, BidiTestImporter, CalendarsImporter, CasefolderClassGenerator, CldrDTD, CldrDataBuilder, CldrDocumentSet, CldrLocale, CollationTestsImporter, CollationTriesImporter, CurrencySymbolsImporter, DayPeriodRulesImporter, GregorianCalendar, HyphenationImporter, ImportResolver, Importer, LanguageCodesImporter, ListFormats, ListFormatsImporter, Loader, LocalesResourcesImporter, NumberFormats, NumberFormatsImporter, ParentLocalesImporter, PostalCodesImporter, RbnfTestImporter, ReadmeAssertionFailure, ReadmeRenderer, RegexpAstGenerator, ResourceLoadError, SegmentDictionariesImporter, SegmentRulesImporter, SegmentTestsImporter, TailoringImporter, TerritoriesImporter, TimezoneRegionsImporter, TimezoneTestsImporter, TimezonesImporter, TransformTestsImporter, TransformsImporter, UnicodeDataImporter, UnicodeFileParser, UnicodePropertyAliasesImporter, Units, UnitsImporter, ValidityDataImporter

Class Method Summary collapse

Class Method Details

.importer_classesObject



117
118
119
120
121
# File 'lib/twitter_cldr/resources.rb', line 117

def importer_classes
  @importer_classes ||=
    standard_importer_classes +
    property_importer_classes
end

.importer_classes_for_ruby_engineObject



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/twitter_cldr/resources.rb', line 123

def importer_classes_for_ruby_engine
  engine = case RUBY_ENGINE
    when 'ruby' then :mri
    when 'jruby' then :jruby
    else
      raise "Unsupported RUBY_ENGINE '#{RUBY_ENGINE}'"
  end

  importer_classes.select do |klass|
    klass.default_params[:ruby_engine] == engine
  end
end

.locale_based_importer_classes_for_ruby_engineObject



136
137
138
139
140
# File 'lib/twitter_cldr/resources.rb', line 136

def locale_based_importer_classes_for_ruby_engine
  importer_classes_for_ruby_engine.select do |klass|
    !!klass.default_params[:locales]
  end
end

.property_importer_classesObject



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/twitter_cldr/resources.rb', line 93

def property_importer_classes
  @property_importer_classes ||= [
    Properties::AgePropertyImporter,
    Properties::ArabicShapingPropertyImporter,
    Properties::BidiBracketsPropertyImporter,
    Properties::BlocksPropertyImporter,
    Properties::DerivedCorePropertiesImporter,
    Properties::EastAsianWidthPropertyImporter,
    Properties::EmojiImporter,
    Properties::GraphemeBreakPropertyImporter,
    Properties::HangulSyllableTypePropertyImporter,
    Properties::IndicPositionalCategoryPropertyImporter,
    Properties::IndicSyllabicCategoryPropertyImporter,
    Properties::JamoPropertyImporter,
    Properties::LineBreakPropertyImporter,
    Properties::PropListImporter,
    Properties::ScriptExtensionsPropertyImporter,
    Properties::ScriptPropertyImporter,
    Properties::SentenceBreakPropertyImporter,
    Properties::UnicodeDataPropertiesImporter,
    Properties::WordBreakPropertyImporter
  ]
end

.standard_importer_classesObject

these importer class methods aren’t constants in order to avoid loading all the classes when the library is required



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/twitter_cldr/resources.rb', line 57

def standard_importer_classes
  @standard_importer_classes ||= [
    AliasesImporter,
    Bcp47TimezoneMetadataImporter,
    BidiTestImporter,
    ValidityDataImporter,
    UnicodePropertyAliasesImporter,
    CalendarsImporter,
    CasefolderClassGenerator,
    CollationTestsImporter,
    CollationTriesImporter,
    CurrencySymbolsImporter,
    DayPeriodRulesImporter,
    HyphenationImporter,
    LanguageCodesImporter,
    ListFormatsImporter,
    LocalesResourcesImporter,
    NumberFormatsImporter,
    ParentLocalesImporter,
    PostalCodesImporter,
    RbnfTestImporter,
    SegmentDictionariesImporter,
    SegmentRulesImporter,
    SegmentTestsImporter,
    TailoringImporter,
    TerritoriesImporter,
    TimezonesImporter,
    TimezoneRegionsImporter,
    TimezoneTestsImporter,
    TransformTestsImporter,
    TransformsImporter,
    UnicodeDataImporter,
    UnitsImporter
  ]
end