Module: TwitterCldr::Resources

Defined in:
lib/twitter_cldr/resources.rb,
lib/twitter_cldr/resources/uli.rb,
lib/twitter_cldr/resources/loader.rb,
lib/twitter_cldr/resources/importer.rb,
lib/twitter_cldr/resources/properties.rb,
lib/twitter_cldr/resources/requirements.rb,
lib/twitter_cldr/resources/import_resolver.rb,
lib/twitter_cldr/resources/readme_renderer.rb,
lib/twitter_cldr/resources/bidi_test_importer.rb,
lib/twitter_cldr/resources/rbnf_test_importer.rb,
lib/twitter_cldr/resources/tailoring_importer.rb,
lib/twitter_cldr/resources/unicode_file_parser.rb,
lib/twitter_cldr/resources/hyphenation_importer.rb,
lib/twitter_cldr/resources/phone_codes_importer.rb,
lib/twitter_cldr/resources/regexp_ast_generator.rb,
lib/twitter_cldr/resources/postal_codes_importer.rb,
lib/twitter_cldr/resources/unicode_data_importer.rb,
lib/twitter_cldr/resources/segment_tests_importer.rb,
lib/twitter_cldr/resources/language_codes_importer.rb,
lib/twitter_cldr/resources/transform_test_importer.rb,
lib/twitter_cldr/resources/collation_tries_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/properties/prop_list_importer.rb,
lib/twitter_cldr/resources/requirements/cldr_requirement.rb,
lib/twitter_cldr/resources/uli/segment_exceptions_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, Uli Classes: BidiTestImporter, CasefolderClassGenerator, CollationTriesImporter, HyphenationImporter, ImportResolver, Importer, LanguageCodesImporter, Loader, LocalesResourcesImporter, PhoneCodesImporter, PostalCodesImporter, RbnfTestImporter, ReadmeAssertionFailure, ReadmeRenderer, RegexpAstGenerator, ResourceLoadError, SegmentTestsImporter, TailoringImporter, TransformTestImporter, UnicodeDataImporter, UnicodeFileParser, UnicodePropertyAliasesImporter

Class Method Summary collapse

Class Method Details

.importer_classesObject



86
87
88
89
90
91
# File 'lib/twitter_cldr/resources.rb', line 86

def importer_classes
  @importer_classes ||=
    standard_importer_classes +
    uli_importer_classes +
    property_importer_classes
end

.importer_classes_for_ruby_engineObject



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/twitter_cldr/resources.rb', line 93

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



106
107
108
109
110
# File 'lib/twitter_cldr/resources.rb', line 106

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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/twitter_cldr/resources.rb', line 63

def property_importer_classes
  @property_importer_classes ||= [
    Properties::AgePropertyImporter,
    Properties::ArabicShapingPropertyImporter,
    Properties::BidiBracketsPropertyImporter,
    Properties::BlocksPropertyImporter,
    Properties::DerivedCorePropertiesImporter,
    Properties::EastAsianWidthPropertyImporter,
    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



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/twitter_cldr/resources.rb', line 36

def standard_importer_classes
  @standard_importer_classes ||= [
    BidiTestImporter,
    CasefolderClassGenerator,
    CollationTriesImporter,
    HyphenationImporter,
    LanguageCodesImporter,
    LocalesResourcesImporter,
    PhoneCodesImporter,
    PostalCodesImporter,
    RbnfTestImporter,
    SegmentTestsImporter,
    TailoringImporter,
    TransformTestImporter,
    UnicodeDataImporter,
    UnicodePropertyAliasesImporter,
  ]
end

.uli_importer_classesObject



55
56
57
58
59
60
61
# File 'lib/twitter_cldr/resources.rb', line 55

def uli_importer_classes
  @uli_importer_classes ||= [
    # Disabled for now since ULI TRAC has been down for quite a while.
    # Word is data will eventually be available in a git repo.
    # Uli::SegmentExceptionsImporter
  ]
end