rbs 3.9.5 → 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 (189) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +74 -0
  3. data/.clangd +2 -0
  4. data/.github/workflows/c-check.yml +54 -0
  5. data/.github/workflows/comments.yml +3 -3
  6. data/.github/workflows/ruby.yml +34 -19
  7. data/.github/workflows/typecheck.yml +1 -1
  8. data/.github/workflows/windows.yml +1 -1
  9. data/.gitignore +4 -0
  10. data/CHANGELOG.md +49 -0
  11. data/README.md +38 -1
  12. data/Rakefile +152 -23
  13. data/config.yml +190 -62
  14. data/core/array.rbs +100 -46
  15. data/core/complex.rbs +32 -21
  16. data/core/dir.rbs +2 -2
  17. data/core/encoding.rbs +6 -9
  18. data/core/enumerable.rbs +90 -3
  19. data/core/enumerator.rbs +18 -1
  20. data/core/errno.rbs +8 -0
  21. data/core/errors.rbs +28 -1
  22. data/core/exception.rbs +2 -2
  23. data/core/fiber.rbs +5 -4
  24. data/core/file.rbs +27 -12
  25. data/core/file_test.rbs +1 -1
  26. data/core/float.rbs +209 -22
  27. data/core/gc.rbs +417 -281
  28. data/core/hash.rbs +1024 -727
  29. data/core/integer.rbs +78 -38
  30. data/core/io/buffer.rbs +18 -7
  31. data/core/io/wait.rbs +11 -33
  32. data/core/io.rbs +14 -12
  33. data/core/kernel.rbs +57 -51
  34. data/core/marshal.rbs +1 -1
  35. data/core/match_data.rbs +1 -1
  36. data/core/math.rbs +42 -3
  37. data/core/method.rbs +14 -6
  38. data/core/module.rbs +88 -17
  39. data/core/nil_class.rbs +3 -3
  40. data/core/numeric.rbs +16 -16
  41. data/core/object.rbs +3 -3
  42. data/core/object_space.rbs +21 -15
  43. data/{stdlib/pathname/0 → core}/pathname.rbs +255 -355
  44. data/core/proc.rbs +15 -8
  45. data/core/process.rbs +2 -2
  46. data/core/ractor.rbs +278 -437
  47. data/core/range.rbs +7 -8
  48. data/core/rational.rbs +37 -24
  49. data/core/rbs/unnamed/argf.rbs +2 -2
  50. data/core/rbs/unnamed/env_class.rbs +1 -1
  51. data/core/rbs/unnamed/random.rbs +4 -2
  52. data/core/regexp.rbs +25 -20
  53. data/core/ruby.rbs +53 -0
  54. data/core/ruby_vm.rbs +6 -4
  55. data/core/rubygems/errors.rbs +3 -70
  56. data/core/rubygems/rubygems.rbs +11 -79
  57. data/core/rubygems/version.rbs +2 -3
  58. data/core/set.rbs +488 -359
  59. data/core/string.rbs +3145 -1231
  60. data/core/struct.rbs +1 -1
  61. data/core/symbol.rbs +4 -4
  62. data/core/thread.rbs +92 -29
  63. data/core/time.rbs +35 -9
  64. data/core/trace_point.rbs +7 -4
  65. data/core/unbound_method.rbs +14 -6
  66. data/docs/aliases.md +79 -0
  67. data/docs/collection.md +2 -2
  68. data/docs/encoding.md +56 -0
  69. data/docs/gem.md +0 -1
  70. data/docs/sigs.md +3 -3
  71. data/ext/rbs_extension/ast_translation.c +1016 -0
  72. data/ext/rbs_extension/ast_translation.h +37 -0
  73. data/ext/rbs_extension/class_constants.c +155 -0
  74. data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +7 -1
  75. data/ext/rbs_extension/compat.h +10 -0
  76. data/ext/rbs_extension/extconf.rb +25 -1
  77. data/ext/rbs_extension/legacy_location.c +317 -0
  78. data/ext/rbs_extension/legacy_location.h +45 -0
  79. data/ext/rbs_extension/main.c +357 -14
  80. data/ext/rbs_extension/rbs_extension.h +6 -21
  81. data/ext/rbs_extension/rbs_string_bridging.c +9 -0
  82. data/ext/rbs_extension/rbs_string_bridging.h +24 -0
  83. data/include/rbs/ast.h +687 -0
  84. data/include/rbs/defines.h +86 -0
  85. data/include/rbs/lexer.h +199 -0
  86. data/include/rbs/location.h +59 -0
  87. data/include/rbs/parser.h +135 -0
  88. data/include/rbs/string.h +47 -0
  89. data/include/rbs/util/rbs_allocator.h +59 -0
  90. data/include/rbs/util/rbs_assert.h +20 -0
  91. data/include/rbs/util/rbs_buffer.h +83 -0
  92. data/include/rbs/util/rbs_constant_pool.h +6 -67
  93. data/include/rbs/util/rbs_encoding.h +282 -0
  94. data/include/rbs/util/rbs_unescape.h +24 -0
  95. data/include/rbs.h +1 -2
  96. data/lib/rbs/annotate/formatter.rb +3 -13
  97. data/lib/rbs/annotate/rdoc_annotator.rb +3 -1
  98. data/lib/rbs/annotate/rdoc_source.rb +1 -1
  99. data/lib/rbs/cli/validate.rb +2 -2
  100. data/lib/rbs/cli.rb +1 -1
  101. data/lib/rbs/collection/config/lockfile_generator.rb +1 -0
  102. data/lib/rbs/definition_builder/ancestor_builder.rb +5 -5
  103. data/lib/rbs/environment.rb +64 -59
  104. data/lib/rbs/environment_loader.rb +1 -1
  105. data/lib/rbs/errors.rb +1 -1
  106. data/lib/rbs/parser_aux.rb +5 -0
  107. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  108. data/lib/rbs/resolver/type_name_resolver.rb +124 -38
  109. data/lib/rbs/test/type_check.rb +14 -0
  110. data/lib/rbs/types.rb +3 -1
  111. data/lib/rbs/version.rb +1 -1
  112. data/lib/rbs.rb +1 -1
  113. data/lib/rdoc/discover.rb +1 -1
  114. data/lib/rdoc_plugin/parser.rb +3 -3
  115. data/sig/annotate/formatter.rbs +2 -2
  116. data/sig/annotate/rdoc_annotater.rbs +1 -1
  117. data/sig/environment.rbs +57 -6
  118. data/sig/manifest.yaml +0 -1
  119. data/sig/parser.rbs +20 -0
  120. data/sig/resolver/type_name_resolver.rbs +38 -7
  121. data/sig/types.rbs +4 -1
  122. data/src/ast.c +1256 -0
  123. data/src/lexer.c +2956 -0
  124. data/src/lexer.re +147 -0
  125. data/src/lexstate.c +205 -0
  126. data/src/location.c +71 -0
  127. data/src/parser.c +3507 -0
  128. data/src/string.c +41 -0
  129. data/src/util/rbs_allocator.c +152 -0
  130. data/src/util/rbs_assert.c +19 -0
  131. data/src/util/rbs_buffer.c +54 -0
  132. data/src/util/rbs_constant_pool.c +18 -88
  133. data/src/util/rbs_encoding.c +21308 -0
  134. data/src/util/rbs_unescape.c +167 -0
  135. data/stdlib/bigdecimal/0/big_decimal.rbs +100 -82
  136. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  137. data/stdlib/cgi/0/core.rbs +2 -396
  138. data/stdlib/cgi/0/manifest.yaml +1 -0
  139. data/stdlib/cgi-escape/0/escape.rbs +153 -0
  140. data/stdlib/coverage/0/coverage.rbs +3 -1
  141. data/stdlib/date/0/date.rbs +67 -59
  142. data/stdlib/date/0/date_time.rbs +1 -1
  143. data/stdlib/delegate/0/delegator.rbs +10 -7
  144. data/stdlib/erb/0/erb.rbs +737 -347
  145. data/stdlib/fileutils/0/fileutils.rbs +18 -13
  146. data/stdlib/forwardable/0/forwardable.rbs +3 -0
  147. data/stdlib/json/0/json.rbs +68 -48
  148. data/stdlib/net-http/0/net-http.rbs +3 -0
  149. data/stdlib/objspace/0/objspace.rbs +9 -4
  150. data/stdlib/open-uri/0/open-uri.rbs +40 -0
  151. data/stdlib/openssl/0/openssl.rbs +331 -228
  152. data/stdlib/optparse/0/optparse.rbs +3 -3
  153. data/stdlib/psych/0/psych.rbs +3 -3
  154. data/stdlib/rdoc/0/code_object.rbs +2 -2
  155. data/stdlib/rdoc/0/comment.rbs +2 -0
  156. data/stdlib/rdoc/0/options.rbs +76 -0
  157. data/stdlib/rdoc/0/rdoc.rbs +7 -5
  158. data/stdlib/rdoc/0/store.rbs +1 -1
  159. data/stdlib/resolv/0/resolv.rbs +25 -68
  160. data/stdlib/ripper/0/ripper.rbs +5 -2
  161. data/stdlib/singleton/0/singleton.rbs +3 -0
  162. data/stdlib/socket/0/socket.rbs +13 -1
  163. data/stdlib/socket/0/tcp_socket.rbs +10 -2
  164. data/stdlib/stringio/0/stringio.rbs +1176 -85
  165. data/stdlib/strscan/0/string_scanner.rbs +31 -31
  166. data/stdlib/tempfile/0/tempfile.rbs +3 -3
  167. data/stdlib/time/0/time.rbs +1 -1
  168. data/stdlib/timeout/0/timeout.rbs +63 -7
  169. data/stdlib/tsort/0/cyclic.rbs +3 -0
  170. data/stdlib/uri/0/common.rbs +11 -2
  171. data/stdlib/uri/0/file.rbs +1 -1
  172. data/stdlib/uri/0/generic.rbs +17 -16
  173. data/stdlib/uri/0/rfc2396_parser.rbs +6 -7
  174. data/stdlib/zlib/0/zstream.rbs +1 -0
  175. metadata +43 -18
  176. data/ext/rbs_extension/lexer.c +0 -2728
  177. data/ext/rbs_extension/lexer.h +0 -179
  178. data/ext/rbs_extension/lexer.re +0 -147
  179. data/ext/rbs_extension/lexstate.c +0 -175
  180. data/ext/rbs_extension/location.c +0 -325
  181. data/ext/rbs_extension/location.h +0 -85
  182. data/ext/rbs_extension/parser.c +0 -2982
  183. data/ext/rbs_extension/parser.h +0 -18
  184. data/ext/rbs_extension/parserstate.c +0 -411
  185. data/ext/rbs_extension/parserstate.h +0 -163
  186. data/ext/rbs_extension/unescape.c +0 -32
  187. data/include/rbs/ruby_objs.h +0 -72
  188. data/src/constants.c +0 -153
  189. data/src/ruby_objs.c +0 -799
