rbs 3.10.4 → 4.0.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 (267) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +14 -14
  3. data/.github/workflows/bundle-update.yml +60 -0
  4. data/.github/workflows/c-check.yml +7 -5
  5. data/.github/workflows/comments.yml +2 -2
  6. data/.github/workflows/dependabot.yml +2 -2
  7. data/.github/workflows/ruby.yml +16 -26
  8. data/.github/workflows/rust.yml +95 -0
  9. data/.github/workflows/typecheck.yml +1 -1
  10. data/.github/workflows/windows.yml +2 -2
  11. data/.rubocop.yml +2 -2
  12. data/.vscode/extensions.json +5 -0
  13. data/.vscode/settings.json +19 -0
  14. data/CHANGELOG.md +202 -2
  15. data/Rakefile +9 -23
  16. data/Steepfile +2 -0
  17. data/config.yml +457 -13
  18. data/core/array.rbs +218 -188
  19. data/core/basic_object.rbs +9 -8
  20. data/core/binding.rbs +0 -2
  21. data/core/builtin.rbs +2 -2
  22. data/core/class.rbs +6 -5
  23. data/core/comparable.rbs +45 -31
  24. data/core/complex.rbs +66 -55
  25. data/core/dir.rbs +57 -45
  26. data/core/encoding.rbs +6 -6
  27. data/core/enumerable.rbs +105 -91
  28. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  29. data/core/enumerator.rbs +24 -3
  30. data/core/errno.rbs +3 -2
  31. data/core/errors.rbs +31 -29
  32. data/core/exception.rbs +12 -12
  33. data/core/fiber.rbs +47 -36
  34. data/core/file.rbs +242 -169
  35. data/core/file_test.rbs +2 -2
  36. data/core/float.rbs +42 -68
  37. data/core/gc.rbs +78 -70
  38. data/core/hash.rbs +70 -60
  39. data/core/integer.rbs +32 -75
  40. data/core/io/buffer.rbs +36 -36
  41. data/core/io/wait.rbs +7 -7
  42. data/core/io.rbs +192 -146
  43. data/core/kernel.rbs +198 -147
  44. data/core/marshal.rbs +3 -3
  45. data/core/match_data.rbs +14 -12
  46. data/core/math.rbs +69 -67
  47. data/core/method.rbs +6 -8
  48. data/core/module.rbs +148 -88
  49. data/core/nil_class.rbs +4 -3
  50. data/core/numeric.rbs +53 -50
  51. data/core/object.rbs +6 -8
  52. data/core/object_space.rbs +11 -10
  53. data/core/pathname.rbs +131 -81
  54. data/core/proc.rbs +65 -34
  55. data/core/process.rbs +221 -201
  56. data/core/ractor.rbs +15 -11
  57. data/core/random.rbs +21 -3
  58. data/core/range.rbs +152 -49
  59. data/core/rational.rbs +5 -56
  60. data/core/rbs/unnamed/argf.rbs +58 -51
  61. data/core/rbs/unnamed/env_class.rbs +18 -13
  62. data/core/rbs/unnamed/main_class.rbs +123 -0
  63. data/core/rbs/unnamed/random.rbs +7 -116
  64. data/core/regexp.rbs +236 -197
  65. data/core/ruby.rbs +1 -1
  66. data/core/ruby_vm.rbs +32 -30
  67. data/core/rubygems/config_file.rbs +5 -5
  68. data/core/rubygems/errors.rbs +1 -1
  69. data/core/rubygems/requirement.rbs +5 -5
  70. data/core/rubygems/rubygems.rbs +5 -3
  71. data/core/set.rbs +17 -16
  72. data/core/signal.rbs +2 -2
  73. data/core/string.rbs +318 -298
  74. data/core/struct.rbs +26 -25
  75. data/core/symbol.rbs +25 -24
  76. data/core/thread.rbs +40 -41
  77. data/core/time.rbs +47 -42
  78. data/core/trace_point.rbs +34 -31
  79. data/core/true_class.rbs +2 -2
  80. data/core/unbound_method.rbs +10 -10
  81. data/core/warning.rbs +7 -7
  82. data/docs/collection.md +1 -1
  83. data/docs/config.md +171 -0
  84. data/docs/inline.md +576 -0
  85. data/docs/syntax.md +46 -16
  86. data/docs/type_fingerprint.md +21 -0
  87. data/exe/rbs +1 -1
  88. data/ext/rbs_extension/ast_translation.c +595 -98
  89. data/ext/rbs_extension/class_constants.c +30 -0
  90. data/ext/rbs_extension/class_constants.h +15 -0
  91. data/ext/rbs_extension/legacy_location.c +30 -53
  92. data/ext/rbs_extension/legacy_location.h +37 -0
  93. data/ext/rbs_extension/main.c +125 -24
  94. data/include/rbs/ast.h +485 -150
  95. data/include/rbs/lexer.h +11 -4
  96. data/include/rbs/location.h +25 -44
  97. data/include/rbs/parser.h +20 -2
  98. data/include/rbs/util/rbs_constant_pool.h +0 -3
  99. data/include/rbs.h +8 -0
  100. data/lib/rbs/ast/annotation.rb +1 -1
  101. data/lib/rbs/ast/comment.rb +1 -1
  102. data/lib/rbs/ast/declarations.rb +10 -10
  103. data/lib/rbs/ast/members.rb +14 -14
  104. data/lib/rbs/ast/ruby/annotations.rb +409 -0
  105. data/lib/rbs/ast/ruby/comment_block.rb +245 -0
  106. data/lib/rbs/ast/ruby/declarations.rb +281 -0
  107. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
  108. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  109. data/lib/rbs/ast/ruby/members.rb +723 -0
  110. data/lib/rbs/ast/type_param.rb +24 -4
  111. data/lib/rbs/buffer.rb +105 -20
  112. data/lib/rbs/cli/diff.rb +16 -15
  113. data/lib/rbs/cli/validate.rb +62 -125
  114. data/lib/rbs/cli.rb +55 -23
  115. data/lib/rbs/collection/config/lockfile_generator.rb +8 -4
  116. data/lib/rbs/collection/sources/git.rb +1 -0
  117. data/lib/rbs/collection.rb +0 -1
  118. data/lib/rbs/definition.rb +6 -1
  119. data/lib/rbs/definition_builder/ancestor_builder.rb +119 -63
  120. data/lib/rbs/definition_builder/method_builder.rb +65 -30
  121. data/lib/rbs/definition_builder.rb +177 -20
  122. data/lib/rbs/diff.rb +7 -1
  123. data/lib/rbs/environment/class_entry.rb +69 -0
  124. data/lib/rbs/environment/module_entry.rb +66 -0
  125. data/lib/rbs/environment.rb +338 -155
  126. data/lib/rbs/environment_loader.rb +2 -2
  127. data/lib/rbs/errors.rb +30 -20
  128. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  129. data/lib/rbs/inline_parser.rb +542 -0
  130. data/lib/rbs/location_aux.rb +36 -4
  131. data/lib/rbs/locator.rb +5 -1
  132. data/lib/rbs/method_type.rb +5 -3
  133. data/lib/rbs/namespace.rb +0 -7
  134. data/lib/rbs/parser_aux.rb +31 -8
  135. data/lib/rbs/prototype/helpers.rb +57 -0
  136. data/lib/rbs/prototype/rb.rb +3 -28
  137. data/lib/rbs/prototype/rbi.rb +3 -20
  138. data/lib/rbs/prototype/runtime.rb +10 -2
  139. data/lib/rbs/resolver/type_name_resolver.rb +0 -8
  140. data/lib/rbs/source.rb +99 -0
  141. data/lib/rbs/subtractor.rb +4 -3
  142. data/lib/rbs/test/type_check.rb +5 -2
  143. data/lib/rbs/type_name.rb +1 -8
  144. data/lib/rbs/types.rb +88 -78
  145. data/lib/rbs/unit_test/convertibles.rb +1 -0
  146. data/lib/rbs/unit_test/type_assertions.rb +35 -8
  147. data/lib/rbs/validator.rb +2 -2
  148. data/lib/rbs/version.rb +1 -1
  149. data/lib/rbs.rb +12 -1
  150. data/rbs.gemspec +3 -2
  151. data/rust/.gitignore +1 -0
  152. data/rust/Cargo.lock +378 -0
  153. data/rust/Cargo.toml +7 -0
  154. data/rust/ruby-rbs/Cargo.toml +22 -0
  155. data/rust/ruby-rbs/build.rs +764 -0
  156. data/rust/ruby-rbs/examples/locations.rs +60 -0
  157. data/rust/ruby-rbs/src/lib.rs +1 -0
  158. data/rust/ruby-rbs/src/node/mod.rs +742 -0
  159. data/rust/ruby-rbs/tests/sanity.rs +47 -0
  160. data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
  161. data/rust/ruby-rbs-sys/Cargo.toml +23 -0
  162. data/rust/ruby-rbs-sys/build.rs +204 -0
  163. data/rust/ruby-rbs-sys/src/lib.rs +50 -0
  164. data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
  165. data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
  166. data/rust/ruby-rbs-sys/wrapper.h +1 -0
  167. data/schema/typeParam.json +17 -1
  168. data/sig/ancestor_builder.rbs +1 -1
  169. data/sig/ast/ruby/annotations.rbs +421 -0
  170. data/sig/ast/ruby/comment_block.rbs +127 -0
  171. data/sig/ast/ruby/declarations.rbs +158 -0
  172. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  173. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  174. data/sig/ast/ruby/members.rbs +178 -0
  175. data/sig/buffer.rbs +63 -5
  176. data/sig/cli/diff.rbs +5 -11
  177. data/sig/cli/validate.rbs +12 -8
  178. data/sig/cli.rbs +18 -18
  179. data/sig/definition.rbs +6 -0
  180. data/sig/definition_builder.rbs +3 -1
  181. data/sig/environment/class_entry.rbs +50 -0
  182. data/sig/environment/module_entry.rbs +50 -0
  183. data/sig/environment.rbs +37 -81
  184. data/sig/errors.rbs +26 -20
  185. data/sig/inline_parser/comment_association.rbs +71 -0
  186. data/sig/inline_parser.rbs +124 -0
  187. data/sig/location.rbs +32 -7
  188. data/sig/locator.rbs +0 -2
  189. data/sig/method_builder.rbs +9 -4
  190. data/sig/namespace.rbs +0 -5
  191. data/sig/parser.rbs +47 -13
  192. data/sig/prototype/helpers.rbs +2 -0
  193. data/sig/resolver/type_name_resolver.rbs +0 -3
  194. data/sig/source.rbs +48 -0
  195. data/sig/type_param.rbs +13 -8
  196. data/sig/typename.rbs +0 -5
  197. data/sig/types.rbs +6 -7
  198. data/sig/unit_test/spy.rbs +0 -8
  199. data/sig/unit_test/type_assertions.rbs +11 -0
  200. data/src/ast.c +491 -143
  201. data/src/lexer.c +1552 -1314
  202. data/src/lexer.re +7 -0
  203. data/src/lexstate.c +8 -1
  204. data/src/location.c +8 -48
  205. data/src/parser.c +1107 -409
  206. data/src/util/rbs_constant_pool.c +0 -4
  207. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
  208. data/stdlib/cgi-escape/0/escape.rbs +4 -4
  209. data/stdlib/coverage/0/coverage.rbs +4 -3
  210. data/stdlib/date/0/date.rbs +33 -28
  211. data/stdlib/date/0/date_time.rbs +24 -23
  212. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  213. data/stdlib/digest/0/digest.rbs +110 -0
  214. data/stdlib/erb/0/erb.rbs +64 -53
  215. data/stdlib/etc/0/etc.rbs +55 -50
  216. data/stdlib/fileutils/0/fileutils.rbs +140 -126
  217. data/stdlib/forwardable/0/forwardable.rbs +10 -10
  218. data/stdlib/io-console/0/io-console.rbs +2 -2
  219. data/stdlib/json/0/json.rbs +158 -131
  220. data/stdlib/monitor/0/monitor.rbs +3 -3
  221. data/stdlib/net-http/0/net-http.rbs +159 -134
  222. data/stdlib/objspace/0/objspace.rbs +8 -30
  223. data/stdlib/open-uri/0/open-uri.rbs +8 -8
  224. data/stdlib/open3/0/open3.rbs +469 -10
  225. data/stdlib/openssl/0/openssl.rbs +144 -129
  226. data/stdlib/optparse/0/optparse.rbs +23 -14
  227. data/stdlib/pathname/0/pathname.rbs +2 -2
  228. data/stdlib/pp/0/pp.rbs +9 -8
  229. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  230. data/stdlib/pstore/0/pstore.rbs +35 -30
  231. data/stdlib/psych/0/psych.rbs +62 -9
  232. data/stdlib/psych/0/store.rbs +2 -4
  233. data/stdlib/pty/0/pty.rbs +9 -6
  234. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  235. data/stdlib/rdoc/0/code_object.rbs +2 -1
  236. data/stdlib/rdoc/0/parser.rbs +1 -1
  237. data/stdlib/rdoc/0/store.rbs +1 -1
  238. data/stdlib/ripper/0/ripper.rbs +20 -17
  239. data/stdlib/securerandom/0/manifest.yaml +2 -0
  240. data/stdlib/securerandom/0/securerandom.rbs +7 -20
  241. data/stdlib/shellwords/0/shellwords.rbs +2 -2
  242. data/stdlib/socket/0/addrinfo.rbs +9 -9
  243. data/stdlib/socket/0/basic_socket.rbs +3 -3
  244. data/stdlib/socket/0/ip_socket.rbs +10 -8
  245. data/stdlib/socket/0/socket.rbs +10 -9
  246. data/stdlib/socket/0/tcp_server.rbs +1 -1
  247. data/stdlib/socket/0/tcp_socket.rbs +1 -1
  248. data/stdlib/socket/0/udp_socket.rbs +1 -1
  249. data/stdlib/socket/0/unix_server.rbs +1 -1
  250. data/stdlib/stringio/0/stringio.rbs +55 -54
  251. data/stdlib/strscan/0/string_scanner.rbs +46 -44
  252. data/stdlib/tempfile/0/tempfile.rbs +24 -20
  253. data/stdlib/time/0/time.rbs +7 -5
  254. data/stdlib/tsort/0/tsort.rbs +7 -6
  255. data/stdlib/uri/0/common.rbs +31 -18
  256. data/stdlib/uri/0/file.rbs +2 -2
  257. data/stdlib/uri/0/generic.rbs +9 -2
  258. data/stdlib/uri/0/http.rbs +2 -2
  259. data/stdlib/uri/0/ldap.rbs +2 -2
  260. data/stdlib/uri/0/mailto.rbs +3 -3
  261. data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
  262. data/stdlib/zlib/0/deflate.rbs +4 -3
  263. data/stdlib/zlib/0/gzip_reader.rbs +6 -6
  264. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  265. data/stdlib/zlib/0/inflate.rbs +1 -1
  266. data/stdlib/zlib/0/need_dict.rbs +1 -1
  267. metadata +66 -3
