Class: LocGen

Inherits:
Object
  • Object
show all
Defined in:
lib/LocGen.rb

Constant Summary collapse

TEMPORARY_SHEET_FILE =
"temp_loc_sheet.xlsx"
OUTPUT_FILE_NAME =
"Localizable.strings"
LOCAL_INDEX_KEY =
"localIndex"
SHEET_INDEX_KEY =
"sheetIndex"
LANG_INDEX_KEY =
"lang"

Instance Method Summary collapse

Constructor Details

#initialize(url, outputDir, comment, key) ⇒ LocGen

Returns a new instance of LocGen.



13
14
15
16
17
18
# File 'lib/LocGen.rb', line 13

def initialize(url, outputDir, comment, key)
  @url = url
  @outputDir = outputDir
  @commentColumnName = comment || "comment"
  @keyColumnName = key || "key"
end

Instance Method Details

#processObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/LocGen.rb', line 20

def process()
  downloadFile(@url, TEMPORARY_SHEET_FILE)
  if File.exists?(TEMPORARY_SHEET_FILE)
    parseXLSX(TEMPORARY_SHEET_FILE)
    prepareIndices()
    readLocalizations()
    writeFiles(@outputDir, OUTPUT_FILE_NAME)
    deleteTempFile(TEMPORARY_SHEET_FILE)
  end
end