@@ -522,11 +522,13 @@ module FileUtils
522
522
  # symbolic links; other file types (FIFO streams, device files, etc.) are not
523
523
  # supported.
524
524
  #
525
- # Keyword arguments:
525
+ # Optional arguments:
526
526
  #
527
- # * `dereference_root: true` - if `src` is a symbolic link, follows the link.
528
- # * `preserve: true` - preserves file times.
529
- # * `remove_destination: true` - removes `dest` before copying files.
527
+ # * `dereference_root` - if `src` is a symbolic link, follows the link
528
+ # (`false` by default).
529
+ # * `preserve` - preserves file times (`false` by default).
530
+ # * `remove_destination` - removes `dest` before copying files (`false` by
531
+ # default).
530
532
  #
531
533
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
532
534
  #
@@ -547,12 +549,13 @@ module FileUtils
547
549
  # FileUtils.copy_file('src0.txt', 'dest0.txt')
548
550
  # File.file?('dest0.txt') # => true
549
551
  #
550
- # Keyword arguments:
552
+ # Optional arguments:
551
553
  #
552
- # * `dereference: false` - if `src` is a symbolic link, does not follow the
553
- # link.
554
- # * `preserve: true` - preserves file times.
555
- # * `remove_destination: true` - removes `dest` before copying files.
554
+ # * `dereference` - if `src` is a symbolic link, follows the link (`true` by
555
+ # default).
556
+ # * `preserve` - preserves file times (`false` by default).
557
+ # * `remove_destination` - removes `dest` before copying files (`false` by
558
+ # default).
556
559
  #