data/core/kernel.rbs CHANGED
@@ -73,15 +73,18 @@
73
73
  # ### IO
74
74
  #
75
75
  # * ::pp: Prints the given objects in pretty form.
76
- # * #gets: Returns and assigns to `$_` the next line from the current input.
76
+ # * #gets: Returns and assigns to <code>$_</code> the next line from the
77
+ # current input.
77
78
  # * #open: Creates an IO object connected to the given stream, file, or
78
79
  # subprocess.
79
80
  # * #p: Prints the given objects' inspect output to the standard output.
80
81
  # * #print: Prints the given objects to standard output without a newline.
81
82
  # * #printf: Prints the string resulting from applying the given format string
82
83
  # to any additional arguments.
83
- # * #putc: Equivalent to `$stdout.putc(object)` for the given object.
84
- # * #puts: Equivalent to `$stdout.puts(*objects)` for the given objects.
84
+ # * #putc: Equivalent to <code>$stdout.putc(object)</code> for the given
85
+ # object.
86
+ # * #puts: Equivalent to <code>$stdout.puts(*objects)</code> for the given
87
+ # objects.
85
88
  # * #readline: Similar to #gets, but raises an exception at the end of file.
86
89
  # * #readlines: Returns an array of the remaining lines from the current
87
90
  # input.
