Class: TwitterCldr::Resources::SegmentTestsImporter

Inherits:
UnicodeImporter show all
Defined in:
lib/twitter_cldr/resources/segment_tests_importer.rb

Constant Summary collapse

URL_ROOT =
"ucd/auxiliary"
TEST_FILES =
[
  'WordBreakTest.txt', 'SentenceBreakTest.txt'
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_path, output_path) ⇒ SegmentTestsImporter

Returns a new instance of SegmentTestsImporter.



20
21
22
23
# File 'lib/twitter_cldr/resources/segment_tests_importer.rb', line 20

def initialize(input_path, output_path)
  @input_path  = input_path
  @output_path = output_path
end

Instance Attribute Details

#input_pathObject (readonly)

Returns the value of attribute input_path.



18
19
20
# File 'lib/twitter_cldr/resources/segment_tests_importer.rb', line 18

def input_path
  @input_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



18
19
20
# File 'lib/twitter_cldr/resources/segment_tests_importer.rb', line 18

def output_path
  @output_path
end

Instance Method Details

#importObject



25
26
27
28
29
30
31
32
# File 'lib/twitter_cldr/resources/segment_tests_importer.rb', line 25

def import
  FileUtils.mkdir_p(input_path)
  FileUtils.mkdir_p(output_path)

  TEST_FILES.each do |test_file|
    import_test_file(test_file)
  end
end