557
560
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
558
561
  #
@@ -963,13 +966,15 @@ module FileUtils
963
966
  # File.file?('dest1/dir1/t2.txt') # => true
964
967
  # File.file?('dest1/dir1/t3.txt') # => true
965
968
  #
966
- # Keyword arguments:
969
+ # Optional arguments:
967
970
  #
968
- # * `dereference_root: true` - dereferences `src` if it is a symbolic link.
969
- # * `remove_destination: true` - removes `dest` before creating links.
971
+ # * `dereference_root` - dereferences `src` if it is a symbolic link (`false`
972
+ # by default).
973
+ # * `remove_destination` - removes `dest` before creating links (`false` by
974
+ # default).
970
975
  #
971
976
  # Raises an exception if `dest` is the path to an existing file or directory and
972
- # keyword argument `remove_destination: true` is not given.
977
+ # optional argument `remove_destination` is not given.
973
978
  #
974
979
  # Related: FileUtils.ln (has different options).
975
980
  #
@@ -100,6 +100,9 @@ module Forwardable
100
100
  #
101
101
  VERSION: String
102
102
 
103
+ # <!-- rdoc-file=lib/forwardable.rb -->
104
+ # Version for backward compatibility
105
+ #
103
106
  FORWARDABLE_VERSION: String
