Class: Woz::Builder

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

Constant Summary collapse

KEY_COLUMN =
"keys"

Class Method Summary collapse

Class Method Details

.generate_csvObject



26
27
28
# File 'lib/woz/builder.rb', line 26

def generate_csv
  generate_translation_csv
end

.generate_strings(csv = false, filepath = nil) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/woz/builder.rb', line 34

def generate_strings(csv=false, filepath=nil)
  if csv
    generate_translation_strings_from_csv(filepath)
  else
    generate_translation_strings_from_xls(filepath)
  end
end

.generate_xlsObject



30
31
32
# File 'lib/woz/builder.rb', line 30

def generate_xls
  generate_translation_xls
end

.initObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/woz/builder.rb', line 12

def init
  file = File.join(Dir.pwd, config_file_name)

  if File.exists?(file)
    warn "# '#{file}' already exists"
  elsif File.exists?(file.downcase)
    warn "# '#{file.downcase}' exists, which could conflict with `#{file}'"
  else
    puts "# writing '#{file}'"
    File.open(file, "w") { |f| f.write(instructions_text) }
  end
  puts "# woz initialized!"
end