Class: IOSDevTools::InfoPlist
- Inherits:
-
Object
- Object
- IOSDevTools::InfoPlist
- Defined in:
- lib/ios_dev_tools/model/info_plist.rb
Instance Attribute Summary collapse
-
#info_plist_file_path ⇒ Object
Returns the value of attribute info_plist_file_path.
-
#plist_buddy_cmd ⇒ Object
Returns the value of attribute plist_buddy_cmd.
Instance Method Summary collapse
- #bundle_id ⇒ Object
- #bundle_id=(new_bundle_id) ⇒ Object
- #display_name ⇒ Object
- #display_name=(new_name) ⇒ Object
- #get_property(property_id) ⇒ Object
-
#initialize(info_plist_file_path) {|_self| ... } ⇒ InfoPlist
constructor
A new instance of InfoPlist.
- #set_property(property_id, property_value) ⇒ Object
Constructor Details
#initialize(info_plist_file_path) {|_self| ... } ⇒ InfoPlist
Returns a new instance of InfoPlist.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 11 def initialize info_plist_file_path @info_plist_file_path=info_plist_file_path yield self if block_given? @plist_buddy_cmd||="/usr/libexec/PlistBuddy" raise "Property list file \"#{info_plist_file_path}\" doesn't exist" if not File.exists? @info_plist_file_path raise "Plist editor \"#{info_plist_file_path}\" doesn't exist" if not File.exists? @plist_buddy_cmd end |
Instance Attribute Details
#info_plist_file_path ⇒ Object
Returns the value of attribute info_plist_file_path.
8 9 10 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 8 def info_plist_file_path @info_plist_file_path end |
#plist_buddy_cmd ⇒ Object
Returns the value of attribute plist_buddy_cmd.
9 10 11 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 9 def plist_buddy_cmd @plist_buddy_cmd end |
Instance Method Details
#bundle_id ⇒ Object
41 42 43 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 41 def bundle_id get_property "CFBundleIdentifier" end |
#bundle_id=(new_bundle_id) ⇒ Object
45 46 47 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 45 def bundle_id= new_bundle_id set_property "CFBundleIdentifier", new_bundle_id end |
#display_name ⇒ Object
33 34 35 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 33 def display_name get_property "CFBundleDisplayName" end |
#display_name=(new_name) ⇒ Object
37 38 39 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 37 def display_name= new_name set_property "CFBundleDisplayName", new_name end |
#get_property(property_id) ⇒ Object
29 30 31 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 29 def get_property property_id `#{@plist_buddy_cmd} -c "Print :#{property_id}" "#{@info_plist_file_path}"`.strip end |
#set_property(property_id, property_value) ⇒ Object
24 25 26 27 |
# File 'lib/ios_dev_tools/model/info_plist.rb', line 24 def set_property property_id, property_value return if not property_id or not property_value `#{@plist_buddy_cmd} -c "Set :#{property_id} #{property_value}" "#{@info_plist_file_path}"` end |