104
107
 
105
108
  # <!--
@@ -14,9 +14,6 @@ end
14
14
  class JSON::GeneratorError < JSON::JSONError
15
15
  end
16
16
 
17
- class JSON::UnparserError < JSON::GeneratorError
18
- end
19
-
20
17
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
21
18
  # This exception is raised if a parser error occurs.
22
19
  #
@@ -202,6 +199,24 @@ end
202
199
  #
203
200
  # ---
204
201
  #
202
+ # Option `allow_duplicate_key` specifies whether duplicate keys in objects
203
+ # should be ignored or cause an error to be raised:
204
+ #
205
+ # When not specified:
206
+ # # The last value is used and a deprecation warning emitted.
207
+ # JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
208
+ # # warning: detected duplicate keys in JSON object.
209
+ # # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
210
+ #
211
+ # When set to ``true``
212
+ # # The last value is used.
213
+ # JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
214
+ #
215
+ # When set to ``false``, the future default:
216
+ # JSON.parse('{"a": 1, "a":2}') => duplicate key at line 1 column 1 (JSON::ParserError)
217
+ #
218
+ # ---
219
+ #
205
220
  # Option `allow_nan` (boolean) specifies whether to allow NaN, Infinity, and
206
221
  # MinusInfinity in `source`; defaults to `false`.
207
222
  #
@@ -218,8 +233,22 @@ end
218
233
  # ruby = JSON.parse(source, {allow_nan: true})
219
234
  # ruby # => [NaN, Infinity, -Infinity]
220
235
  #
236
+ # ---
237
+ #
238
+ # Option `allow_trailing_comma` (boolean) specifies whether to allow trailing
239
+ # commas in objects and arrays; defaults to `false`.
240
+ #
241
+ # With the default, `false`:
242
+ # JSON.parse('[1,]') # unexpected character: ']' at line 1 column 4 (JSON::ParserError)
243
+ #
244
+ # When enabled:
245
+ # JSON.parse('[1,]', allow_trailing_comma: true) # => [1]
246
+ #
221
247
  # ###### Output Options
222
248
  #
249
+ # Option `freeze` (boolean) specifies whether the returned objects will be
250
+ # frozen; defaults to `false`.
251
+ #
223
252
  # Option `symbolize_names` (boolean) specifies whether returned Hash keys should
224
253
  # be Symbols; defaults to `false` (use Strings).
225
254
  #
@@ -348,6 +377,25 @@ end
348
377
  #
349
378
  # ---