@@ -102,7 +105,7 @@
102
105
  #
103
106
  # ### Subprocesses
104
107
  #
105
- # * [\`command`](rdoc-ref:Kernel#`): Returns the standard output of running
108
+ # * [`command`](rdoc-ref:Kernel#`): Returns the standard output of running
106
109
  # `command` in a subshell.
107
110
  # * #exec: Replaces current process with a new process.
108
111
  # * #fork: Forks the current process into two processes.
@@ -150,7 +153,7 @@ module Kernel : BasicObject
150
153
  # - caller(range) -> array or nil
151
154
  # -->
152
155
  # Returns the current execution stack---an array containing strings in the form
153
- # `file:line` or `file:line: in `method'`.
156
+ # <code>file:line</code> or <code>file:line: in `method'</code>.
154
157
  #
155
158
  # The optional *start* parameter determines the number of initial stack entries
156
159
  # to omit from the top of the stack.
@@ -204,8 +207,9 @@ module Kernel : BasicObject
204
207
  # Optionally you can pass a range, which will return an array containing the
205
208
  # entries within the specified range.
206
209
  #
207
- def self?.caller_locations: (?Integer start_or_range, ?Integer length) -> ::Array[Thread::Backtrace::Location]?
208
- | (?::Range[Integer] start_or_range) -> ::Array[Thread::Backtrace::Location]?
210
+ def self?.caller_locations: (Integer start_or_range, ?Integer length) -> ::Array[Thread::Backtrace::Location]?
211
+ | (::Range[Integer] start_or_range) -> ::Array[Thread::Backtrace::Location]?
212
+ | () -> ::Array[Thread::Backtrace::Location]
209
213
 
210
214
  # <!--
211
215
  # rdoc-file=vm_eval.c
@@ -216,10 +220,10 @@ module Kernel : BasicObject
216
220
  #
217
221
  # catch(1) { 123 } # => 123
218
222
  #
219
- # If `throw(tag2, val)` is called, Ruby searches up its stack for a `catch`
220
- # block whose `tag` has the same `object_id` as *tag2*. When found, the block
221
- # stops executing and returns *val* (or `nil` if no second argument was given to
222
- # `throw`).
223
+ # If <code>throw(tag2, val)</code> is called, Ruby searches up its stack for a
224
+ # `catch` block whose `tag` has the same `object_id` as *tag2*. When found, the
225
+ # block stops executing and returns *val* (or `nil` if no second argument was
226
+ # given to `throw`).
223
227
  #
224
228
  # catch(1) { throw(1, 456) } # => 456
225
229
  # catch(1) { throw(1) } # => nil
@@ -230,8 +234,8 @@ module Kernel : BasicObject
230
234
  # catch(1) {|x| x + 2 } # => 3
231
235
  #
232
236
  # When no `tag` is given, `catch` yields a new unique object (as from
233
- # `Object.new`) as the block parameter. This object can then be used as the
234
- # argument to `throw`, and will match the correct `catch` block.
237
+ # <code>Object.new</code>) as the block parameter. This object can then be used
238
+ # as the argument to `throw`, and will match the correct `catch` block.
235
239
  #
236
240
  # catch do |obj_A|
237
241
  # catch do |obj_B|
@@ -295,7 +299,7 @@ module Kernel : BasicObject
295
299
  # - block_given? -> true or false
296
300
  # -->
297
301
  # Returns `true` if `yield` would execute a block in the current context. The
298
- # `iterator?` form is mildly deprecated.
302
+ # <code>iterator?</code> form is mildly deprecated.
299
303
  #
300
304
  # def try
301
305
  # if block_given?
@@ -421,7 +425,8 @@ module Kernel : BasicObject
421
425
  # Array({foo: 0, bar: 1}) # => [[:foo, 0], [:bar, 1]]
422
426
  # Array(0..4) # => [0, 1, 2, 3, 4]
423
427
  #
424
- # Returns `object` in an array, `[object]`, if `object` cannot be converted:
428
+ # Returns `object` in an array, <code>[object]</code>, if `object` cannot be
429
+ # converted:
425
430
  #
426
431
  # Array(:foo) # => [:foo]
427
432
  #
@@ -437,8 +442,8 @@ module Kernel : BasicObject
437
442
  # Returns a new Complex object if the arguments are valid; otherwise raises an
438
443
  # exception if `exception` is `true`; otherwise returns `nil`.
439
444
  #
440
- # With Numeric arguments `real` and `imag`, returns `Complex.rect(real, imag)`
441
- # if the arguments are valid.
445
+ # With Numeric arguments `real` and `imag`, returns <code>Complex.rect(real,
446
+ # imag)</code> if the arguments are valid.
442
447
  #
443
448
  # With string argument `s`, returns a new Complex object if the argument is
444
449
  # valid; the string may have:
@@ -448,7 +453,7 @@ module Kernel : BasicObject
448
453
  # coordinates](rdoc-ref:Complex@Rectangular+Coordinates):
449
454
  #
450
455
  # * Sign-separated real and imaginary numeric substrings (with trailing
