rbs 3.10.0.pre.2 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/c-check.yml +1 -1
  3. data/.github/workflows/comments.yml +2 -2
  4. data/.github/workflows/ruby.yml +7 -7
  5. data/CHANGELOG.md +49 -0
  6. data/core/array.rbs +56 -3
  7. data/core/complex.rbs +32 -21
  8. data/core/encoding.rbs +3 -7
  9. data/core/enumerable.rbs +1 -1
  10. data/core/enumerator.rbs +18 -1
  11. data/core/fiber.rbs +2 -1
  12. data/core/file.rbs +1 -1
  13. data/core/file_test.rbs +1 -1
  14. data/core/float.rbs +208 -21
  15. data/core/gc.rbs +4 -9
  16. data/core/hash.rbs +4 -4
  17. data/core/integer.rbs +78 -38
  18. data/core/io/buffer.rbs +18 -7
  19. data/core/io.rbs +8 -8
  20. data/core/kernel.rbs +8 -8
  21. data/core/module.rbs +17 -6
  22. data/core/numeric.rbs +8 -8
  23. data/core/object_space.rbs +13 -20
  24. data/core/pathname.rbs +2 -3
  25. data/core/ractor.rbs +4 -4
  26. data/core/range.rbs +1 -1
  27. data/core/rational.rbs +37 -24
  28. data/core/rbs/unnamed/argf.rbs +1 -1
  29. data/core/regexp.rbs +3 -3
  30. data/core/ruby.rbs +53 -0
  31. data/core/rubygems/version.rbs +2 -3
  32. data/core/set.rbs +86 -64
  33. data/core/string.rbs +275 -141
  34. data/core/thread.rbs +9 -9
  35. data/core/trace_point.rbs +7 -4
  36. data/lib/rbs/test/type_check.rb +1 -0
  37. data/lib/rbs/version.rb +1 -1
  38. data/lib/rdoc/discover.rb +1 -1
  39. data/stdlib/bigdecimal/0/big_decimal.rbs +100 -82
  40. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  41. data/stdlib/date/0/date.rbs +67 -59
  42. data/stdlib/date/0/date_time.rbs +1 -1
  43. data/stdlib/json/0/json.rbs +1 -0
  44. data/stdlib/objspace/0/objspace.rbs +1 -1
  45. data/stdlib/openssl/0/openssl.rbs +150 -80
  46. data/stdlib/psych/0/psych.rbs +3 -3
  47. data/stdlib/stringio/0/stringio.rbs +796 -37
  48. data/stdlib/strscan/0/string_scanner.rbs +1 -1
  49. data/stdlib/tempfile/0/tempfile.rbs +2 -2
  50. data/stdlib/time/0/time.rbs +1 -1
  51. data/stdlib/timeout/0/timeout.rbs +63 -7
  52. data/stdlib/uri/0/generic.rbs +1 -1
  53. metadata +3 -2
data/core/kernel.rbs CHANGED
@@ -718,7 +718,7 @@ module Kernel : BasicObject
718
718
  # variable `$?` to the process status.
719
719
  #
720
720
  # This method has potential security vulnerabilities if called with untrusted
721
- # input; see [Command Injection](rdoc-ref:command_injection.rdoc).
721
+ # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
722
722
  #
723
723
  # Examples:
724
724
  #
@@ -1118,7 +1118,7 @@ module Kernel : BasicObject
1118
1118
  # Returns the string resulting from formatting `objects` into `format_string`.
1119
1119
  #
1120
1120
  # For details on `format_string`, see [Format
1121
- # Specifications](rdoc-ref:format_specifications.rdoc).
1121
+ # Specifications](rdoc-ref:language/format_specifications.rdoc).
1122
1122
  #
1123
1123
  def self?.format: (String format, *untyped args) -> String
1124
1124
 
@@ -1129,7 +1129,7 @@ module Kernel : BasicObject
1129
1129
  # Returns the string resulting from formatting `objects` into `format_string`.
1130
1130
  #
1131
1131
  # For details on `format_string`, see [Format
1132
- # Specifications](rdoc-ref:format_specifications.rdoc).
1132
+ # Specifications](rdoc-ref:language/format_specifications.rdoc).
1133
1133
  #
1134
1134
  alias sprintf format
1135
1135
 
@@ -1249,7 +1249,7 @@ module Kernel : BasicObject
1249
1249
  # Creates an IO object connected to the given file.
1250
1250
  #
