Class: Xcode::InfoPlist
- Inherits:
-
Object
- Object
- Xcode::InfoPlist
- Defined in:
- lib/xcode/info_plist.rb
Overview
Instance Method Summary collapse
- #display_name ⇒ Object
- #display_name=(name) ⇒ Object
- #identifier ⇒ Object
- #identifier=(identifier) ⇒ Object
-
#initialize(config, plist_location) ⇒ InfoPlist
constructor
A new instance of InfoPlist.
- #marketing_version ⇒ Object
- #marketing_version=(version) ⇒ Object
- #save ⇒ Object
- #version ⇒ Object
- #version=(version) ⇒ Object
Constructor Details
#initialize(config, plist_location) ⇒ InfoPlist
Returns a new instance of InfoPlist.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/xcode/info_plist.rb', line 10 def initialize(config, plist_location) @config = config @plist_location = File.("#{File.dirname(@config.target.project.path)}/#{plist_location}") unless File.exists?(@plist_location) puts 'Plist not found ' + @plist_location exit 1 end @plist = Plist::parse_xml(@plist_location) end |
Instance Method Details
#display_name ⇒ Object
45 46 47 |
# File 'lib/xcode/info_plist.rb', line 45 def display_name @plist['CFBundleDisplayName'] end |
#display_name=(name) ⇒ Object
49 50 51 |
# File 'lib/xcode/info_plist.rb', line 49 def display_name=(name) @plist['CFBundleDisplayName'] = name end |
#identifier ⇒ Object
37 38 39 |
# File 'lib/xcode/info_plist.rb', line 37 def identifier @plist['CFBundleIdentifier'] end |
#identifier=(identifier) ⇒ Object
41 42 43 |
# File 'lib/xcode/info_plist.rb', line 41 def identifier=(identifier) @plist['CFBundleIdentifier'] = identifier end |
#marketing_version ⇒ Object
21 22 23 |
# File 'lib/xcode/info_plist.rb', line 21 def marketing_version @plist['CFBundleShortVersionString'] end |
#marketing_version=(version) ⇒ Object
25 26 27 |
# File 'lib/xcode/info_plist.rb', line 25 def marketing_version=(version) @plist['CFBundleShortVersionString'] = version end |
#save ⇒ Object
53 54 55 |
# File 'lib/xcode/info_plist.rb', line 53 def save File.open(@plist_location, 'w') {|f| f << @plist.to_plist} end |
#version ⇒ Object
29 30 31 |
# File 'lib/xcode/info_plist.rb', line 29 def version @plist['CFBundleVersion'] end |
#version=(version) ⇒ Object
33 34 35 |
# File 'lib/xcode/info_plist.rb', line 33 def version=(version) @plist['CFBundleVersion'] = version.to_s end |