451
- # character `'i'`):
456
+ # character <code>'i'</code>):
452
457
  #
453
458
  # Complex('1+2i') # => (1+2i)
454
459
  # Complex('+1+2i') # => (1+2i)
@@ -456,13 +461,15 @@ module Kernel : BasicObject
456
461
  # Complex('-1+2i') # => (-1+2i)
457
462
  # Complex('-1-2i') # => (-1-2i)
458
463
  #
459
- # * Real-only numeric string (without trailing character `'i'`):
464
+ # * Real-only numeric string (without trailing character
465
+ # <code>'i'</code>):
460
466
  #
461
467
  # Complex('1') # => (1+0i)
462
468
  # Complex('+1') # => (1+0i)
463
469
  # Complex('-1') # => (-1+0i)
464
470
  #
465
- # * Imaginary-only numeric string (with trailing character `'i'`):
471
+ # * Imaginary-only numeric string (with trailing character
472
+ # <code>'i'</code>):
466
473
  #
467
474
  # Complex('1i') # => (0+1i)
468
475
  # Complex('+1i') # => (0+1i)
@@ -489,10 +496,10 @@ module Kernel : BasicObject
489
496
  # - Float(arg, exception: true) -> float or nil
490
497
  # -->
491
498
  # Returns *arg* converted to a float. Numeric types are converted directly, and
492
- # with exception to String and `nil`, the rest are converted using *arg*`.to_f`.
493
- # Converting a String with invalid characters will result in an ArgumentError.
494
- # Converting `nil` generates a TypeError. Exceptions can be suppressed by
495
- # passing `exception: false`.
499
+ # with exception to String and `nil`, the rest are converted using
500
+ # *arg*<code>.to_f</code>. Converting a String with invalid characters will
501
+ # result in an ArgumentError. Converting `nil` generates a TypeError. Exceptions
502
+ # can be suppressed by passing <code>exception: false</code>.
496
503
  #
497
504
  # Float(1) #=> 1.0
498
505
  # Float("123.456") #=> 123.456
@@ -515,7 +522,8 @@ module Kernel : BasicObject
515
522
  # * A hash, returns `object`.
516
523
  # * An empty array or `nil`, returns an empty hash.
517
524
  #
518
- # * Otherwise, if `object.to_hash` returns a hash, returns that hash.
525
+ # * Otherwise, if <code>object.to_hash</code> returns a hash, returns that
526
+ # hash.
519
527
  # * Otherwise, returns TypeError.
520
528
  #
521
529
  # Examples:
@@ -621,7 +629,7 @@ module Kernel : BasicObject
621
629
  # - Rational(x, y, exception: true) -> rational or nil
622
630
  # - Rational(arg, exception: true) -> rational or nil
623
631
  # -->
624
- # Returns `x/y` or `arg` as a Rational.
632
+ # Returns <code>x/y</code> or `arg` as a Rational.
625
633
  #
626
634
  # Rational(2, 3) #=> (2/3)
627
635
  # Rational(5) #=> (5/1)
@@ -697,7 +705,7 @@ module Kernel : BasicObject
697
705
  # Returns the canonicalized absolute path of the directory of the file from
698
706
  # which this method is called. It means symlinks in the path is resolved. If
699
707
  # `__FILE__` is `nil`, it returns `nil`. The return value equals to
700
- # `File.dirname(File.realpath(__FILE__))`.
708
+ # <code>File.dirname(File.realpath(__FILE__))</code>.
701
709
  #
702
710
  def self?.__dir__: () -> String?
703
711
 
@@ -714,8 +722,8 @@ module Kernel : BasicObject
714
722
  # rdoc-file=io.c
715
723
  # - `command` -> string
716
724
  # -->
717
- # Returns the `$stdout` output from running `command` in a subshell; sets global
718
- # variable `$?` to the process status.
725
+ # Returns the <code>$stdout</code> output from running `command` in a subshell;
726
+ # sets global variable <code>$?</code> to the process status.
719
727
  #
720
728
  # This method has potential security vulnerabilities if called with untrusted
721
729
  # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
@@ -727,7 +735,7 @@ module Kernel : BasicObject
727
735
  # $ $? # => #<Process::Status: pid 17088 exit 99>
728
736
  # $ $?.exitstatus # => 99
729
737
  #
730
- # The built-in syntax `%x{...}` uses this method.
738
+ # The built-in syntax <code>%x{...}</code> uses this method.
731
739
  #
