Class: Aigu::CoreImporter
- Inherits:
-
Object
- Object
- Aigu::CoreImporter
- Defined in:
- lib/aigu/core_importer.rb
Constant Summary collapse
- ENUM_LINE_REGEX =
/^\s*(?<key>\w+)\s?\("(?<value_en>.*)",\s?"(?<value_fr>.*)"\)(?<comma>[,;]?)\s$/
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CoreImporter
constructor
A new instance of CoreImporter.
- #process! ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ CoreImporter
Returns a new instance of CoreImporter.
5 6 7 8 9 |
# File 'lib/aigu/core_importer.rb', line 5 def initialize(opts = {}) @input_file = opts[:'input-file'] @output_directory = opts[:'output-directory'] @locale = opts[:locale] end |
Instance Method Details
#process! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/aigu/core_importer.rb', line 11 def process! puts "Updating Core Java Enum files in `#{@output_directory}` based on Accent-generated `#{@input_file}` file" puts '---' parse_json read_java @java_content = update_in_memory(@java_content, @object, @locale) write_java puts '---' puts 'Done' end |