1251
1251
  # This method has potential security vulnerabilities if called with untrusted
1252
- # input; see [Command Injection](rdoc-ref:command_injection.rdoc).
1252
+ # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
1253
1253
  #
1254
1254
  # With no block given, file stream is returned:
1255
1255
  #
@@ -1327,7 +1327,7 @@ module Kernel : BasicObject
1327
1327
  # io.write(sprintf(format_string, *objects))
1328
1328
  #
1329
1329
  # For details on `format_string`, see [Format
1330
- # Specifications](rdoc-ref:format_specifications.rdoc).
1330
+ # Specifications](rdoc-ref:language/format_specifications.rdoc).
1331
1331
  #
1332
1332
  # With the single argument `format_string`, formats `objects` into the string,
1333
1333
  # then writes the formatted string to $stdout:
@@ -1907,7 +1907,7 @@ module Kernel : BasicObject
1907
1907
  # * Invoking the executable at `exe_path`.
1908
1908
  #
1909
1909
  # This method has potential security vulnerabilities if called with untrusted
1910
- # input; see [Command Injection](rdoc-ref:command_injection.rdoc).
1910
+ # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
1911
1911
  #
1912
1912
  # The new process is created using the [exec system
1913
1913
  # call](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/e
@@ -1999,7 +1999,7 @@ module Kernel : BasicObject
1999
1999
  # * Invoking the executable at `exe_path`.
2000
2000
  #
2001
2001
  # This method has potential security vulnerabilities if called with untrusted
2002
- # input; see [Command Injection](rdoc-ref:command_injection.rdoc).
2002
+ # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
2003
2003
  #
2004
2004
  # Returns the process ID (pid) of the new process, without waiting for it to
2005
2005
  # complete.
@@ -2102,7 +2102,7 @@ module Kernel : BasicObject
2102
2102
  # * Invoking the executable at `exe_path`.
2103
2103
  #
2104
2104
  # This method has potential security vulnerabilities if called with untrusted
2105
- # input; see [Command Injection](rdoc-ref:command_injection.rdoc).
2105
+ # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
2106
2106
  #
2107
2107
  # Returns:
2108
2108
  #
data/core/module.rbs CHANGED
@@ -135,14 +135,25 @@ class Module < Object
135
135
 
136
136
  # <!--
137
137
  # rdoc-file=object.c
138
- # - module <=> other_module -> -1, 0, +1, or nil
138
+ # - self <=> object -> -1, 0, +1, or nil
139
139
  # -->
140
- # Comparison---Returns -1, 0, +1 or nil depending on whether `module` includes
141
- # `other_module`, they are the same, or if `module` is included by
142
- # `other_module`.
140
+ # Returns:
143
141
  #
144
- # Returns `nil` if `module` has no relationship with `other_module`, if
145
- # `other_module` is not a module, or if the two values are incomparable.
142
+ # * `-1`, if `self` includes `object`, if or `self` is a subclass of `object`.
143
+ # * `0`, if `self` and `object` are the same.
144
+ # * `1`, if `object` includes `self`, or if `object` is a subclass of `self`.
145
+ # * `nil`, if none of the above is true.
146
+ #
147
+ # Examples:
148
+ #
149
+ # # Class Array includes module Enumerable.
150
+ # Array <=> Enumerable # => -1
151
+ # Enumerable <=> Enumerable # => 0
152
+ # Enumerable <=> Array # => 1
153
+ # # Class File is a subclass of class IO.
154
+ # File <=> IO # => -1
155
+ # IO <=> File # => 1
156
+ # File <=> File # => 0
146
157
  #
147
158
  def <=>: (untyped other) -> Integer?
148
159
 
data/core/numeric.rbs CHANGED
@@ -160,7 +160,7 @@ class Numeric
160
160
  # rdoc-file=numeric.c
161
161
  # - self % other -> real_numeric
162
162
  # -->
163
- # Returns `self` modulo `other` as a real number.
163
+ # Returns `self` modulo `other` as a real numeric (Integer, Float, or Rational).
164
164
  #
165
165
  # Of the Core and Standard Library classes, only Rational uses this
166
166
  # implementation.
@@ -212,7 +212,7 @@ class Numeric
212
212
  # rdoc-file=numeric.c
213
213
  # - -self -> numeric
214
214
  # -->
215
- # Unary Minus---Returns the receiver, negated.
215
+ # Returns `self`, negated.
216
216
  #
