Class: Xcode::InfoPlist

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode/info_plist.rb

Overview

Instance Method Summary collapse

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.expand_path("#{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_nameObject



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

#identifierObject



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_versionObject



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

#saveObject



53
54
55
# File 'lib/xcode/info_plist.rb', line 53

def save
  File.open(@plist_location, 'w') {|f| f << @plist.to_plist}
end

#versionObject



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