class Net::SCP::Version
end
abort “your software is too old!”
if Net::SCP::Version::CURRENT < Net::SCP::Version[2,1,0]
require ‘net/scp/version’
of a library is what you require:
Two Version instances may be compared, so that you can test that a versiontiny
(or patch
) number.
consists of three parts: the major
number, the minor
number, and the
A class for describing the current version of a library. The version
def self.[](major, minor, tiny, pre = nil)
A convenience method for instantiating a new Version instance with the
def self.[](major, minor, tiny, pre = nil) new(major, minor, tiny, pre) end
def <=>(version)
def <=>(version) to_i <=> version.to_i end
def initialize(major, minor, tiny, pre = nil)
def initialize(major, minor, tiny, pre = nil) @major, @minor, @tiny, @pre = major, minor, tiny, pre end
def to_i
Converts this version to a canonical integer that may be compared
def to_i @to_i ||= @major * 1_000_000 + @minor * 1_000 + @tiny end
def to_s
Converts this version object to a string, where each of the three
def to_s @to_s ||= [@major, @minor, @tiny, @pre].compact.join(".") end