Class: TwitterCldr::Resources::Properties::PropertiesImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/resources/properties/properties_importer.rb

Constant Summary collapse

IMPORTERS =
[
  AgePropertyImporter,
  # ArabicShapingPropertyImporter,  # added in later version of unicode (we're not there yet)
  # BidiBracketsPropertyImporter,   # added in later version of unicode (we're not there yet)
  BlocksPropertyImporter,
  DerivedCorePropertiesImporter,
  EastAsianWidthPropertyImporter,
  GraphemeBreakPropertyImporter,
  HangulSyllableTypePropertyImporter,
  IndicPositionalCategoryPropertyImporter,
  IndicSyllabicCategoryPropertyImporter,
  JamoPropertyImporter,
  LineBreakPropertyImporter,
  PropListImporter,
  ScriptExtensionsPropertyImporter,
  ScriptPropertyImporter,
  SentenceBreakPropertyImporter,
  UnicodeDataPropertiesImporter,
  WordBreakPropertyImporter
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_path, output_path) ⇒ PropertiesImporter

Arguments:

input_path  - path to a directory containing the various property files
output_path - output directory for imported YAML directory structure


41
42
43
44
45
46
47
# File 'lib/twitter_cldr/resources/properties/properties_importer.rb', line 41

def initialize(input_path, output_path)
  @input_path  = input_path
  @output_path = output_path
  @database = TwitterCldr::Shared::PropertiesDatabase.new(
    output_path
  )
end

Instance Attribute Details

#databaseObject (readonly)

Returns the value of attribute database.



34
35
36
# File 'lib/twitter_cldr/resources/properties/properties_importer.rb', line 34

def database
  @database
end

#input_pathObject (readonly)

Returns the value of attribute input_path.



34
35
36
# File 'lib/twitter_cldr/resources/properties/properties_importer.rb', line 34

def input_path
  @input_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



34
35
36
# File 'lib/twitter_cldr/resources/properties/properties_importer.rb', line 34

def output_path
  @output_path
end

Instance Method Details

#importObject



49
50
51
52
53
# File 'lib/twitter_cldr/resources/properties/properties_importer.rb', line 49

def import
  IMPORTERS.each do |importer|
    importer.new(input_path, database).import
  end
end