Class: BuildTool::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/build-tool/version.rb

Instance Method Summary collapse

Constructor Details

#initialize(major, minor, patch, rc = nil) ⇒ Version

Returns a new instance of Version.



7
8
9
10
11
12
# File 'lib/build-tool/version.rb', line 7

def initialize( major, minor, patch, rc = nil )
    @MAJOR_VERSION = major
    @MINOR_VERSION = minor
    @PATCH_LEVEL =   patch
    @RC = rc
end

Instance Method Details

#recipe_versionObject

During a minor release build-tool guarantess recipe compatibility.



23
24
25
# File 'lib/build-tool/version.rb', line 23

def recipe_version()
    return '%s.%s' % [ @MAJOR_VERSION, @MINOR_VERSION ]
end

#to_sObject



14
15
16
17
18
19
20
# File 'lib/build-tool/version.rb', line 14

def to_s()
    version = '%d.%d.%d' % [ @MAJOR_VERSION, @MINOR_VERSION, @PATCH_LEVEL ]
    if not @RC.nil?
        version += '.rc%d' % @RC
    end
    return version
end