Sha256: c170759d8710e279597f6378fbf31fde4e9da302be3cfc2b19068cbf9d1ac3f4

Contents?: true

Size: 1.68 KB

Versions: 4

Compression:

Stored size: 1.68 KB

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

module TwitterCldr
  module Resources
    module Properties

      class PropertiesImporter

        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
        ]

        attr_reader :input_path, :output_path, :database

        # Arguments:
        #
        #   input_path  - path to a directory containing the various property files
        #   output_path - output directory for imported YAML directory structure
        #
        def initialize(input_path, output_path)
          @input_path  = input_path
          @output_path = output_path
          @database = TwitterCldr::Shared::PropertiesDatabase.new(
            output_path
          )
        end

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

      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twitter_cldr-3.6.0 lib/twitter_cldr/resources/properties/properties_importer.rb
twitter_cldr-3.5.0 lib/twitter_cldr/resources/properties/properties_importer.rb
twitter_cldr-3.4.0 lib/twitter_cldr/resources/properties/properties_importer.rb
twitter_cldr-3.3.0 lib/twitter_cldr/resources/properties/properties_importer.rb