Method: IpaReader::IpaFile#initialize
- Defined in:
- lib/ipa_reader/ipa_file.rb
#initialize(file_path) ⇒ IpaFile
Returns a new instance of IpaFile.
11 12 13 14 15 16 17 18 |
# File 'lib/ipa_reader/ipa_file.rb', line 11 def initialize(file_path) self.file_path = file_path info_plist_file = nil regex = /Payload\/[^\/]+.app\/Info.plist/ Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) } cf_plist = CFPropertyList::List.new(:data => self.read_file(regex), :format => CFPropertyList::List::FORMAT_BINARY) self.plist = cf_plist.value.to_rb end |