350
379
  #
380
+ # Option `allow_duplicate_key` (boolean) specifies whether hashes with duplicate
381
+ # keys should be allowed or produce an error. defaults to emit a deprecation
382
+ # warning.
383
+ #
384
+ # With the default, (not set):
385
+ # Warning[:deprecated] = true
386
+ # JSON.generate({ foo: 1, "foo" => 2 })
387
+ # # warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}.
388
+ # # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
389
+ # # => '{"foo":1,"foo":2}'
390
+ #
391
+ # With `false`
392
+ # JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false)
393
+ # # detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError)
394
+ #
395
+ # In version 3.0, `false` will become the default.
396
+ #
397
+ # ---
398
+ #
351
399
  # Option `max_nesting` (Integer) specifies the maximum nesting depth in `obj`;
352
400
  # defaults to `100`.
353
401
  #
@@ -423,6 +471,9 @@ end
423
471
  #
424
472
  # ## JSON Additions
425
473
  #
474
+ # Note that JSON Additions must only be used with trusted data, and is
475
+ # deprecated.
476
+ #
426
477
  # When you "round trip" a non-String object from Ruby to JSON and back, you have
427
478
  # a new String, instead of the object you began with:
428
479
  # ruby0 = Range.new(0, 2)
@@ -711,8 +762,6 @@ module JSON
711
762
  #
712
763
  def self.create_id=: (_ToS create_id) -> _ToS
713
764
 
714
- def self.deep_const_get: (interned path) -> untyped
715
-
716
765
  # <!--
717
766
  # rdoc-file=ext/json/lib/json/common.rb
718
767
  # - JSON.dump(obj, io = nil, limit = nil)
@@ -754,6 +803,7 @@ module JSON
754
803
  # opts = JSON.dump_default_options
755
804
  # opts # => {:max_nesting=>false, :allow_nan=>true}
756
805
  #
806
+ %a{deprecated}
757
807
  def self.dump_default_options: () -> options
758
808
 
759
809
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
@@ -761,6 +811,7 @@ module JSON
761
811
  # opts = JSON.dump_default_options
762
812
  # opts # => {:max_nesting=>false, :allow_nan=>true}
763
813
  #
814
+ %a{deprecated}
764
815
  def self.dump_default_options=: (options) -> options
765
816
 
766
817
  # <!--
@@ -778,19 +829,16 @@ module JSON
778
829
  # # Raises SystemStackError (stack level too deep):
779
830
  # JSON.fast_generate(a)
780
831
  #
832
+ %a{deprecated}
781
833
  def self?.fast_generate: (_ToJson obj, ?options opts) -> String
782
834
 
783
- alias self.fast_unparse self.fast_generate
784
-
785
- alias fast_unparse fast_generate
786
-
787
835
  # <!--
788
836
  # rdoc-file=ext/json/lib/json/common.rb
789
837
  # - JSON.generate(obj, opts = nil) -> new_string
790
838
  # -->
791
839
  # Returns a String containing the generated JSON data.
792
840
  #
793
- # See also JSON.fast_generate, JSON.pretty_generate.
841
+ # See also JSON.pretty_generate.
794
842
  #
795
843
  # Argument `obj` is the Ruby object to be converted to JSON.
796
844
  #
@@ -832,14 +880,7 @@ module JSON
832
880
 
833
881
  # <!--
834
882
  # rdoc-file=ext/json/lib/json/common.rb
835
- # - iconv(to, from, string)
836
- # -->
837
- # Encodes string using String.encode.
838
- #
839
- def self.iconv: (encoding to, encoding from, String string) -> String
840
-
841
- # <!--
842
- # rdoc-file=ext/json/lib/json/common.rb
883
+ # - JSON.load(source, options = {}) -> object
843
884
  # - JSON.load(source, proc = nil, options = {}) -> object
844
885
  # -->
845
886
  # Returns the Ruby objects created by parsing the given `source`.
@@ -952,6 +993,7 @@ module JSON
952
993
  # when Array
953
994
  # obj.map! {|v| deserialize_obj v }
954
995
  # end
996
+ # obj
955
997
  # })
956
998
  # pp ruby