732
740
  def self?.`: (String arg0) -> String
733
741
 
@@ -736,7 +744,8 @@ module Kernel : BasicObject
736
744
  # - abort
737
745
  # - Process.abort(msg = nil)
738
746
  # -->
739
- # Terminates execution immediately, effectively by calling `Kernel.exit(false)`.
747
+ # Terminates execution immediately, effectively by calling
748
+ # <code>Kernel.exit(false)</code>.
740
749
  #
741
750
  # If string argument `msg` is given, it is written to STDERR prior to
742
751
  # termination; otherwise, if an exception was raised, prints its message and
@@ -759,7 +768,7 @@ module Kernel : BasicObject
759
768
  # do_at_exit("goodbye ")
760
769
  # exit
761
770
  #
762
- # *produces:*
771
+ # <em>produces:</em>
763
772
  #
764
773
  # goodbye cruel world
765
774
  #
@@ -986,13 +995,14 @@ module Kernel : BasicObject
986
995
  # end
987
996
  # # => #<RuntimeError: RuntimeError>
988
997
  #
989
- # If keyword argument `cause` is not given, the cause is the value of `$!`.
998
+ # If keyword argument `cause` is not given, the cause is the value of
999
+ # <code>$!</code>.
990
1000
  #
991
1001
  # See [Cause](rdoc-ref:exceptions.md@Cause).
992
1002
  #
993
1003
  # In the alternate calling sequence, where argument `exception` *not* given,
994
- # raises a new exception of the class given by `$!`, or of class RuntimeError if
995
- # `$!` is `nil`:
1004
+ # raises a new exception of the class given by <code>$!</code>, or of class
1005
+ # RuntimeError if <code>$!</code> is `nil`:
996
1006
  #
997
1007
  # begin
998
1008
  # raise
@@ -1008,7 +1018,7 @@ module Kernel : BasicObject
1008
1018
  #
1009
1019
  def self?.fail: () -> bot
1010
1020
  | (string message, ?cause: Exception?) -> bot
1011
- | (_Exception exception, ?_ToS? message, ?String | Array[String] | Array[Thread::Backtrace::Location] | nil backtrace, ?cause: Exception?) -> bot
1021
+ | (_Exception exception, ?string | _ToS message, ?String | Array[String] | Array[Thread::Backtrace::Location] | nil backtrace, ?cause: Exception?) -> bot
1012
1022
  | (_Exception exception, ?cause: Exception?, **untyped) -> bot
1013
1023
 
1014
1024
  # <!--
@@ -1094,13 +1104,14 @@ module Kernel : BasicObject
1094
1104
  # end
1095
1105
  # # => #<RuntimeError: RuntimeError>
1096
1106
  #
1097
- # If keyword argument `cause` is not given, the cause is the value of `$!`.
1107
+ # If keyword argument `cause` is not given, the cause is the value of
1108
+ # <code>$!</code>.
1098
1109
  #
1099
1110
  # See [Cause](rdoc-ref:exceptions.md@Cause).
1100
1111
  #
1101
1112
  # In the alternate calling sequence, where argument `exception` *not* given,
1102
- # raises a new exception of the class given by `$!`, or of class RuntimeError if
1103
- # `$!` is `nil`:
1113
+ # raises a new exception of the class given by <code>$!</code>, or of class
1114
+ # RuntimeError if <code>$!</code> is `nil`:
1104
1115
  #
1105
1116
  # begin
1106
1117
  # raise
@@ -1145,29 +1156,29 @@ module Kernel : BasicObject
1145
1156
  # - gets(limit [, getline_args]) -> string or nil
1146
1157
  # - gets(sep, limit [, getline_args]) -> string or nil
1147
1158
  # -->
1148
- # Returns (and assigns to `$_`) the next line from the list of files in `ARGV`
1149
- # (or `$*`), or from standard input if no files are present on the command line.
1150
- # Returns `nil` at end of file. The optional argument specifies the record
1151
- # separator. The separator is included with the contents of each record. A
1152
- # separator of `nil` reads the entire contents, and a zero-length separator
1153
- # reads the input one paragraph at a time, where paragraphs are divided by two
1154
- # consecutive newlines. If the first argument is an integer, or optional second
1155
- # argument is given, the returning string would not be longer than the given
1156
- # value in bytes. If multiple filenames are present in `ARGV`, `gets(nil)` will
1157
- # read the contents one file at a time.
1159
+ # Returns (and assigns to <code>$_</code>) the next line from the list of files
1160
+ # in `ARGV` (or <code>$*</code>), or from standard input if no files are present
1161
+ # on the command line. Returns `nil` at end of file. The optional argument
1162
+ # specifies the record separator. The separator is included with the contents of
1163
+ # each record. A separator of `nil` reads the entire contents, and a zero-length
1164
+ # separator reads the input one paragraph at a time, where paragraphs are
1165
+ # divided by two consecutive newlines. If the first argument is an integer, or
1166
+ # optional second argument is given, the returning string would not be longer
1167
+ # than the given value in bytes. If multiple filenames are present in `ARGV`,
1168
+ # <code>gets(nil)</code> will read the contents one file at a time.
1158
1169
  #
1159
1170
  # ARGV << "testfile"
1160
1171
  # print while gets
1161
1172
  #
1162
- # *produces:*
1173
+ # <em>produces:</em>
1163
1174
  #
1164
1175
  # This is line one
1165
1176
  # This is line two
1166
1177
  # This is line three
1167
1178
  # And so on...
1168
1179
  #
1169
- # The style of programming using `$_` as an implicit parameter is gradually
1170
- # losing favor in the Ruby community.
1180
+ # The style of programming using <code>$_</code> as an implicit parameter is
1181
+ # gradually losing favor in the Ruby community.
1171
1182
  #
1172
1183
  def self?.gets: (?String sep, ?Integer limit, ?chomp: boolish) -> String?
1173
1184
 
@@ -1176,8 +1187,9 @@ module Kernel : BasicObject
1176
1187
  # - global_variables -> array
1177
1188
  # -->
1178
1189
  # Returns an array of the names of global variables. This includes special
1179
- # regexp global variables such as `$~` and `$+`, but does not include the
1180
- # numbered regexp global variables (`$1`, `$2`, etc.).
1190
+ # regexp global variables such as <code>$~</code> and <code>$+</code>, but does
1191
+ # not include the numbered regexp global variables (<code>$1</code>,
1192
+ # <code>$2</code>, etc.).
1181
1193
  #
1182
1194
  # global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]
1183
1195
  #
@@ -1196,10 +1208,10 @@ module Kernel : BasicObject
1196
1208
  # the file will be loaded using the relative path from the current directory.
1197
1209
  #
1198
1210
  # Otherwise, the file will be searched for in the library directories listed in
1199
- # `$LOAD_PATH` (`$:`). If the file is found in a directory, it will attempt to
1200
- # load the file relative to that directory. If the file is not found in any of
1201
- # the directories in `$LOAD_PATH`, the file will be loaded using the relative
1202
- # path from the current directory.
1211
+ # <code>$LOAD_PATH</code> (<code>$:</code>). If the file is found in a
1212
+ # directory, it will attempt to load the file relative to that directory. If
1213
+ # the file is not found in any of the directories in <code>$LOAD_PATH</code>,
1214
+ # the file will be loaded using the relative path from the current directory.
1203
1215
  #
1204
1216
  # If the file doesn't exist when there is an attempt to load it, a LoadError
1205
1217
  # will be raised.
@@ -1252,9 +1264,6 @@ module Kernel : BasicObject
1252
1264
  # -->
1253
1265
  # Creates an IO object connected to the given file.
1254
1266
  #
1255
- # This method has potential security vulnerabilities if called with untrusted
1256
- # input; see [Command Injection](rdoc-ref:security/command_injection.rdoc).
1257
- #
1258
1267
  # With no block given, file stream is returned:
1259
1268
  #
1260
1269
  # open('t.txt') # => #<File:t.txt>
@@ -1277,18 +1286,19 @@ module Kernel : BasicObject
1277
1286
  # rdoc-file=io.c
1278
1287
  # - print(*objects) -> nil
1279
1288
  # -->
1280
- # Equivalent to `$stdout.print(*objects)`, this method is the straightforward
1281
- # way to write to `$stdout`.
1289
+ # Equivalent to <code>$stdout.print(*objects)</code>, this method is the
1290
+ # straightforward way to write to <code>$stdout</code>.
1282
1291
  #
1283
- # Writes the given objects to `$stdout`; returns `nil`. Appends the output
1284
- # record separator `$OUTPUT_RECORD_SEPARATOR` `$\`), if it is not `nil`.
1292
+ # Writes the given objects to <code>$stdout</code>; returns `nil`. Appends the
1293
+ # output record separator <code>$OUTPUT_RECORD_SEPARATOR</code>
1294
+ # <code>$\</code>), if it is not `nil`.
1285
1295
  #
1286
1296
  # With argument `objects` given, for each object:
1287
1297
  #
1288
1298
  # * Converts via its method `to_s` if not a string.
1289
1299
  # * Writes to `stdout`.
1290
1300
  # * If not the last object, writes the output field separator
1291
- # `$OUTPUT_FIELD_SEPARATOR` (`$,` if it is not `nil`.
1301
+ # <code>$OUTPUT_FIELD_SEPARATOR</code> (<code>$,</code> if it is not `nil`.
1292
1302
  #
1293
1303
  # With default separators:
1294
1304
  #
@@ -1313,8 +1323,8 @@ module Kernel : BasicObject
1313
1323
  #
1314
1324
  # 0,0.0,0/1,0+0i,zero,zero
1315
1325
  #
1316
- # With no argument given, writes the content of `$_` (which is usually the most
1317
- # recent user input):
1326
+ # With no argument given, writes the content of <code>$_</code> (which is
1327
+ # usually the most recent user input):
1318
1328
  #
1319
1329
  # gets # Sets $_ to the most recent user input.
1320
1330
  # print # Prints $_.
@@ -1436,7 +1446,7 @@ module Kernel : BasicObject
1436
1446
  # -->
1437
1447
  # prints arguments in pretty form.
1438
1448
  #
1439
- # `#pp` returns argument(s).
1449
+ # <code>#pp</code> returns argument(s).
1440
1450
  #
