Module: Xcode::PLUTILProjectParser

Extended by:
PLUTILProjectParser
Included in:
PLUTILProjectParser
Defined in:
lib/xcode/parsers/plutil_project_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse(path) ⇒ Object

Using the sytem tool plutil, the specified project file is parsed and converted to XML, and then converted into a ruby hash object.



13
14
15
16
# File 'lib/xcode/parsers/plutil_project_parser.rb', line 13

def parse path
  xml = `plutil -convert xml1 -o - "#{path}"`
  Plist::parse_xml(xml)
end

#save(path, data) ⇒ Object

Save the outputed string data to the specified project file path and then formats that data to be prettier than the default output.



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/xcode/parsers/plutil_project_parser.rb', line 22

def save path,data
  
   File.open(path,'w') do |file|
     file.puts data
   end

   #
   
   if File.exists?(path)
     `pl -input #{path} -output #{path}`
   end

end