class Gem::Version
Public Class Methods
(_ToS version) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 12
def self.correct?: (_ToS version) -> bool
True if the version string matches RubyGems’ requirements.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 24
def self.create: (_ToS | Version input) -> instance
| (nil input) -> nil
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 44
def <=>: (untyped other) -> Integer?
Compares this version with other returning -1, 0, or 1 if the other version is larger, the same, or smaller than this one. other must be an instance of Gem::Version, comparing with other types may raise an exception.
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 52
def approximate_recommendation: () -> String
A recommended version for use with a ~> Requirement.
() → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 63
def bump: () -> self
Return a new version object where the next to the last revision number is one greater (e.g., 5.3.1 => 5.4).
Pre-release (alpha) parts, e.g, 5.3.1.b.2 => 5.4, are ignored.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 72
def canonical_segments: () -> Array[Integer | String]
remove trailing zeros segments before first letter or at the end of the version
(untyped other) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 81
def eql?: (untyped other) -> bool
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 90
def marshal_dump: () -> Array[String]
Dump only the raw version string, not the complete object. It’s a string for backwards (RubyGems 1.3.5 and earlier) compatibility.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 99
def marshal_load: (Array[String] array) -> void
Load custom marshal format. It’s a string for backwards (RubyGems 1.3.5 and earlier) compatibility.
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 107
def prerelease?: () -> bool
A version is considered a prerelease if it contains a letter.
() → self
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/core/rubygems/version.rbs, line 116
def release: () -> self
The release for this version (e.g. 1.2.0.a -> 1.2.0). Non-prerelease versions return themselves.