Class SemanticPuppet::Version
In: lib/semantic_puppet/version.rb
Parent: Numeric

@note SemanticPuppet::Version subclasses Numeric so that it has sane Range

      semantics in Ruby 1.9+.

Methods

<=>   ==   build   eql?   hash   new   next   parse   prerelease   stable?   to_s   valid?  

Included Modules

Comparable

Classes and Modules

Class SemanticPuppet::Version::ValidationFailure

Constants

REGEX_NUMERIC = "(0|[1-9]\\d*)[.](0|[1-9]\\d*)[.](0|[1-9]\\d*)"   Version string matching regexes
REGEX_PRE = "(?:[-](.*?))?"
REGEX_BUILD = "(?:[+](.*?))?"
REGEX_FULL = REGEX_NUMERIC + REGEX_PRE + REGEX_BUILD
MIN = self.new(0, 0, 0, []).freeze   The lowest precedence Version possible
MAX = self.new((1.0/0.0), 0, 0).freeze   The highest precedence Version possible

Attributes

major  [R] 
minor  [R] 
patch  [R] 

Public Class methods

Parse a Semantic Version string.

@param ver [String] the version string to parse @return [Version] a comparable {Version} object

Validate a Semantic Version string.

@param ver [String] the version string to validate @return [bool] whether or not the string represents a valid Semantic Version

Public Instance methods

==(other)

Alias for eql?

@return [Boolean] true if this is a stable release

[Validate]