Class: Terrestrial::Cli::DotStringsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/terrestrial/cli/dot_strings_parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ DotStringsParser

Returns a new instance of DotStringsParser.



13
14
15
# File 'lib/terrestrial/cli/dot_strings_parser.rb', line 13

def initialize(path)
  @path = path
end

Class Method Details

.parse_file(path) ⇒ Object



8
9
10
# File 'lib/terrestrial/cli/dot_strings_parser.rb', line 8

def parse_file(path)
  new(path).parse
end

Instance Method Details

#parseObject



17
18
19
20
21
22
23
# File 'lib/terrestrial/cli/dot_strings_parser.rb', line 17

def parse
  entries = do_parse_file read_file_with_correct_encoding(path)
  entries.each do |entry|
    entry["type"] = "localizable.strings"
    entry["file"] = path
  end
end