Class: Provisioning
- Inherits:
-
Object
- Object
- Provisioning
- Defined in:
- lib/provisinfo/provisioning.rb
Instance Attribute Summary collapse
-
#appID ⇒ Object
Returns the value of attribute appID.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#name ⇒ Object
Returns the value of attribute name.
-
#teamID ⇒ Object
Returns the value of attribute teamID.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename = nil) ⇒ Provisioning
constructor
by default, it will load the first .mobileprovision file in current directory.
- #load_from_file ⇒ Object
- #show_info ⇒ Object
Constructor Details
#initialize(filename = nil) ⇒ Provisioning
by default, it will load the first .mobileprovision file in current directory
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/provisinfo/provisioning.rb', line 13 def initialize(filename = nil) if filename.nil? @filename = self.class.list_files().first else @filename = filename end if @filename self.load_from_file() else @name ="Unknown" end end |
Instance Attribute Details
#appID ⇒ Object
Returns the value of attribute appID.
8 9 10 |
# File 'lib/provisinfo/provisioning.rb', line 8 def appID @appID end |
#filename ⇒ Object
Returns the value of attribute filename.
10 11 12 |
# File 'lib/provisinfo/provisioning.rb', line 10 def filename @filename end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/provisinfo/provisioning.rb', line 5 def name @name end |
#teamID ⇒ Object
Returns the value of attribute teamID.
9 10 11 |
# File 'lib/provisinfo/provisioning.rb', line 9 def teamID @teamID end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/provisinfo/provisioning.rb', line 6 def type @type end |
#uuid ⇒ Object
Returns the value of attribute uuid.
7 8 9 |
# File 'lib/provisinfo/provisioning.rb', line 7 def uuid @uuid end |
Class Method Details
.list_files ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/provisinfo/provisioning.rb', line 39 def self.list_files() provisioning_file_paths = [] Dir.entries('.').each do |path| provisioning_file_paths << path if path=~ /.*\.mobileprovision$/ end provisioning_file_paths end |
Instance Method Details
#load_from_file ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/provisinfo/provisioning.rb', line 28 def load_from_file() xml_raw = `security cms -D -i #{@filename}` xml_parsed = Plist::parse_xml(xml_raw) @teamID = xml_parsed['Entitlements']['com.apple.developer.team-identifier'] @name = xml_parsed['Name'] @uuid = xml_parsed['UUID'] @appID = xml_parsed['Entitlements']['application-identifier'] puts xml_parsed['application-identifier'] end |
#show_info ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/provisinfo/provisioning.rb', line 47 def show_info() puts "Name:"+self.name puts "UUDID:"+self.uuid puts "AppID:"+self.appID puts "TeamID:"+self.teamID end |