Class: Xcode::Project::Version
Constant Summary
collapse
- KEY =
'CFBundleShortVersionString'
Instance Attribute Summary collapse
Attributes inherited from PlistChanger
#plist_path
Instance Method Summary
collapse
#initialize, #read, #write
Instance Attribute Details
#major ⇒ Object
Returns the value of attribute major.
4
5
6
|
# File 'lib/xcode/project/version.rb', line 4
def major
@major
end
|
#minor ⇒ Object
Returns the value of attribute minor.
4
5
6
|
# File 'lib/xcode/project/version.rb', line 4
def minor
@minor
end
|
#patch ⇒ Object
Returns the value of attribute patch.
4
5
6
|
# File 'lib/xcode/project/version.rb', line 4
def patch
@patch
end
|
Instance Method Details
#bump_major ⇒ Object
21
22
23
24
25
|
# File 'lib/xcode/project/version.rb', line 21
def bump_major
@major += 1
@minor, @patch = 0, 0
self
end
|
#bump_minor ⇒ Object
27
28
29
30
31
|
# File 'lib/xcode/project/version.rb', line 27
def bump_minor
@minor += 1
@patch = 0
self
end
|
#bump_patch ⇒ Object
33
34
35
36
|
# File 'lib/xcode/project/version.rb', line 33
def bump_patch
@patch += 1
self
end
|
#set(string) ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/xcode/project/version.rb', line 12
def set(string)
if /^(\d+)(?:\.(\d+)(?:\.(\d+))?)?/ =~ string
@major, @minor, @patch = $1.to_i, $2.to_i, $3.to_i
self
else
raise "Can't parse version #{string.inspect}"
end
end
|
#to_s ⇒ Object
8
9
10
|
# File 'lib/xcode/project/version.rb', line 8
def to_s
"#{major}.#{minor}.#{patch}".sub(/\.0/, '')
end
|