Class: Lagunitas::App
- Inherits:
-
Object
- Object
- Lagunitas::App
- Defined in:
- lib/lagunitas.ext.rb,
lib/lagunitas.patch.rb
Instance Method Summary collapse
- #devices ⇒ Object
- #distribution_name ⇒ Object
- #icons ⇒ Object
-
#initialize(path, root) ⇒ App
constructor
A new instance of App.
- #metadata ⇒ Object
- #metadata? ⇒ Boolean
- #mobileprovision ⇒ Object
- #mobileprovision? ⇒ Boolean
- #name ⇒ Object
- #release_type ⇒ Object
Constructor Details
#initialize(path, root) ⇒ App
Returns a new instance of App.
5 6 7 8 |
# File 'lib/lagunitas.ext.rb', line 5 def initialize(path, root) @path = path @root = root end |
Instance Method Details
#devices ⇒ Object
20 21 22 |
# File 'lib/lagunitas.ext.rb', line 20 def devices mobileprovision['ProvisionedDevices'] if mobileprovision end |
#distribution_name ⇒ Object
23 24 25 26 |
# File 'lib/lagunitas.ext.rb', line 23 def distribution_name # mobileprovision['DeveloperCertificates'] if mobileprovision "#{ mobileprovision['Name'] }: #{ mobileprovision['TeamName'] }" if mobileprovision end |
#icons ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/lagunitas.patch.rb', line 8 def icons @icons ||= begin icons = [] info['CFBundleIcons']['CFBundlePrimaryIcon']['CFBundleIconFiles'].each do |name| icons << get_image(name) icons << get_image("#{name}@2x") end icons.delete_if { |i| !i } rescue # info['CFBundleIcons'] might be nil nil end end |
#metadata ⇒ Object
27 28 29 30 |
# File 'lib/lagunitas.ext.rb', line 27 def return if ! ||= CFPropertyList.native_types(CFPropertyList::List.new(file: File.join(@root, 'iTunesMetadata.plist')).value) end |
#metadata? ⇒ Boolean
31 32 33 34 |
# File 'lib/lagunitas.ext.rb', line 31 def return true if File.exists? File.join @root, 'iTunesMetadata.plist' end |
#mobileprovision ⇒ Object
12 13 14 15 |
# File 'lib/lagunitas.ext.rb', line 12 def mobileprovision return if !mobileprovision? @mobileprovision ||= CFPropertyList.native_types CFPropertyList::List.new(:data => `security cms -D -i #{File.join @path, 'embedded.mobileprovision'}`).value end |
#mobileprovision? ⇒ Boolean
16 17 18 19 |
# File 'lib/lagunitas.ext.rb', line 16 def mobileprovision? return true if @mobileprovision File.exists? File.join @path, 'embedded.mobileprovision' end |
#name ⇒ Object
9 10 11 |
# File 'lib/lagunitas.ext.rb', line 9 def name @info['CFBundleName'] end |
#release_type ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/lagunitas.ext.rb', line 35 def release_type @release_type ||= begin if mobileprovision? if devices 'adhoc' else 'inhouse' end elsif 'store' else 'adhoc' end end end |