Class RPM::Version
In: lib/rpm/version.rb
Parent: Object

Methods

<=>   e   hash   new   newer?   older?   parse_evr   r   to_s   to_vr   to_vre   to_vre_epoch_zero   v  

Included Modules

Comparable

Public Class methods

@overload new(vr, e = nil)

  Creates a version object from a string representation
  @param [String] vr version and release in the form "v-r"
  @param [Number] e epoch
  @return [Version]

@overload new(v, r, e = nil)

  Creates a version object from a string representation
  @param [String] v version
  @param [String] r release
  @param [Number] e epoch
  @return [Version]

@example

  RPM:: Version.new "1.0.0-3"
  RPM:: Version.new "1.04"
  RPM:: Version.new "1.0.0-3k", 1
  RPM:: Version.new "2.0.3", "5k"

Parses a "epoch:version-release" string @return [Array] tuple [epoch, version, release]

Public Instance methods

Comparison between versions @param [Version] other @return [Number] -1 if other is greater than, 0 if other is equal to,

  and +1 if other is less than version.

@example

  v1 = RPM::Version.new("3.0-0",1)
  v2 = RPM::Version.new("3.1-0",1)
  v1 <=> v2
  => -1

@return [String] the epoch component

  or +nil+

Hash based on the version content @return [String]

@param [Version] other Version to compare against @return [Boolean] true if the version is newer than other

@param [Version] other Version to compare against @return [Boolean] true if the version is older than other

@return [String] the release component

  or +nil+

String representation in the form "v-r" @return [String] @note The epoch is not included

String representation in the form "e:v-r" @return [String] @note The epoch is included if present

String representation in the form "e:v-r" @return [String] @note The epoch is included always. As 0 if not present

@return [String] the version component

[Validate]