1441
1451
  def self?.pp: [T] (T arg0) -> T
1442
1452
  | (untyped, untyped, *untyped) -> Array[untyped]
@@ -1446,19 +1456,20 @@ module Kernel : BasicObject
1446
1456
  # rdoc-file=random.c
1447
1457
  # - rand(max=0) -> number
1448
1458
  # -->
1449
- # If called without an argument, or if `max.to_i.abs == 0`, rand returns a
1450
- # pseudo-random floating point number between 0.0 and 1.0, including 0.0 and
1451
- # excluding 1.0.
1459
+ # If called without an argument, or if <code>max.to_i.abs == 0</code>, rand
1460
+ # returns a pseudo-random floating point number between 0.0 and 1.0, including
1461
+ # 0.0 and excluding 1.0.
1452
1462
  #
1453
1463
  # rand #=> 0.2725926052826416
1454
1464
  #
1455
- # When `max.abs` is greater than or equal to 1, `rand` returns a pseudo-random
1456
- # integer greater than or equal to 0 and less than `max.to_i.abs`.
1465
+ # When <code>max.abs</code> is greater than or equal to 1, `rand` returns a
1466
+ # pseudo-random integer greater than or equal to 0 and less than
1467
+ # <code>max.to_i.abs</code>.
1457
1468
  #
1458
1469
  # rand(100) #=> 12
1459
1470
  #
1460
1471
  # When `max` is a Range, `rand` returns a random number where
1461
- # `range.member?(number) == true`.
1472
+ # <code>range.member?(number) == true</code>.
1462
1473
  #
1463
1474
  # Negative or floating point values for `max` are allowed, but may give
1464
1475
  # surprising results.
@@ -1559,7 +1570,7 @@ module Kernel : BasicObject
1559
1570
  # When RubyGems is required, Kernel#require is replaced with our own which is
1560
1571
  # capable of loading gems on demand.
1561
1572
  #
1562
- # When you call `require 'x'`, this is what happens:
1573
+ # When you call <code>require 'x'</code>, this is what happens:
1563
1574
  # * If the file can be loaded from the existing Ruby loadpath, it is.
1564
1575
  # * Otherwise, installed gems are searched for a file that matches. If it's
1565
1576
  # found in gem 'y', that gem is activated (added to the loadpath).
@@ -1594,8 +1605,9 @@ module Kernel : BasicObject
1594
1605
  # IO objects.
1595
1606
  #
1596
1607
  # Argument `timeout` is a numeric value (such as integer or float) timeout
1597
- # interval in seconds. `timeout` can also be `nil` or `Float::INFINITY`. `nil`
1598
- # and `Float::INFINITY` means no timeout.
1608
+ # interval in seconds. `timeout` can also be `nil` or
1609
+ # <code>Float::INFINITY</code>. `nil` and <code>Float::INFINITY</code> means no
1610
+ # timeout.
1599
1611
  #
1600
1612
  # The method monitors the IO objects given in all three arrays, waiting for some
1601
1613
  # to be ready; returns a 3-element array whose elements are:
@@ -1670,8 +1682,8 @@ module Kernel : BasicObject
1670
1682
  #
1671
1683
  # The writability notified by select(2) doesn't show how many bytes are
1672
1684
  # writable. IO#write method blocks until given whole string is written. So,
1673
- # `IO#write(two or more bytes)` can block after writability is notified by
1674
- # IO.select. IO#write_nonblock is required to avoid the blocking.
1685
+ # <code>IO#write(two or more bytes)</code> can block after writability is
1686
+ # notified by IO.select. IO#write_nonblock is required to avoid the blocking.
1675
1687
  #
1676
1688
  # Blocking write (#write) can be emulated using #write_nonblock and IO.select as
1677
1689
  # follows: IO::WaitReadable should also be rescued for SSL renegotiation in
@@ -1739,11 +1751,6 @@ module Kernel : BasicObject
1739
1751
  def self?.sleep: (?nil) -> bot
1740
1752
  | (Time::_Timeout duration) -> Integer
1741
1753
 
1742
- %a{deprecated}
1743
- interface _Divmod
1744
- def divmod: (Numeric) -> [ Numeric, Numeric ]
1745
- end
1746
-
1747
1754
  # <!--
1748
1755
  # rdoc-file=io.c
1749
1756
  # - syscall(integer_callno, *arguments) -> integer
@@ -1783,58 +1790,58 @@ module Kernel : BasicObject
1783
1790
  # * Each of these tests operates only on the entity at `path0`,
1784
1791
  # and returns `true` or `false`;
1785
1792
  # for a non-existent entity, returns `false` (does not raise exception):
1786
- # Character|Test
1787
- # ---------|-------------------------------------------------------------------
1788
- # `'b'` |Whether the entity is a block device.
1789
- # `'c'` |Whether the entity is a character device.
1790
- # `'d'` |Whether the entity is a directory.
1791
- # `'e'` |Whether the entity is an existing entity.
1792
- # `'f'` |Whether the entity is an existing regular file.
1793
- # `'g'` |Whether the entity's setgid bit is set.
1794
- # `'G'` |Whether the entity's group ownership is equal to the caller's.
1795
- # `'k'` |Whether the entity's sticky bit is set.
1796
- # `'l'` |Whether the entity is a symbolic link.
1797
- # `'o'` |Whether the entity is owned by the caller's effective uid.
1798
- # `'O'` |Like `'o'`, but uses the real uid (not the effective uid).
1799
- # `'p'` |Whether the entity is a FIFO device (named pipe).
1800
- # `'r'` |Whether the entity is readable by the caller's effective uid/gid.
1801
- # `'R'` |Like `'r'`, but uses the real uid/gid (not the effective uid/gid).
1802
- # `'S'` |Whether the entity is a socket.
1803
- # `'u'` |Whether the entity's setuid bit is set.
1804
- # `'w'` |Whether the entity is writable by the caller's effective uid/gid.
1805
- # `'W'` |Like `'w'`, but uses the real uid/gid (not the effective uid/gid).
1806
- # `'x'` |Whether the entity is executable by the caller's effective uid/gid.
1807
- # `'X'` |Like `'x'`, but uses the real uid/gid (not the effective uid/git).
1808
- # `'z'` |Whether the entity exists and is of length zero.
1793
+ # Character |Test
1794
+ # ----------------|-----------------------------------------------------------------------------
1795
+ # <code>'b'</code>|Whether the entity is a block device.
1796
+ # <code>'c'</code>|Whether the entity is a character device.
1797
+ # <code>'d'</code>|Whether the entity is a directory.
1798
+ # <code>'e'</code>|Whether the entity is an existing entity.
1799
+ # <code>'f'</code>|Whether the entity is an existing regular file.
1800
+ # <code>'g'</code>|Whether the entity's setgid bit is set.
1801
+ # <code>'G'</code>|Whether the entity's group ownership is equal to the caller's.
1802
+ # <code>'k'</code>|Whether the entity's sticky bit is set.
1803
+ # <code>'l'</code>|Whether the entity is a symbolic link.
1804
+ # <code>'o'</code>|Whether the entity is owned by the caller's effective uid.
1805
+ # <code>'O'</code>|Like <code>'o'</code>, but uses the real uid (not the effective uid).
1806
+ # <code>'p'</code>|Whether the entity is a FIFO device (named pipe).
1807
+ # <code>'r'</code>|Whether the entity is readable by the caller's effective uid/gid.
1808
+ # <code>'R'</code>|Like <code>'r'</code>, but uses the real uid/gid (not the effective uid/gid).
1809
+ # <code>'S'</code>|Whether the entity is a socket.
1810
+ # <code>'u'</code>|Whether the entity's setuid bit is set.
1811
+ # <code>'w'</code>|Whether the entity is writable by the caller's effective uid/gid.
1812
+ # <code>'W'</code>|Like <code>'w'</code>, but uses the real uid/gid (not the effective uid/gid).
1813
+ # <code>'x'</code>|Whether the entity is executable by the caller's effective uid/gid.
1814
+ # <code>'X'</code>|Like <code>'x'</code>, but uses the real uid/gid (not the effective uid/git).
1815
+ # <code>'z'</code>|Whether the entity exists and is of length zero.
1809
1816
  # * This test operates only on the entity at `path0`,
