Class: BuildTool::Version
- Inherits:
-
Object
- Object
- BuildTool::Version
- Defined in:
- lib/build-tool/version.rb
Instance Method Summary collapse
-
#initialize(major, minor, patch, rc = nil) ⇒ Version
constructor
A new instance of Version.
-
#recipe_version ⇒ Object
During a minor release build-tool guarantess recipe compatibility.
- #to_s ⇒ Object
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_version ⇒ Object
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_s ⇒ Object
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 |