Class: IpaParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ipa_utilities/ipa_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ipa_path) ⇒ IpaParser

Returns a new instance of IpaParser.



11
12
13
14
# File 'lib/ipa_utilities/ipa_parser.rb', line 11

def initialize(ipa_path)
  @ipa_path = ipa_path
  unzip_and_parse
end

Instance Attribute Details

#info_plistObject (readonly)

Returns the value of attribute info_plist.



9
10
11
# File 'lib/ipa_utilities/ipa_parser.rb', line 9

def info_plist
  @info_plist
end

#ipa_pathObject (readonly)

Returns the value of attribute ipa_path.



9
10
11
# File 'lib/ipa_utilities/ipa_parser.rb', line 9

def ipa_path
  @ipa_path
end

#provision_profileObject (readonly)

Returns the value of attribute provision_profile.



9
10
11
# File 'lib/ipa_utilities/ipa_parser.rb', line 9

def provision_profile
  @provision_profile
end

Instance Method Details

#app_pathObject



20
21
22
# File 'lib/ipa_utilities/ipa_parser.rb', line 20

def app_path
  Dir["Payload/*.app"].last
end

#bundle_nameObject



16
17
18
# File 'lib/ipa_utilities/ipa_parser.rb', line 16

def bundle_name
  File.basename(app_path)
end

#cleanupObject



35
36
37
38
# File 'lib/ipa_utilities/ipa_parser.rb', line 35

def cleanup
  system "rm -rf #{zip_out_path}"
  say "Deleting directory #{zip_out_path}" if $verbose
end

#info_plist_pathObject



24
25
26
# File 'lib/ipa_utilities/ipa_parser.rb', line 24

def info_plist_path
  app_path + "/Info.plist"
end

#zip(path) ⇒ Object



28
29
30
31
32
33
# File 'lib/ipa_utilities/ipa_parser.rb', line 28

def zip(path)
  say "Zipping " + @ipa_path.green if $verbose
  system "zip -qr \"_new.ipa\" Payload"
  system "cp _new.ipa #{path}"
  say "Resigned ipa saved at " + path.green
end