Class: XcodeTool::Mobileprovision
- Inherits:
-
Object
- Object
- XcodeTool::Mobileprovision
- Defined in:
- lib/bean/xcode_tool.rb
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(file) ⇒ Mobileprovision
constructor
A new instance of Mobileprovision.
- #method_missing(m, *args) ⇒ Object
- #team_identifier ⇒ Object
-
#value_from_plist(key) ⇒ Object
Get value form Mobileprovision file.
Constructor Details
#initialize(file) ⇒ Mobileprovision
Returns a new instance of Mobileprovision.
96 97 98 |
# File 'lib/bean/xcode_tool.rb', line 96 def initialize(file) @mobileprovision_file = file end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
100 101 102 103 104 |
# File 'lib/bean/xcode_tool.rb', line 100 def method_missing(m, *args) return if m.to_s =~ /=$/ key = m.to_s.split(/_/).map { |e| e.capitalize }.join('') value_from_plist(key) end |
Instance Method Details
#info ⇒ Object
106 107 108 |
# File 'lib/bean/xcode_tool.rb', line 106 def info system "security cms -D -i #{@mobileprovision_file}" end |
#team_identifier ⇒ Object
110 111 112 |
# File 'lib/bean/xcode_tool.rb', line 110 def team_identifier value_from_plist('Entitlements:com.apple.developer.team-identifier') end |
#value_from_plist(key) ⇒ Object
Get value form Mobileprovision file.
115 116 117 |
# File 'lib/bean/xcode_tool.rb', line 115 def value_from_plist(key) `/usr/libexec/PlistBuddy -c 'Print :#{key}' /dev/stdin <<< $(security cms -D -i #{@mobileprovision_file})` end |