JezK
Edit File: version.rbs
%a{annotate:rdoc:skip} module Gem class Version include Comparable # <!-- # rdoc-file=lib/rubygems/version.rb # - correct?(version) # --> # True if the `version` string matches RubyGems' requirements. # def self.correct?: (_ToS version) -> bool # <!-- # rdoc-file=lib/rubygems/version.rb # - create(input) # --> # Factory method to create a Version object. Input may be a Version or a String. # Intended to simplify client code. # # ver1 = Version.create('1.3.17') # -> (Version object) # ver2 = Version.create(ver1) # -> (ver1) # ver3 = Version.create(nil) # -> nil # def self.create: (_ToS | Version input) -> instance | (nil input) -> nil # <!-- # rdoc-file=lib/rubygems/version.rb # - new(version) # --> # Constructs a Version from the `version` string. A version string is a series # of digits or ASCII letters separated by dots. # def initialize: (_ToS version) -> void # <!-- # rdoc-file=lib/rubygems/version.rb # - <=>(other) # --> # Compares this version with `other` returning -1, 0, or 1 if the other version # is larger, the same, or smaller than this one. Attempts to compare to # something that's not a `Gem::Version` return `nil`. # def <=>: (untyped other) -> Integer? # <!-- # rdoc-file=lib/rubygems/version.rb # - approximate_recommendation() # --> # A recommended version for use with a ~> Requirement. # def approximate_recommendation: () -> String # <!-- # rdoc-file=lib/rubygems/version.rb # - bump() # --> # 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. # def bump: () -> instance # <!-- # rdoc-file=lib/rubygems/version.rb # - canonical_segments() # --> # def canonical_segments: () -> Array[Integer | String] # <!-- # rdoc-file=lib/rubygems/version.rb # - eql?(other) # --> # A Version is only eql? to another version if it's specified to the same # precision. Version "1.0" is not the same as version "1". # def eql?: (untyped other) -> bool # <!-- # rdoc-file=lib/rubygems/version.rb # - marshal_dump() # --> # Dump only the raw version string, not the complete object. It's a string for # backwards (RubyGems 1.3.5 and earlier) compatibility. # def marshal_dump: () -> Array[String] # <!-- # rdoc-file=lib/rubygems/version.rb # - marshal_load(array) # --> # Load custom marshal format. It's a string for backwards (RubyGems 1.3.5 and # earlier) compatibility. # def marshal_load: (Array[String] array) -> void # <!-- # rdoc-file=lib/rubygems/version.rb # - prerelease?() # --> # A version is considered a prerelease if it contains a letter. # def prerelease?: () -> bool # <!-- # rdoc-file=lib/rubygems/version.rb # - release() # --> # The release for this version (e.g. 1.2.0.a -> 1.2.0). Non-prerelease versions # return themselves. # def release: () -> instance # <!-- # rdoc-file=lib/rubygems/version.rb # - version() # --> # A string representation of this Version. # def version: () -> String # <!-- # rdoc-file=lib/rubygems/version.rb # - to_s() # --> # alias to_s version end end