Class: TwitterCldr::Resources::RbnfTestImporter

Inherits:
Importer
  • Object
show all
Defined in:
lib/twitter_cldr/resources/rbnf_test_importer.rb

Overview

This class should be used with JRuby in 1.9 mode

Constant Summary collapse

TEST_NUMBERS =

These don’t have much of a pattern, just trying to get a wide range of different possibilities.

[
  [-1_141, -1_142, -1_143],
  [-100, -75, -50, -24],
  (0..100).to_a,
  [321, 322, 323, 1_141, 1_142, 1_143, 10_311, 138_400]
  # [41.0, 5.22, 8.90, 555.1212, -14.90, -999.701]  # decimals really aren't supported yet
].flatten

Constants inherited from Importer

Importer::DEFAULT_ENGINE

Instance Attribute Summary

Attributes inherited from Importer

#params, #requirements

Instance Method Summary collapse

Methods inherited from Importer

#can_import?, default_params, #import, #initialize, locales, output_path, parameter, parameters, #prepare, requirement, requirements, ruby_engine

Constructor Details

This class inherits a constructor from TwitterCldr::Resources::Importer

Instance Method Details

#executeObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/twitter_cldr/resources/rbnf_test_importer.rb', line 28

def execute
  locales.each do |locale|
    locale = locale.to_s
    ulocale = ulocale_class.new(locale)
    file = output_file_for(locale)
    FileUtils.mkdir_p(File.dirname(file))
    File.open(file, "w+") do |w|
      w.write(YAML.dump(import_locale(ulocale)))
    end
  end
end