1810
- # and returns an integer size or `nil`:
1811
- # Character|Test
1812
- # ---------|--------------------------------------------------------------------------------------------
1813
- # `'s'` |Returns positive integer size if the entity exists and has non-zero length, `nil` otherwise.
1817
+ # and returns an integer size or +nil+:
1818
+ # Character |Test
1819
+ # ----------------|--------------------------------------------------------------------------------------------
1820
+ # <code>'s'</code>|Returns positive integer size if the entity exists and has non-zero length, +nil+ otherwise.
1814
1821
  # * Each of these tests operates only on the entity at `path0`,
1815
1822
  # and returns a Time object;
1816
1823
  # raises an exception if the entity does not exist:
1817
- # Character|Test
1818
- # ---------|--------------------------------------
1819
- # `'A'` |Last access time for the entity.
1820
- # `'C'` |Last change time for the entity.
1821
- # `'M'` |Last modification time for the entity.
1824
+ # Character |Test
1825
+ # ----------------|--------------------------------------
1826
+ # <code>'A'</code>|Last access time for the entity.
1827
+ # <code>'C'</code>|Last change time for the entity.
1828
+ # <code>'M'</code>|Last modification time for the entity.
1822
1829
  # * Each of these tests operates on the modification time (`mtime`)
1823
1830
  # of each of the entities at `path0` and `path1`,
1824
1831
  # and returns a `true` or `false`;
1825
1832
  # returns `false` if either entity does not exist:
1826
- # Character|Test
1827
- # ---------|---------------------------------------------------------------
1828
- # `'<'` |Whether the `mtime` at `path0` is less than that at `path1`.
1829
- # `'='` |Whether the `mtime` at `path0` is equal to that at `path1`.
1830
- # `'>'` |Whether the `mtime` at `path0` is greater than that at `path1`.
1833
+ # Character |Test
1834
+ # ----------------|---------------------------------------------------------------
1835
+ # <code>'<'</code>|Whether the `mtime` at `path0` is less than that at `path1`.
1836
+ # <code>'='</code>|Whether the `mtime` at `path0` is equal to that at `path1`.
1837
+ # <code>'>'</code>|Whether the `mtime` at `path0` is greater than that at `path1`.
1831
1838
  # * This test operates on the content of each of the entities at `path0` and
1832
1839
  # `path1`,
1833
1840
  # and returns a `true` or `false`;
1834
1841
  # returns `false` if either entity does not exist:
1835
- # Character|Test
1836
- # ---------|---------------------------------------------
1837
- # `'-'` |Whether the entities exist and are identical.
1842
+ # Character |Test
1843
+ # ----------------|---------------------------------------------
1844
+ # <code>'-'</code>|Whether the entities exist and are identical.
1838
1845
  #
1839
1846
  def self?.test: (String | Integer cmd, String | IO file1, ?String | IO file2) -> (TrueClass | FalseClass | Time | nil | Integer)
1840
1847
 
@@ -1853,14 +1860,14 @@ module Kernel : BasicObject
1853
1860
  # rdoc-file=warning.rb
1854
1861
  # - warn(*msgs, uplevel: nil, category: nil) -> nil
1855
1862
  # -->
1856
- # If warnings have been disabled (for example with the `-W0` flag), does
1857
- # nothing. Otherwise, converts each of the messages to strings, appends a
1863
+ # If warnings have been disabled (for example with the <code>-W0</code> flag),
1864
+ # does nothing. Otherwise, converts each of the messages to strings, appends a
1858
1865
  # newline character to the string if the string does not end in a newline, and
1859
1866
  # calls Warning.warn with the string.
1860
1867
  #
1861
1868
  # warn("warning 1", "warning 2")
1862
1869
  #
1863
- # *produces:*
1870
+ # <em>produces:</em>
1864
1871
  #
1865
1872
  # warning 1
1866
1873
  # warning 2
@@ -1880,12 +1887,13 @@ module Kernel : BasicObject
1880
1887
  #
1881
1888
  # bar
1882
1889
  #
1883
- # *produces:*
1890
+ # <em>produces:</em>
1884
1891
  #
1885
1892
  # baz.rb:6: warning: invalid call to foo
1886
1893
  #
1887
1894
  # If `category` keyword argument is given, passes the category to
1888
- # `Warning.warn`. The category given must be one of the following categories:
1895
+ # <code>Warning.warn</code>. The category given must be one of the following
1896
+ # categories:
1889
1897
  #
1890
1898
  # :deprecated
1891
1899
  # : Used for warning for deprecated functionality that may be removed in the
@@ -1930,7 +1938,7 @@ module Kernel : BasicObject
1930
1938
  # word or special built-in, or if it contains one or more meta characters.
1931
1939
  # * `exe_path` otherwise.
1932
1940
  #
1933
- # **Argument `command_line`**
1941
+ # <strong>Argument `command_line`</strong>
1934
1942
  #
1935
1943
  # String argument `command_line` is a command line to be passed to a shell; it
1936
1944
  # must begin with a shell reserved word, begin with a special built-in, or
@@ -1953,7 +1961,7 @@ module Kernel : BasicObject
1953
1961
  #
1954
1962
  # Raises an exception if the new process could not execute.
1955
1963
  #
1956
- # **Argument `exe_path`**
1964
+ # <strong>Argument `exe_path`</strong>
1957
1965
  #
1958
1966
  # Argument `exe_path` is one of the following:
1959
1967
  #
@@ -1987,8 +1995,8 @@ module Kernel : BasicObject
1987
1995
  #
1988
1996
  # Raises an exception if the new process could not execute.
1989
1997
  #
1990
- def self?.exec: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> bot
1991
- | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> bot
1998
+ def self?.exec: (String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String) -> bot
1999
+ | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String) -> bot
1992
2000
 