217
217
  def -@: () -> Numeric
218
218
 
@@ -336,7 +336,7 @@ class Numeric
336
336
  # - div(other) -> integer
337
337
  # -->
338
338
  # Returns the quotient `self/other` as an integer (via `floor`), using method
339
- # `/` in the derived class of `self`. (Numeric itself does not define method
339
+ # `/` as defined in the subclass of Numeric. (Numeric itself does not define
340
340
  # `/`.)
341
341
  #
342
342
  # Of the Core and Standard Library classes, Only Float and Rational use this
@@ -398,8 +398,8 @@ class Numeric
398
398
  # rdoc-file=numeric.c
399
399
  # - fdiv(other) -> float
400
400
  # -->
401
- # Returns the quotient `self/other` as a float, using method `/` in the derived
402
- # class of `self`. (Numeric itself does not define method `/`.)
401
+ # Returns the quotient `self/other` as a float, using method `/` as defined in
402
+ # the subclass of Numeric. (Numeric itself does not define `/`.)
403
403
  #
404
404
  # Of the Core and Standard Library classes, only BigDecimal uses this
405
405
  # implementation.
@@ -488,7 +488,7 @@ class Numeric
488
488
  alias magnitude abs
489
489
 
490
490
  # <!-- rdoc-file=numeric.c -->
491
- # Returns `self` modulo `other` as a real number.
491
+ # Returns `self` modulo `other` as a real numeric (Integer, Float, or Rational).
492
492
  #
493
493
  # Of the Core and Standard Library classes, only Rational uses this
494
494
  # implementation.
@@ -765,8 +765,8 @@ class Numeric
765
765
  # rdoc-file=numeric.c
766
766
  # - to_int -> integer
767
767
  # -->
768
- # Returns `self` as an integer; converts using method `to_i` in the derived
769
- # class.
768
+ # Returns `self` as an integer; converts using method `to_i` in the subclass of
769
+ # Numeric. (Numeric itself does not define `to_i`.)
770
770
  #
771
771
  # Of the Core and Standard Library classes, only Rational and Complex use this
772
772
  # implementation.
@@ -137,33 +137,26 @@ module ObjectSpace
137
137
  # Calls the block once for each living, nonimmediate object in this Ruby
138
138
  # process. If *module* is specified, calls the block for only those classes or
139
139
  # modules that match (or are a subclass of) *module*. Returns the number of
140
- # objects found. Immediate objects (`Fixnum`s, `Symbol`s `true`, `false`, and
141
- # `nil`) are never returned. In the example below, #each_object returns both the
142
- # numbers we defined and several constants defined in the Math module.
140
+ # objects found. Immediate objects (such as `Fixnum`s, static `Symbol`s `true`,
141
+ # `false` and `nil`) are never returned.
143
142
  #
144
143
  # If no block is given, an enumerator is returned instead.
145
144
  #
146
- # a = 102.7
147
- # b = 95 # Won't be returned
148
- # c = 12345678987654321
149
- # count = ObjectSpace.each_object(Numeric) {|x| p x }
145
+ # Job = Class.new
146
+ # jobs = [Job.new, Job.new]
147
+ # count = ObjectSpace.each_object(Job) {|x| p x }
150
148
  # puts "Total count: #{count}"
151
149
  #
152
150
  # *produces:*
153
151
  #
154
- # 12345678987654321
155
- # 102.7
156
- # 2.71828182845905
157
- # 3.14159265358979
158
- # 2.22044604925031e-16
159
- # 1.7976931348623157e+308
160
- # 2.2250738585072e-308
161
- # Total count: 7
162
- #
163
- # Due to a current known Ractor implementation issue, this method will not yield
164
- # Ractor-unshareable objects in multi-Ractor mode (when `Ractor.new` has been
165
- # called within the process at least once). See
166
- # https://bugs.ruby-lang.org/issues/19387 for more information.
152
+ # #<Job:0x000000011d6cbbf0>
153
+ # #<Job:0x000000011d6cbc68>
154
+ # Total count: 2
155
+ #
156
+ # Due to a current Ractor implementation issue, this method does not yield
157
+ # Ractor-unshareable objects when the process is in multi-Ractor mode.
158
+ # Multi-ractor mode is enabled when `Ractor.new` has been called for the first
159
+ # time. See https://bugs.ruby-lang.org/issues/19387 for more information.
167
160
  #
168
161
  # a = 12345678987654321 # shareable
