Class: Debian::Versions::Stable

Inherits:
Base
  • Object
show all
Includes:
Versionable
Defined in:
lib/msp_release/debian.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Versionable

#to_version

Methods inherited from Base

new_from_string, new_if_matches

Constructor Details

#initialize(major, minor, bugfix, revision) ⇒ Stable

Returns a new instance of Stable.



64
65
66
67
68
69
# File 'lib/msp_release/debian.rb', line 64

def initialize(major, minor, bugfix, revision)
  @major    = major
  @minor    = minor
  @bugfix   = bugfix
  @revision = revision
end

Class Method Details

.patternObject



60
61
62
# File 'lib/msp_release/debian.rb', line 60

def self.pattern
  /^([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)$/
end

Instance Method Details

#bumpObject



71
72
73
# File 'lib/msp_release/debian.rb', line 71

def bump
  self.class.new(@major, @minor, @bugfix, @revision.to_i + 1).to_s
end

#to_sObject



75
76
77
# File 'lib/msp_release/debian.rb', line 75

def to_s
  [@major, @minor, @bugfix].join(".") + "-#{@revision}"
end