Class: IosAnalytics::CLI

Inherits:
Thor
  • Object
show all
Includes:
Translate
Defined in:
lib/ios_analytics/cli.rb

Instance Method Summary collapse

Methods included from Translate

#create_element, #trans

Instance Method Details

#translateObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ios_analytics/cli.rb', line 12

def translate
  doc = REXML::Document.new
  doc << REXML::XMLDecl.new('1.0', 'UTF-8')

  checkstyle = doc.add_element('checkstyle')

  path = Pathname.new(options[:derivedData])
    .join(
      'Build',
      'Intermediates',
      "#{options[:appName]}.build",
      '**',
      'StaticAnalyzer',
      '**',
      '*.plist'
    )
  Dir.glob(path).each do |plist_file|
    trans(checkstyle, plist_file)
  end

  formatter = REXML::Formatters::Pretty.new(4)
  formatter.write(doc, STDOUT)
end