class RPM::Version

Included Modules

Defined in:

rpm/version.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(str : String, epoch : Int) #

[View source]
def self.new(v, r, epoch : Int? = nil) #

[View source]
def self.new(str : String) #

[View source]

Class Method Detail

def self.parse_evr(evr : String) #

[View source]

Instance Method Detail

def <=>(other : Version) : Int32 #

Compare to other versions.

If self is newer, returns 1. If other is newer, returns -1. If two versions are equal, returns 0.

If one's epoch is nil, it will be evaluated as 0 for comparison. If one's release is nil, it will be evaluated as empty string.

NOTE Using the semantic of RPM's rpmVersionCompare function,

  except for the process for nil-releases.

[View source]
def e : UInt32? #

[View source]
def hash #
Description copied from class Object

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.


[View source]
def newer?(other : Version) #

[View source]
def older?(other : Version) #

[View source]
def r : String? #

[View source]
def to_s(io) #

Equivalent to #to_vre(io)


[View source]
def to_s #

Equivalent to #to_vre


[View source]
def to_vr(io) #

Send the string represents the version and release, to given IO.


[View source]
def to_vr #

Returns the string represents the version and release.


[View source]
def to_vre(io) #

Send the string represents the version, release and epoch if set, to given IO.


[View source]
def to_vre #

Returns the string represents the version, release and epoch if set.


[View source]
def to_vre_epoch_zero(io) #

Send the string represents the version, release and epoch where epoch is filled with 0, to given IO.

This method makes a string comparable by single call of rpmvercomp function, but it seems to be used for comparing version and release separately, according to usage in RPM itself.


[View source]
def to_vre_epoch_zero #

Returns the string represents the version, release and epoch where epoch is filled with 0.

This method makes a string comparable by single call of rpmvercomp function, but it seems to be used for comparing version and release separately, according to usage in RPM itself.


[View source]
def v : String #

[View source]