169
162
  # b = [].freeze # shareable
data/core/pathname.rbs CHANGED
@@ -712,6 +712,7 @@ class Pathname
712
712
  # rdoc-file=pathname_builtin.rb
713
713
  # - freeze()
714
714
  # -->
715
+ # Freze self.
715
716
  #
716
717
  def freeze: () -> Pathname
717
718
 
@@ -1154,9 +1155,7 @@ class Pathname
1154
1155
  #
1155
1156
  def taint: () -> Pathname
1156
1157
 
1157
- # <!-- rdoc-file=ext/pathname/pathname.c -->
1158
- # Return the path as a String.
1159
- #
1158
+ # <!-- rdoc-file=pathname_builtin.rb -->
1160
1159
  # to_path is implemented so Pathname objects are usable with File.open, etc.
1161
1160
  #
1162
1161
  def to_path: () -> String
data/core/ractor.rbs CHANGED
@@ -382,7 +382,7 @@ class Ractor
382
382
 
383
383
  # <!--
384
384
  # rdoc-file=ractor.rb
385
- # - Ractor.sharable_proc(self: nil){} -> sharable proc
385
+ # - Ractor.shareable_proc(self: nil){} -> shareable proc
386
386
  # -->
387
387
  # It returns shareable Proc object. The Proc object is shareable and the self in
388
388
  # a block will be replaced with the value passed via `self:` keyword.
@@ -393,7 +393,7 @@ class Ractor
393
393
  # Ractor.shareable_proc{ p a }
394
394
  # #=> can not isolate a Proc because it accesses outer variables (a). (ArgumentError)
395
395
  #
396
- # The `self` should be a sharable object
396
+ # The `self` should be a shareable object
397
397
  #
398
398
  # Ractor.shareable_proc(self: self){}
399
399
  # #=> self should be shareable: main (Ractor::IsolationError)
@@ -403,9 +403,9 @@ class Ractor
403
403
 
404
404
  # <!--
405
405
  # rdoc-file=ractor.rb
406
- # - Ractor.sharable_proc{} -> sharable proc
406
+ # - Ractor.shareable_proc{} -> shareable proc
407
407
  # -->
408
- # Same as Ractor.sharable_proc, but returns lambda proc.
408
+ # Same as Ractor.shareable_proc, but returns lambda proc.
409
409
  #
410
410
  def self.shareable_lambda: [T] () { (?) [self: nil] -> T } -> ^(?) [self: nil] -> T
411
411
  | [T, S] (self: S) { (?) [self: S] -> T } -> ^(?) [self: S] -> T
data/core/range.rbs CHANGED
@@ -351,7 +351,7 @@ class Range[out Elem] < Object
351
351
  # -->
352
352
  # Returns an element from `self` selected by a binary search.
353
353
  #
354
- # See [Binary Searching](rdoc-ref:bsearch.rdoc).
354
+ # See [Binary Searching](rdoc-ref:language/bsearch.rdoc).
355
355
  #
356
356
  def bsearch: () -> ::Enumerator[Elem, Elem?]
357
357
  | () { (Elem) -> (true | false) } -> Elem?
data/core/rational.rbs CHANGED
@@ -53,15 +53,16 @@ class Rational < Numeric
53
53
 
54
54
  # <!--
55
55
  # rdoc-file=rational.c
56
- # - rat * numeric -> numeric
56
+ # - self * other -> numeric
57
57
  # -->
58
- # Performs multiplication.
58
+ # Returns the numeric product of `self` and `other`:
59
59
  #
60
- # Rational(2, 3) * Rational(2, 3) #=> (4/9)
61
- # Rational(900) * Rational(1) #=> (900/1)
62
- # Rational(-2, 9) * Rational(-9, 2) #=> (1/1)
63
- # Rational(9, 8) * 4 #=> (9/2)
64
- # Rational(20, 9) * 9.8 #=> 21.77777777777778
60
+ # Rational(9, 8) * 4 #=> (9/2)
61
+ # Rational(20, 9) * 9.8 #=> 21.77777777777778
62
+ # Rational(9, 8) * Complex(1, 2) # => ((9/8)+(9/4)*i)
63
+ # Rational(2, 3) * Rational(2, 3) #=> (4/9)
64
+ # Rational(900) * Rational(1) #=> (900/1)
65
+ # Rational(-2, 9) * Rational(-9, 2) #=> (1/1)
65
66
  #
