Class: Terrestrial::Cli::Parser::BaseParser

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

Direct Known Subclasses

AndroidXML, ObjC

Class Method Summary collapse

Class Method Details

.find_api_calls(file) ⇒ Object

Interface for finding locations in files where the Terrestrial API will be accessing strings

file - path to source file

Expected to return an array of
Bootstrapper::NewStringEntry
objects


14
15
16
# File 'lib/terrestrial/cli/parser/base_parser.rb', line 14

def self.find_api_calls(file)
  raise "Not implemented"
end

.find_nslocalizedstrings(file) ⇒ Object



28
29
30
# File 'lib/terrestrial/cli/parser/base_parser.rb', line 28

def self.find_nslocalizedstrings(file)
  raise "Not implemented"
end

.find_string(file) ⇒ Object

Interface for finding strings in a source file

file - path to source file

Expected to return an array of
hashes TODO: make return an object


24
25
26
# File 'lib/terrestrial/cli/parser/base_parser.rb', line 24

def self.find_string(file)
  raise "Not implemented"
end

.scan_lines(path) ⇒ Object



34
35
36
37
38
# File 'lib/terrestrial/cli/parser/base_parser.rb', line 34

def self.scan_lines(path)
  File.readlines(file).each_with_index do |line, index|
    yield line, index
  end
end