Class: Xcode::Project::BuildNumber

Inherits:
PlistChanger show all
Defined in:
lib/xcode/project/build_number.rb

Constant Summary collapse

KEY =
'CFBundleVersion'

Instance Attribute Summary collapse

Attributes inherited from PlistChanger

#plist_path

Instance Method Summary collapse

Methods inherited from PlistChanger

#initialize, #read, #write

Constructor Details

This class inherits a constructor from Xcode::Project::PlistChanger

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/xcode/project/build_number.rb', line 4

def number
  @number
end

Instance Method Details

#incrementObject



21
22
23
24
# File 'lib/xcode/project/build_number.rb', line 21

def increment
  @number += 1
  self
end

#set(string) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/xcode/project/build_number.rb', line 12

def set(string)
  if /^(\d+)/ =~ string
    @number = $1.to_i
    self
  else
    raise "Can't parse build number #{string.inspect}"
  end
end

#to_sObject



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

def to_s
  number.to_s
end