Class: Xcode::Project::PlistChanger

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

Direct Known Subclasses

BuildNumber, Version

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plist_path = 'Info.plist') ⇒ PlistChanger

Returns a new instance of PlistChanger.



8
9
10
11
# File 'lib/xcode/project/plist_changer.rb', line 8

def initialize(plist_path = 'Info.plist')
  @plist_path = plist_path
  read
end

Instance Attribute Details

#plist_pathObject (readonly)

Returns the value of attribute plist_path.



6
7
8
# File 'lib/xcode/project/plist_changer.rb', line 6

def plist_path
  @plist_path
end

Instance Method Details

#readObject



13
14
15
# File 'lib/xcode/project/plist_changer.rb', line 13

def read
  set(plist[key])
end

#writeObject



17
18
19
20
21
# File 'lib/xcode/project/plist_changer.rb', line 17

def write
  plist.tap do |plist|
    plist[key] = to_s
  end.save_plist(plist_path)
end