66
67
  def *: (Integer) -> Rational
67
68
  | (Rational) -> Rational
@@ -69,9 +70,9 @@ class Rational < Numeric
69
70
 
70
71
  # <!--
71
72
  # rdoc-file=rational.c
72
- # - rat ** numeric -> numeric
73
+ # - self ** exponent -> numeric
73
74
  # -->
74
- # Performs exponentiation.
75
+ # Returns `self` raised to the power `exponent`:
75
76
  #
76
77
  # Rational(2) ** Rational(3) #=> (8/1)
77
78
  # Rational(10) ** -2 #=> (1/100)
@@ -85,15 +86,25 @@ class Rational < Numeric
85
86
 
86
87
  # <!--
87
88
  # rdoc-file=rational.c
88
- # - rat + numeric -> numeric
89
+ # - self + other -> numeric
89
90
  # -->
90
- # Performs addition.
91
+ # Returns the sum of `self` and `other`:
91
92
  #
92
- # Rational(2, 3) + Rational(2, 3) #=> (4/3)
93
- # Rational(900) + Rational(1) #=> (901/1)
94
- # Rational(-2, 9) + Rational(-9, 2) #=> (-85/18)
95
- # Rational(9, 8) + 4 #=> (41/8)
96
- # Rational(20, 9) + 9.8 #=> 12.022222222222222
93
+ # Rational(2, 3) + 0 # => (2/3)
94
+ # Rational(2, 3) + 1 # => (5/3)
95
+ # Rational(2, 3) + -1 # => (-1/3)
96
+ #
97
+ # Rational(2, 3) + Complex(1, 0) # => ((5/3)+0i)
98
+ #
99
+ # Rational(2, 3) + Rational(1, 1) # => (5/3)
100
+ # Rational(2, 3) + Rational(3, 2) # => (13/6)
101
+ # Rational(2, 3) + Rational(3.0, 2.0) # => (13/6)
102
+ # Rational(2, 3) + Rational(3.1, 2.1) # => (30399297484750849/14186338826217063)
103
+ #
104
+ # For a computation involving Floats, the result may be inexact (see Float#+):
105
+ #
106
+ # Rational(2, 3) + 1.0 # => 1.6666666666666665
107
+ # Rational(2, 3) + Complex(1.0, 0.0) # => (1.6666666666666665+0.0i)
97
108
  #
98
109
  def +: (Float) -> Float
99
110
  | (Complex) -> Complex
@@ -103,9 +114,9 @@ class Rational < Numeric
103
114
 
104
115
  # <!--
105
116
  # rdoc-file=rational.c
106
- # - rat - numeric -> numeric
117
+ # - self - other -> numeric
107
118
  # -->
108
- # Performs subtraction.
119
+ # Returns the difference of `self` and `other`:
109
120
  #
110
121
  # Rational(2, 3) - Rational(2, 3) #=> (0/1)
111
122
  # Rational(900) - Rational(1) #=> (899/1)
@@ -119,18 +130,20 @@ class Rational < Numeric
119
130
 
120
131
  # <!--
121
132
  # rdoc-file=rational.c
122
- # - -rat -> rational
133
+ # - -self -> rational
123
134
  # -->
124
- # Negates `rat`.
135
+ # Returns `self`, negated:
136
+ #
137
+ # -(1/3r) # => (-1/3)
138
+ # -(-1/3r) # => (1/3)
125
139
  #
126
140
  def -@: () -> Rational
127
141
 
128
142
  # <!--
129
143
  # rdoc-file=rational.c
130
- # - rat / numeric -> numeric
131
- # - rat.quo(numeric) -> numeric
144
+ # - self / other -> numeric
132
145
  # -->
133
- # Performs division.
146
+ # Returns the quotient of `self` and `other`:
134
147
  #
135
148
  # Rational(2, 3) / Rational(2, 3) #=> (1/1)
136
149
  # Rational(900) / Rational(1) #=> (900/1)
@@ -364,7 +377,7 @@ class Rational < Numeric
364
377
  def positive?: () -> bool
365
378
 
366
379
  # <!-- rdoc-file=rational.c -->
367
- # Performs division.
380
+ # Returns the quotient of `self` and `other`:
368
381
  #
369
382
  # Rational(2, 3) / Rational(2, 3) #=> (1/1)
370
383
  # Rational(900) / Rational(1) #=> (900/1)
@@ -836,7 +836,7 @@ module RBS
836
836
  # Formats and writes `objects` to the stream.