957
999
  #
@@ -974,7 +1016,8 @@ module JSON
974
1016
  # #<Admin:0x00000000064c41f8
975
1017
  # @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
976
1018
  #
977
- def self?.load: (string | _ReadableIO | _Read source, ?Proc proc, ?options options) -> untyped
1019
+ def self?.load: (string | _ReadableIO | _Read source, ?options options) -> untyped
1020
+ | [T] (string | _ReadableIO | _Read source, ^(?) -> T, ?options options) -> T
978
1021
 
979
1022
  # <!--
980
1023
  # rdoc-file=ext/json/lib/json/common.rb
@@ -1003,6 +1046,7 @@ module JSON
1003
1046
  # opts = JSON.load_default_options
1004
1047
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1005
1048
  #
1049
+ %a{deprecated}
1006
1050
  def self.load_default_options: () -> options
1007
1051
 
1008
1052
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
@@ -1010,6 +1054,7 @@ module JSON
1010
1054
  # opts = JSON.load_default_options
1011
1055
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1012
1056
  #
1057
+ %a{deprecated}
1013
1058
  def self.load_default_options=: (options) -> options
1014
1059
 
1015
1060
  # <!--
@@ -1120,29 +1165,6 @@ module JSON
1120
1165
  #
1121
1166
  def self?.pretty_generate: (_ToJson obj, ?options opts) -> untyped
1122
1167
 
1123
- alias self.pretty_unparse self.pretty_generate
1124
-
1125
- alias pretty_unparse pretty_generate
1126
-
1127
- # Recursively calls passed *Proc* if the parsed data structure is an *Array* or
1128
- # *Hash*
1129
- #
1130
- def self?.recurse_proc: (untyped result) { (*untyped) -> void } -> void
1131
-
1132
- # <!--
1133
- # rdoc-file=ext/json/lib/json/common.rb
1134
- # - restore(source, proc = nil, options = nil)
1135
- # -->
1136
- #
1137
- alias self.restore self.load
1138
-
1139
- # <!--
1140
- # rdoc-file=ext/json/lib/json/common.rb
1141
- # - restore(source, proc = nil, options = nil)
1142
- # -->
1143
- #
1144
- alias restore load
1145
-
1146
1168
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
1147
1169
  # Sets or Returns the JSON generator state class that is used by JSON.
1148
1170
  #
@@ -1152,10 +1174,6 @@ module JSON
1152
1174
  # Sets or Returns the JSON generator state class that is used by JSON.
1153
1175
  #
1154
1176
  def self.state=: (state) -> state
1155
-
1156
- alias self.unparse self.generate
1157
-
1158
- alias unparse generate
1159
1177
  end
1160
1178
 
1161
1179
  JSON::FAST_STATE_PROTOTYPE: JSON::state
@@ -1193,6 +1211,7 @@ module Kernel
1193
1211
  # Outputs *objs* to STDOUT as JSON strings in the shortest form, that is in one
1194
1212
  # line.
1195
1213
  #
1214
+ %a{deprecated}
1196
1215
  def j: (*_ToJson) -> nil
1197
1216
 
1198
1217
  # <!--
@@ -1202,11 +1221,12 @@ module Kernel
1202
1221
  # Outputs *objs* to STDOUT as JSON strings in a pretty format, with indentation
1203
1222
  # and over many lines.
1204
1223
  #
1224
+ %a{deprecated}
1205
1225
  def jj: (*_ToJson) -> nil
1206
1226
 
1207
1227
  # <!--
1208
1228
  # rdoc-file=ext/json/lib/json/common.rb
1209
- # - JSON(object, *args)
1229
+ # - JSON(object, opts = nil)
1210
1230
  # -->
1211
1231
  # If *object* is string-like, parse the string and return the parsed result as a
1212
1232
  # Ruby data structure. Otherwise, generate a JSON text from the Ruby data
@@ -1854,7 +1874,7 @@ class Symbol
1854
1874
 
1855
1875
  # <!--
1856
1876
  # rdoc-file=ext/json/lib/json/add/symbol.rb
1857
- # - to_json(*a)
1877
+ # - to_json(state = nil, *a)
1858
1878
  # -->
