Sha256: ff8df232da94045a9439160868ff34d877038cc9baa45de72f13393dec930ced

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 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,
          BidiBracketsPropertyImporter,
          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

1 entries across 1 versions & 1 rubygems

Version Path
twitter_cldr-4.0.0 lib/twitter_cldr/resources/properties/properties_importer.rb