1993
2001
  type redirect_fd = Integer | :in | :out | :err | IO | String | [ String ] | [ String, string | int ] | [ String, string | int, int ] | [ :child, int ] | :close
1994
2002
 
@@ -2030,7 +2038,7 @@ module Kernel : BasicObject
2030
2038
  # word or special built-in, or if it contains one or more meta characters.
2031
2039
  # * `exe_path` otherwise.
2032
2040
  #
2033
- # **Argument `command_line`**
2041
+ # <strong>Argument `command_line`</strong>
2034
2042
  #
2035
2043
  # String argument `command_line` is a command line to be passed to a shell; it
2036
2044
  # must begin with a shell reserved word, begin with a special built-in, or
@@ -2059,7 +2067,7 @@ module Kernel : BasicObject
2059
2067
  #
2060
2068
  # Raises an exception if the new process could not execute.
2061
2069
  #
2062
- # **Argument `exe_path`**
2070
+ # <strong>Argument `exe_path`</strong>
2063
2071
  #
2064
2072
  # Argument `exe_path` is one of the following:
2065
2073
  #
@@ -2092,8 +2100,8 @@ module Kernel : BasicObject
2092
2100
  #
2093
2101
  # Raises an exception if the new process could not execute.
2094
2102
  #
2095
- def self?.spawn: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> Integer
2096
- | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> Integer
2103
+ def self?.spawn: (String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String) -> Integer
2104
+ | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String) -> Integer
2097
2105
 
2098
2106
  # <!--
2099
2107
  # rdoc-file=process.c
@@ -2117,7 +2125,7 @@ module Kernel : BasicObject
2117
2125
  # Raises an exception (instead of returning `false` or `nil`) if keyword
2118
2126
  # argument `exception` is set to `true`.
2119
2127
  #
2120
- # Assigns the command's error status to `$?`.
2128
+ # Assigns the command's error status to <code>$?</code>.
2121
2129
  #
2122
2130
  # The new process is created using the [system system
2123
2131
  # call](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/s
@@ -2136,7 +2144,7 @@ module Kernel : BasicObject
2136
2144
  # word or special built-in, or if it contains one or more meta characters.
2137
2145
  # * `exe_path` otherwise.
2138
2146
  #
2139
- # **Argument `command_line`**
2147
+ # <strong>Argument `command_line`</strong>
2140
2148
  #
2141
2149
  # String argument `command_line` is a command line to be passed to a shell; it
2142
2150
  # must begin with a shell reserved word, begin with a special built-in, or
@@ -2148,7 +2156,7 @@ module Kernel : BasicObject
2148
2156
  # system('date > /nop/date.tmp') # => false
2149
2157
  # system('date > /nop/date.tmp', exception: true) # Raises RuntimeError.
2150
2158
  #
2151
- # Assigns the command's error status to `$?`:
2159
+ # Assigns the command's error status to <code>$?</code>:
2152
2160
  #
2153
2161
  # system('exit') # => true # Built-in.
2154
2162
  # $? # => #<Process::Status: pid 640610 exit 0>
@@ -2168,7 +2176,7 @@ module Kernel : BasicObject
2168
2176
  #
2169
2177
  # Raises an exception if the new process could not execute.
2170
2178
  #
2171
- # **Argument `exe_path`**
2179
+ # <strong>Argument `exe_path`</strong>
2172
2180
  #
2173
2181
  # Argument `exe_path` is one of the following:
2174
2182
  #
@@ -2185,7 +2193,7 @@ module Kernel : BasicObject
2185
2193
  #
2186
2194
  # Mon Aug 28 11:43:10 AM CDT 2023
2187
2195
  #
2188
- # Assigns the command's error status to `$?`:
2196
+ # Assigns the command's error status to <code>$?</code>:
2189
2197
  #
2190
2198
  # system('/usr/bin/date') # => true
2191
2199
  # $? # => #<Process::Status: pid 645605 exit 0>
@@ -2210,8 +2218,51 @@ module Kernel : BasicObject
2210
2218
  #
2211
2219
  # Raises an exception if the new process could not execute.
2212
2220
  #
2213
- def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
2214
- | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
2221
+ def self?.system: (String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
2222
+ | (Hash[string, string?] env, String command, *String args, ?unsetenv_others: bool, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: bool, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
2223
+
2224
+ # An interface used with `trace_var` (and `untrace_var`) for custom command types.
2225
+ interface _Tracer
2226
+ # Called whenever the global variable that's being traced changes; the argument is the new value.
2227
+ def call: (untyped argument) -> void
2228
+ end
2229
+
2230
+ # <!--
2231
+ # rdoc-file=eval.c
2232
+ # - trace_var(symbol, cmd ) -> nil
2233
+ # - trace_var(symbol) {|val| block } -> nil
2234
+ # -->
2235
+ # Controls tracing of assignments to global variables. The parameter `symbol`
2236
+ # identifies the variable (as either a string name or a symbol identifier).
2237
+ # *cmd* (which may be a string or a `Proc` object) or block is executed whenever
2238
+ # the variable is assigned. The block or `Proc` object receives the variable's
2239
+ # new value as a parameter. Also see #untrace_var.
2240
+ #
2241
+ # trace_var :$_, proc {|v| puts "$_ is now '#{v}'" }
2242
+ # $_ = "hello"
2243
+ # $_ = ' there'
2244
+ #
2245
+ # <em>produces:</em>
2246
+ #
2247
+ # $_ is now 'hello'
2248
+ # $_ is now ' there'
2249
+ #
2250
+ def self?.trace_var: (interned name, String | _Tracer cmd) -> nil
2251
+ | (interned name) { (untyped value) -> void } -> nil
2252
+ | (interned name, nil) -> Array[String | _Tracer]?
2253
+
2254
+ # <!--
2255
+ # rdoc-file=eval.c
2256
+ # - untrace_var(symbol [, cmd] ) -> array or nil
2257
+ # -->
2258
+ # Removes tracing for the specified command on the given global variable and
2259
+ # returns `nil`. If no command is specified, removes all tracing for that
2260
+ # variable and returns an array containing the commands actually removed.
2261
+ #
2262
+ def self?.untrace_var: (interned name, ?nil) -> Array[String | _Tracer]
2263
+ | (interned name, String cmd) -> [String]?
2264
+ | [T < _Tracer] (interned name, T cmd) -> [T]?
2265
+ | (interned name, untyped cmd) -> nil
2215
2266
 
2216
2267
  # <!--
2217
2268
  # rdoc-file=object.c
@@ -2258,8 +2309,8 @@ module Kernel : BasicObject
2258
2309
  # -->
2259
2310
  # Produces a shallow copy of *obj*---the instance variables of *obj* are copied,
2260
2311
  # but not the objects they reference. #clone copies the frozen value state of
2261
- # *obj*, unless the `:freeze` keyword argument is given with a false or true
2262
- # value. See also the discussion under Object#dup.
2312
+ # *obj*, unless the <code>:freeze</code> keyword argument is given with a false
2313
+ # or true value. See also the discussion under Object#dup.
2263
2314
  #
2264
2315
  # class Klass
2265
2316
  # attr_accessor :str