Class: IPASend::IPA
- Inherits:
-
Object
- Object
- IPASend::IPA
- Defined in:
- lib/ipasend/ipa.rb
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#info_plist ⇒ Object
readonly
Returns the value of attribute info_plist.
-
#large_image ⇒ Object
readonly
Returns the value of attribute large_image.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#small_image ⇒ Object
readonly
Returns the value of attribute small_image.
Instance Method Summary collapse
- #bundle_identifier ⇒ Object
- #bundle_short_version ⇒ Object
- #bundle_version ⇒ Object
-
#initialize(options) ⇒ IPA
constructor
A new instance of IPA.
Constructor Details
#initialize(options) ⇒ IPA
Returns a new instance of IPA.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ipasend/ipa.rb', line 11 def initialize() @ipa_file = Tempfile.new(['APP', '.ipa']) @archive_path = .archive_path info_path = File.join(@archive_path, 'Info.plist') @info_plist = Plist::parse_xml(info_path) if @info_plist.nil? puts "!!! Invalid archive path #{@archive_path}" exit 1 end @props = @info_plist['ApplicationProperties'] @app_path = File.join(@archive_path, 'Products', @props['ApplicationPath']) @name = File.basename(@app_path, '.app') puts `/usr/bin/xcrun -sdk iphoneos PackageApplication "#{@app_path}" -o "#{@ipa_file.path}"` if $?.to_i != 0 puts "!! Error while calling xcrun" exit 1 end Dir.chdir @app_path icon_path = Dir['**/iTunesArtwork@2x'].first || Dir['**/Icon*@2x.png'].first image_path = .image_path || icon_path if image_path image_path = File.(image_path) image = Magick::Image.read(image_path).first @large_image = image.resize_to_fit(144) @small_image = image.resize_to_fit(72) end end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
8 9 10 |
# File 'lib/ipasend/ipa.rb', line 8 def app_path @app_path end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/ipasend/ipa.rb', line 8 def data @data end |
#info_plist ⇒ Object (readonly)
Returns the value of attribute info_plist.
8 9 10 |
# File 'lib/ipasend/ipa.rb', line 8 def info_plist @info_plist end |
#large_image ⇒ Object (readonly)
Returns the value of attribute large_image.
9 10 11 |
# File 'lib/ipasend/ipa.rb', line 9 def large_image @large_image end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/ipasend/ipa.rb', line 8 def name @name end |
#small_image ⇒ Object (readonly)
Returns the value of attribute small_image.
9 10 11 |
# File 'lib/ipasend/ipa.rb', line 9 def small_image @small_image end |
Instance Method Details
#bundle_identifier ⇒ Object
61 62 63 |
# File 'lib/ipasend/ipa.rb', line 61 def bundle_identifier @props['CFBundleIdentifier'] end |
#bundle_short_version ⇒ Object
53 54 55 |
# File 'lib/ipasend/ipa.rb', line 53 def bundle_short_version @props['CFBundleShortVersionString'] end |
#bundle_version ⇒ Object
57 58 59 |
# File 'lib/ipasend/ipa.rb', line 57 def bundle_version @props['CFBundleVersion'] end |