1859
1879
  # Returns a JSON string representing `self`:
1860
1880
  #
@@ -4047,6 +4047,9 @@ module Net
4047
4047
  alias entity body
4048
4048
  end
4049
4049
 
4050
+ # <!-- rdoc-file=lib/net/http/responses.rb -->
4051
+ # Unknown HTTP response
4052
+ #
4050
4053
  class HTTPUnknownResponse < HTTPResponse
4051
4054
  HAS_BODY: bool
4052
4055
 
@@ -332,9 +332,11 @@ module ObjectSpace
332
332
  # information as only a **HINT**. Especially, the size of `T_DATA` may not be
333
333
  # correct.
334
334
  #
335
- # This method is only expected to work with C Ruby.
335
+ # This method is only expected to work with CRuby.
336
336
  #
337
- # From Ruby 2.2, memsize_of(obj) returns a memory size includes sizeof(RVALUE).
337
+ # From Ruby 3.2 with Variable Width Allocation, it returns the actual slot size
338
+ # used plus any additional memory allocated outside the slot (such as external
339
+ # strings, arrays, or hash tables).
338
340
  #
339
341
  def self?.memsize_of: (untyped) -> Integer
340
342
 
@@ -409,7 +411,7 @@ module ObjectSpace
409
411
  # ObjectSpace.reachable_objects_from(1)
410
412
  # #=> nil # 1 is not markable (heap managed) object
411
413
  #
412
- def self?.reachable_objects_from: (untyped) -> ([ untyped ] | nil)
414
+ def self?.reachable_objects_from: (untyped) -> (Array[untyped] | nil)
413
415
 
414
416
  # <!--
415
417
  # rdoc-file=ext/objspace/objspace.c
@@ -461,8 +463,11 @@ module ObjectSpace
461
463
 
462
464
  # <!--
463
465
  # rdoc-file=ext/objspace/object_tracing.c
464
- # - trace_object_allocations_debug_start()
466
+ # - trace_object_allocations_debug_start
465
467
  # -->
468
+ # Starts tracing object allocations for GC debugging. If you encounter the BUG
469
+ # "... is T_NONE" (and so on) on your application, please try this method at the
470
+ # beginning of your app.
466
471
  #
467
472
  def self?.trace_object_allocations_debug_start: () -> void
468
473
 
@@ -83,6 +83,46 @@ end
83
83
  # : Tanaka Akira <akr@m17n.org>
84
84
  #
85
85
  module OpenURI
86
+ # <!-- rdoc-file=lib/open-uri.rb -->
87
+ # Raised on HTTP session failure
88
+ #
89
+ class HTTPError < StandardError
90
+ # <!--
91
+ # rdoc-file=lib/open-uri.rb
92
+ # - new(message, io)
93
+ # -->
94
+ #
95
+ def initialize: (String message, (StringIO & OpenURI::Meta) io) -> void
96
+
97
+ # <!-- rdoc-file=lib/open-uri.rb -->
98
+ # StringIO having the received data
99
+ #
100
+ attr_reader io: StringIO & OpenURI::Meta
101
+ end
102
+
103
+ # <!-- rdoc-file=lib/open-uri.rb -->
104
+ # Raised on redirection, only occurs when `redirect` option for HTTP is `false`.
105
+ #
106
+ class HTTPRedirect < HTTPError
107
+ # <!--
108
+ # rdoc-file=lib/open-uri.rb
109
+ # - new(message, io, uri)
110
+ # -->
111
+ #
112
+ def initialize: (String message, (StringIO & OpenURI::Meta) io, URI uri) -> void
113
+
114
+ # <!-- rdoc-file=lib/open-uri.rb -->
115
+ # URI to redirect
116
+ #
117
+ attr_reader uri: URI
118
+ end
119
+
120
+ # <!-- rdoc-file=lib/open-uri.rb -->
121
+ # Raised on too many redirection,
122
+ #
123
+ class TooManyRedirects < HTTPError
124
+ end
125
+
86
126
  # <!-- rdoc-file=lib/open-uri.rb -->
87
127
  # Mixin for holding meta-information.
88
128
  #