837
837
  #
838
838
  # For details on `format_string`, see [Format
839
- # Specifications](rdoc-ref:format_specifications.rdoc).
839
+ # Specifications](rdoc-ref:language/format_specifications.rdoc).
840
840
  #
841
841
  %a{annotate:rdoc:copy:ARGF#printf}
842
842
  def printf: (String format_string, *untyped args) -> nil
data/core/regexp.rbs CHANGED
@@ -39,7 +39,7 @@
39
39
  # most such methods accept an argument that may be either a string or the
40
40
  # (much more powerful) regexp.
41
41
  #
42
- # See [Regexp Methods](rdoc-ref:regexp/methods.rdoc).
42
+ # See [Regexp Methods](rdoc-ref:language/regexp/methods.rdoc).
43
43
  #
44
44
  # ## Regexp Objects
45
45
  #
@@ -821,8 +821,8 @@
821
821
  # /\P{Alpha}/.match('1') # => #<MatchData "1">
822
822
  # /\P{Alpha}/.match('a') # => nil
823
823
  #
824
- # See [Unicode Properties](rdoc-ref:regexp/unicode_properties.rdoc) for regexps
825
- # based on the numerous properties.
824
+ # See [Unicode Properties](rdoc-ref:language/regexp/unicode_properties.rdoc) for
825
+ # regexps based on the numerous properties.
826
826
  #
827
827
  # Some commonly-used properties correspond to POSIX bracket expressions:
828
828
  #
data/core/ruby.rbs ADDED
@@ -0,0 +1,53 @@
1
+ # <!-- rdoc-file=version.c -->
2
+ # The [Ruby](rdoc-ref:Ruby) module that contains portable information among
3
+ # implementations.
4
+ #
5
+ # The constants defined here are aliased in the toplevel with `RUBY_` prefix.
6
+ #
7
+ module Ruby
8
+ # <!-- rdoc-file=version.c -->
9
+ # The copyright string for ruby
10
+ #
11
+ COPYRIGHT: ::String
12
+
13
+ # <!-- rdoc-file=version.c -->
14
+ # The full ruby version string, like `ruby -v` prints
15
+ #
16
+ DESCRIPTION: ::String
17
+
18
+ # <!-- rdoc-file=version.c -->
19
+ # The engine or interpreter this ruby uses.
20
+ #
21
+ ENGINE: ::String
22
+
23
+ # <!-- rdoc-file=version.c -->
24
+ # The version of the engine or interpreter this ruby uses.
25
+ #
26
+ ENGINE_VERSION: ::String
27
+
28
+ # <!-- rdoc-file=version.c -->
29
+ # The patchlevel for this ruby. If this is a development build of ruby the
30
+ # patchlevel will be -1
31
+ #
32
+ PATCHLEVEL: ::Integer
33
+
34
+ # <!-- rdoc-file=version.c -->
35
+ # The platform for this ruby
36
+ #
37
+ PLATFORM: ::String
38
+
39
+ # <!-- rdoc-file=version.c -->
40
+ # The date this ruby was released
41
+ #
42
+ RELEASE_DATE: ::String
43
+
44
+ # <!-- rdoc-file=version.c -->
45
+ # The GIT commit hash for this ruby.
46
+ #
47
+ REVISION: ::String
48
+
49
+ # <!-- rdoc-file=version.c -->
50
+ # The running version of ruby
51
+ #
52
+ VERSION: ::String
53
+ end
@@ -180,7 +180,6 @@ module Gem
180
180
  #
181
181
  # ver1 = Version.create('1.3.17') # -> (Version object)
182
182
  # ver2 = Version.create(ver1) # -> (ver1)
183
- # ver3 = Version.create(nil) # -> nil
184
183
  #
185
184
  def self.create: (_ToS | Version input) -> instance
186
185
  | (nil input) -> nil
@@ -199,8 +198,8 @@ module Gem
199
198
  # - <=>(other)
200
199
  # -->
201
200
  # Compares this version with `other` returning -1, 0, or 1 if the other version
202
- # is larger, the same, or smaller than this one. Attempts to compare to
203
- # something that's not a `Gem::Version` or a valid version String return `nil`.
201
+ # is larger, the same, or smaller than this one. `other` must be an instance of
202
+ # Gem::Version, comparing with other types may raise an exception.
204
203
  #
205
204
  def <=>: (untyped other) -> Integer?
206
205