Class: Applyrics::GenStrings

Inherits:
Object
  • Object
show all
Defined in:
lib/applyrics/tools/genstrings.rb

Class Method Summary collapse

Class Method Details

.files(folder) ⇒ Object


21
22
23
# File 'lib/applyrics/tools/genstrings.rb', line 21

def files(folder)
  return Dir.glob(File.join(folder, "**", "*.{m,swift}"))
end

.run(folder, output_folder = nil) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/applyrics/tools/genstrings.rb', line 6

def run(folder, output_folder=nil)

  output_folder = folder if output_folder.nil?

  folder = File.expand_path(folder)
  output_folder = File.expand_path(output_folder)

  cmd = ["set -o pipefail &&"]
  cmd << Command.which("genstrings")
  cmd << "-o " + Shellwords.escape("#{output_folder}")
  cmd << Shellwords.join(files(folder))

  puts Command.execute(cmd)
end