rbs 4.0.0.dev.5 → 4.0.1.dev.1

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 (194) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +1 -0
  3. data/.github/workflows/c-check.yml +8 -4
  4. data/.github/workflows/comments.yml +3 -1
  5. data/.github/workflows/dependabot.yml +1 -1
  6. data/.github/workflows/ruby.yml +10 -0
  7. data/.github/workflows/rust.yml +95 -0
  8. data/CHANGELOG.md +323 -0
  9. data/Rakefile +12 -29
  10. data/Steepfile +1 -0
  11. data/config.yml +393 -37
  12. data/core/array.rbs +218 -188
  13. data/core/basic_object.rbs +9 -8
  14. data/core/class.rbs +6 -5
  15. data/core/comparable.rbs +45 -31
  16. data/core/complex.rbs +52 -40
  17. data/core/dir.rbs +57 -45
  18. data/core/encoding.rbs +5 -5
  19. data/core/enumerable.rbs +96 -91
  20. data/core/enumerator.rbs +4 -3
  21. data/core/errno.rbs +3 -2
  22. data/core/errors.rbs +31 -29
  23. data/core/exception.rbs +12 -12
  24. data/core/fiber.rbs +36 -36
  25. data/core/file.rbs +186 -113
  26. data/core/file_test.rbs +2 -2
  27. data/core/float.rbs +41 -32
  28. data/core/gc.rbs +78 -70
  29. data/core/hash.rbs +70 -60
  30. data/core/integer.rbs +32 -28
  31. data/core/io/buffer.rbs +36 -36
  32. data/core/io/wait.rbs +7 -7
  33. data/core/io.rbs +120 -135
  34. data/core/kernel.rbs +189 -139
  35. data/core/marshal.rbs +3 -3
  36. data/core/match_data.rbs +14 -12
  37. data/core/math.rbs +69 -67
  38. data/core/method.rbs +6 -6
  39. data/core/module.rbs +146 -85
  40. data/core/nil_class.rbs +4 -3
  41. data/core/numeric.rbs +35 -32
  42. data/core/object.rbs +6 -8
  43. data/core/object_space.rbs +11 -10
  44. data/core/pathname.rbs +131 -81
  45. data/core/proc.rbs +65 -33
  46. data/core/process.rbs +219 -201
  47. data/core/ractor.rbs +15 -11
  48. data/core/random.rbs +4 -3
  49. data/core/range.rbs +52 -47
  50. data/core/rational.rbs +5 -5
  51. data/core/rbs/unnamed/argf.rbs +58 -51
  52. data/core/rbs/unnamed/env_class.rbs +18 -13
  53. data/core/rbs/unnamed/main_class.rbs +123 -0
  54. data/core/rbs/unnamed/random.rbs +7 -5
  55. data/core/regexp.rbs +236 -197
  56. data/core/ruby.rbs +1 -1
  57. data/core/ruby_vm.rbs +32 -30
  58. data/core/rubygems/config_file.rbs +5 -5
  59. data/core/rubygems/errors.rbs +1 -1
  60. data/core/rubygems/requirement.rbs +5 -5
  61. data/core/rubygems/rubygems.rbs +5 -3
  62. data/core/set.rbs +17 -16
  63. data/core/signal.rbs +2 -2
  64. data/core/string.rbs +311 -292
  65. data/core/struct.rbs +26 -25
  66. data/core/symbol.rbs +25 -24
  67. data/core/thread.rbs +40 -34
  68. data/core/time.rbs +47 -42
  69. data/core/trace_point.rbs +34 -31
  70. data/core/true_class.rbs +2 -2
  71. data/core/unbound_method.rbs +10 -10
  72. data/core/warning.rbs +7 -7
  73. data/docs/collection.md +1 -1
  74. data/docs/config.md +171 -0
  75. data/docs/inline.md +110 -4
  76. data/docs/syntax.md +13 -12
  77. data/ext/rbs_extension/ast_translation.c +489 -135
  78. data/ext/rbs_extension/class_constants.c +8 -0
  79. data/ext/rbs_extension/class_constants.h +4 -0
  80. data/ext/rbs_extension/legacy_location.c +28 -51
  81. data/ext/rbs_extension/legacy_location.h +37 -0
  82. data/ext/rbs_extension/main.c +12 -20
  83. data/include/rbs/ast.h +423 -195
  84. data/include/rbs/lexer.h +2 -2
  85. data/include/rbs/location.h +25 -44
  86. data/include/rbs/parser.h +2 -2
  87. data/include/rbs/util/rbs_constant_pool.h +0 -3
  88. data/include/rbs.h +8 -0
  89. data/lib/rbs/ast/ruby/annotations.rb +157 -4
  90. data/lib/rbs/ast/ruby/members.rb +374 -22
  91. data/lib/rbs/cli/validate.rb +5 -60
  92. data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
  93. data/lib/rbs/definition_builder.rb +60 -27
  94. data/lib/rbs/errors.rb +0 -11
  95. data/lib/rbs/inline_parser.rb +1 -1
  96. data/lib/rbs/parser_aux.rb +20 -7
  97. data/lib/rbs/prototype/helpers.rb +57 -0
  98. data/lib/rbs/prototype/rb.rb +1 -26
  99. data/lib/rbs/prototype/rbi.rb +1 -20
  100. data/lib/rbs/test/type_check.rb +3 -0
  101. data/lib/rbs/types.rb +62 -52
  102. data/lib/rbs/unit_test/type_assertions.rb +35 -8
  103. data/lib/rbs/version.rb +1 -1
  104. data/lib/rbs.rb +0 -1
  105. data/rbs.gemspec +1 -1
  106. data/rust/.gitignore +1 -0
  107. data/rust/Cargo.lock +378 -0
  108. data/rust/Cargo.toml +7 -0
  109. data/rust/ruby-rbs/Cargo.toml +22 -0
  110. data/rust/ruby-rbs/build.rs +764 -0
  111. data/rust/ruby-rbs/examples/locations.rs +60 -0
  112. data/rust/ruby-rbs/src/lib.rs +1 -0
  113. data/rust/ruby-rbs/src/node/mod.rs +742 -0
  114. data/rust/ruby-rbs/tests/sanity.rs +47 -0
  115. data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
  116. data/rust/ruby-rbs-sys/Cargo.toml +23 -0
  117. data/rust/ruby-rbs-sys/build.rs +204 -0
  118. data/rust/ruby-rbs-sys/src/lib.rs +50 -0
  119. data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
  120. data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
  121. data/rust/ruby-rbs-sys/wrapper.h +1 -0
  122. data/sig/ast/ruby/annotations.rbs +191 -4
  123. data/sig/ast/ruby/members.rbs +21 -1
  124. data/sig/cli/validate.rbs +1 -6
  125. data/sig/definition_builder.rbs +2 -0
  126. data/sig/errors.rbs +0 -8
  127. data/sig/method_types.rbs +1 -1
  128. data/sig/parser.rbs +17 -13
  129. data/sig/prototype/helpers.rbs +2 -0
  130. data/sig/types.rbs +10 -11
  131. data/sig/unit_test/spy.rbs +0 -8
  132. data/sig/unit_test/type_assertions.rbs +11 -0
  133. data/src/ast.c +339 -161
  134. data/src/lexstate.c +1 -1
  135. data/src/location.c +7 -47
  136. data/src/parser.c +674 -480
  137. data/src/util/rbs_constant_pool.c +0 -4
  138. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
  139. data/stdlib/cgi-escape/0/escape.rbs +4 -4
  140. data/stdlib/coverage/0/coverage.rbs +4 -3
  141. data/stdlib/date/0/date.rbs +33 -28
  142. data/stdlib/date/0/date_time.rbs +24 -23
  143. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  144. data/stdlib/erb/0/erb.rbs +64 -53
  145. data/stdlib/etc/0/etc.rbs +55 -50
  146. data/stdlib/fileutils/0/fileutils.rbs +138 -125
  147. data/stdlib/forwardable/0/forwardable.rbs +10 -10
  148. data/stdlib/io-console/0/io-console.rbs +2 -2
  149. data/stdlib/json/0/json.rbs +135 -108
  150. data/stdlib/monitor/0/monitor.rbs +3 -3
  151. data/stdlib/net-http/0/net-http.rbs +159 -134
  152. data/stdlib/objspace/0/objspace.rbs +8 -7
  153. data/stdlib/open-uri/0/open-uri.rbs +8 -8
  154. data/stdlib/open3/0/open3.rbs +36 -35
  155. data/stdlib/openssl/0/openssl.rbs +144 -129
  156. data/stdlib/optparse/0/optparse.rbs +18 -14
  157. data/stdlib/pathname/0/pathname.rbs +2 -2
  158. data/stdlib/pp/0/pp.rbs +9 -8
  159. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  160. data/stdlib/pstore/0/pstore.rbs +35 -30
  161. data/stdlib/psych/0/psych.rbs +61 -8
  162. data/stdlib/psych/0/store.rbs +2 -4
  163. data/stdlib/pty/0/pty.rbs +9 -6
  164. data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
  165. data/stdlib/ripper/0/ripper.rbs +20 -17
  166. data/stdlib/securerandom/0/securerandom.rbs +1 -1
  167. data/stdlib/shellwords/0/shellwords.rbs +2 -2
  168. data/stdlib/socket/0/addrinfo.rbs +7 -7
  169. data/stdlib/socket/0/basic_socket.rbs +3 -3
  170. data/stdlib/socket/0/ip_socket.rbs +10 -8
  171. data/stdlib/socket/0/socket.rbs +10 -9
  172. data/stdlib/socket/0/tcp_server.rbs +1 -1
  173. data/stdlib/socket/0/tcp_socket.rbs +1 -1
  174. data/stdlib/socket/0/udp_socket.rbs +1 -1
  175. data/stdlib/socket/0/unix_server.rbs +1 -1
  176. data/stdlib/stringio/0/stringio.rbs +55 -54
  177. data/stdlib/strscan/0/string_scanner.rbs +46 -44
  178. data/stdlib/tempfile/0/tempfile.rbs +24 -20
  179. data/stdlib/time/0/time.rbs +7 -5
  180. data/stdlib/tsort/0/tsort.rbs +7 -6
  181. data/stdlib/uri/0/common.rbs +26 -18
  182. data/stdlib/uri/0/file.rbs +2 -2
  183. data/stdlib/uri/0/generic.rbs +2 -2
  184. data/stdlib/uri/0/http.rbs +2 -2
  185. data/stdlib/uri/0/ldap.rbs +2 -2
  186. data/stdlib/uri/0/mailto.rbs +3 -3
  187. data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
  188. data/stdlib/zlib/0/deflate.rbs +4 -3
  189. data/stdlib/zlib/0/gzip_reader.rbs +4 -4
  190. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  191. data/stdlib/zlib/0/inflate.rbs +1 -1
  192. data/stdlib/zlib/0/need_dict.rbs +1 -1
  193. metadata +23 -5
  194. data/.github/workflows/valgrind.yml +0 -42
data/core/time.rbs CHANGED
@@ -76,9 +76,9 @@
76
76
  # integer. However `localtime` on some platforms doesn't supports negative
77
77
  # `time_t` (before 1970).
78
78
  #
79
- # `struct tm` has *tm_year* member to represent years. (`tm_year = 0` means the
80
- # year 1900.) It is defined as `int` in the C standard. *tm_year* can represent
81
- # years between -2147481748 to 2147485547 if `int` is 32 bit.
79
+ # `struct tm` has *tm_year* member to represent years. (<code>tm_year = 0</code>
80
+ # means the year 1900.) It is defined as `int` in the C standard. *tm_year* can
81
+ # represent years between -2147481748 to 2147485547 if `int` is 32 bit.
82
82
  #
83
83
  # Ruby supports leap seconds as far as if the C function `localtime` and
84
84
  # `gmtime` supports it. They use the tz database in most Unix systems. The tz
@@ -259,9 +259,9 @@
259
259
  #
260
260
  # Certain `Time` methods accept arguments that specify timezones:
261
261
  #
262
- # * Time.at: keyword argument `in:`.
263
- # * Time.new: positional argument `zone` or keyword argument `in:`.
264
- # * Time.now: keyword argument `in:`.
262
+ # * Time.at: keyword argument <code>in:</code>.
263
+ # * Time.new: positional argument `zone` or keyword argument <code>in:</code>.
264
+ # * Time.now: keyword argument <code>in:</code>.
265
265
  # * Time#getlocal: positional argument `zone`.
266
266
  # * Time#localtime: positional argument `zone`.
267
267
  #
@@ -276,11 +276,11 @@
276
276
  #
277
277
  # ### Hours/Minutes Offsets
278
278
  #
279
- # The zone value may be a string offset from UTC in the form `'+HH:MM'` or
280
- # `'-HH:MM'`, where:
279
+ # The zone value may be a string offset from UTC in the form
280
+ # <code>'+HH:MM'</code> or <code>'-HH:MM'</code>, where:
281
281
  #
282
- # * `HH` is the 2-digit hour in the range `0..23`.
283
- # * `MM` is the 2-digit minute in the range `0..59`.
282
+ # * `HH` is the 2-digit hour in the range <code>0..23</code>.
283
+ # * `MM` is the 2-digit minute in the range <code>0..59</code>.
284
284
  #
285
285
  # Examples:
286
286
  #
@@ -290,8 +290,8 @@
290
290
  #
291
291
  # ### Single-Letter Offsets
292
292
  #
293
- # The zone value may be a letter in the range `'A'..'I'` or `'K'..'Z'`; see
294
- # [List of military time
293
+ # The zone value may be a letter in the range <code>'A'..'I'</code> or
294
+ # <code>'K'..'Z'</code>; see [List of military time
295
295
  # zones](https://en.wikipedia.org/wiki/List_of_military_time_zones):
296
296
  #
297
297
  # t = Time.utc(2000, 1, 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
@@ -304,7 +304,7 @@
304
304
  # ### Integer Offsets
305
305
  #
306
306
  # The zone value may be an integer number of seconds in the range
307
- # `-86399..86399`:
307
+ # <code>-86399..86399</code>:
308
308
  #
309
309
  # t = Time.utc(2000, 1, 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
310
310
  # Time.at(t, in: -86399) # => 1999-12-31 20:15:02 -235959
@@ -321,7 +321,7 @@
321
321
  # * `local_to_utc`:
322
322
  #
323
323
  # Called when Time.new is invoked with `tz` as the value of positional
324
- # argument `zone` or keyword argument `in:`.
324
+ # argument `zone` or keyword argument <code>in:</code>.
325
325
  #
326
326
  # Argument
327
327
  # : a [Time-like object](rdoc-ref:Time@Time-Like+Objects).
@@ -334,8 +334,9 @@
334
334
  # * `utc_to_local`:
335
335
  #
336
336
  # Called when Time.at or Time.now is invoked with `tz` as the value for
337
- # keyword argument `in:`, and when Time#getlocal or Time#localtime is called
338
- # with `tz` as the value for positional argument `zone`.
337
+ # keyword argument <code>in:</code>, and when Time#getlocal or
338
+ # Time#localtime is called with `tz` as the value for positional argument
339
+ # `zone`.
339
340
  #
340
341
  # The UTC offset will be calculated as the difference between the original
341
342
  # time and the returned object as an `Integer`. If the object is in fixed
@@ -354,7 +355,8 @@
354
355
  #
355
356
  # * `abbr`:
356
357
  #
357
- # Called when Time#strftime is invoked with a format involving `%Z`.
358
+ # Called when Time#strftime is invoked with a format involving
359
+ # <code>%Z</code>.
358
360
  #
359
361
  # Argument
360
362
  # : a [Time-like object](rdoc-ref:Time@Time-Like+Objects).
@@ -363,11 +365,12 @@
363
365
  # : a string abbreviation for the timezone name.
364
366
  #
365
367
  #
366
- # * `dst?`:
368
+ # * <code>dst?</code>:
367
369
  #
368
370
  # Called when Time.at or Time.now is invoked with `tz` as the value for
369
- # keyword argument `in:`, and when Time#getlocal or Time#localtime is called
370
- # with `tz` as the value for positional argument `zone`.
371
+ # keyword argument <code>in:</code>, and when Time#getlocal or
372
+ # Time#localtime is called with `tz` as the value for positional argument
373
+ # `zone`.
371
374
  #
372
375
  # Argument
373
376
  # : a [Time-like object](rdoc-ref:Time@Time-Like+Objects).
@@ -378,7 +381,7 @@
378
381
  #
379
382
  # * `name`:
380
383
  #
381
- # Called when `Marshal.dump(t)` is invoked
384
+ # Called when <code>Marshal.dump(t)</code> is invoked
382
385
  #
383
386
  # Argument
384
387
  # : none.
@@ -472,7 +475,7 @@ class Time < Object
472
475
  # Required argument `time` may be either of:
473
476
  #
474
477
  # * A `Time` object, whose value is the basis for the returned time; also
475
- # influenced by optional keyword argument `in:` (see below).
478
+ # influenced by optional keyword argument <code>in:</code> (see below).
476
479
  # * A numeric number of [Epoch seconds](rdoc-ref:Time@Epoch+Seconds) for the
477
480
  # returned time.
478
481
  #
@@ -490,29 +493,29 @@ class Time < Object
490
493
  # together to specify subseconds for the returned time; argument `units`
491
494
  # specifies the units for `subsec`:
492
495
  #
493
- # * `:millisecond`: `subsec` in milliseconds:
496
+ # * <code>:millisecond</code>: `subsec` in milliseconds:
494
497
  #
495
498
  # Time.at(secs, 0, :millisecond) # => 2000-12-31 23:59:59 -0600
496
499
  # Time.at(secs, 500, :millisecond) # => 2000-12-31 23:59:59.5 -0600
497
500
  # Time.at(secs, 1000, :millisecond) # => 2001-01-01 00:00:00 -0600
498
501
  # Time.at(secs, -1000, :millisecond) # => 2000-12-31 23:59:58 -0600
499
502
  #
500
- # * `:microsecond` or `:usec`: `subsec` in microseconds:
503
+ # * <code>:microsecond</code> or <code>:usec</code>: `subsec` in microseconds:
501
504
  #
502
505
  # Time.at(secs, 0, :microsecond) # => 2000-12-31 23:59:59 -0600
503
506
  # Time.at(secs, 500000, :microsecond) # => 2000-12-31 23:59:59.5 -0600
504
507
  # Time.at(secs, 1000000, :microsecond) # => 2001-01-01 00:00:00 -0600
505
508
  # Time.at(secs, -1000000, :microsecond) # => 2000-12-31 23:59:58 -0600
506
509
  #
507
- # * `:nanosecond` or `:nsec`: `subsec` in nanoseconds:
510
+ # * <code>:nanosecond</code> or <code>:nsec</code>: `subsec` in nanoseconds:
508
511
  #
509
512
  # Time.at(secs, 0, :nanosecond) # => 2000-12-31 23:59:59 -0600
510
513
  # Time.at(secs, 500000000, :nanosecond) # => 2000-12-31 23:59:59.5 -0600
511
514
  # Time.at(secs, 1000000000, :nanosecond) # => 2001-01-01 00:00:00 -0600
512
515
  # Time.at(secs, -1000000000, :nanosecond) # => 2000-12-31 23:59:58 -0600
513
516
  #
514
- # Optional keyword argument `in: zone` specifies the timezone for the returned
515
- # time:
517
+ # Optional keyword argument <code>in: zone</code> specifies the timezone for the
518
+ # returned time:
516
519
  #
517
520
  # Time.at(secs, in: '+12:00') # => 2001-01-01 17:59:59 +1200
518
521
  # Time.at(secs, in: '-12:00') # => 2000-12-31 17:59:59 -1200
@@ -797,7 +800,7 @@ class Time < Object
797
800
  # -->
798
801
  # Compares `self` with `other_time`; returns:
799
802
  #
800
- # * `-1`, if `self` is less than `other_time`.
803
+ # * <code>-1</code>, if `self` is less than `other_time`.
801
804
  # * `0`, if `self` is equal to `other_time`.
802
805
  # * `1`, if `self` is greater then `other_time`.
803
806
  # * `nil`, if `self` and `other_time` are incomparable.
@@ -825,9 +828,9 @@ class Time < Object
825
828
  def >=: (Time arg0) -> bool
826
829
 
827
830
  # <!-- rdoc-file=time.c -->
828
- # Returns a string representation of `self`, formatted by `strftime('%a %b %e %T
829
- # %Y')` or its shorthand version `strftime('%c')`; see [Formats for Dates and
830
- # Times](rdoc-ref:strftime_formatting.rdoc):
831
+ # Returns a string representation of `self`, formatted by <code>strftime('%a %b
832
+ # %e %T %Y')</code> or its shorthand version <code>strftime('%c')</code>; see
833
+ # [Formats for Dates and Times](rdoc-ref:strftime_formatting.rdoc):
831
834
  #
832
835
  # t = Time.new(2000, 12, 31, 23, 59, 59, 0.5)
833
836
  # t.ctime # => "Sun Dec 31 23:59:59 2000"
@@ -845,9 +848,9 @@ class Time < Object
845
848
  # rdoc-file=time.c
846
849
  # - ctime -> string
847
850
  # -->
848
- # Returns a string representation of `self`, formatted by `strftime('%a %b %e %T
849
- # %Y')` or its shorthand version `strftime('%c')`; see [Formats for Dates and
850
- # Times](rdoc-ref:strftime_formatting.rdoc):
851
+ # Returns a string representation of `self`, formatted by <code>strftime('%a %b
852
+ # %e %T %Y')</code> or its shorthand version <code>strftime('%c')</code>; see
853
+ # [Formats for Dates and Times](rdoc-ref:strftime_formatting.rdoc):
851
854
  #
852
855
  # t = Time.new(2000, 12, 31, 23, 59, 59, 0.5)
853
856
  # t.ctime # => "Sun Dec 31 23:59:59 2000"
@@ -877,8 +880,10 @@ class Time < Object
877
880
  # - deconstruct_keys(array_of_names_or_nil) -> hash
878
881
  # -->
879
882
  # Returns a hash of the name/value pairs, to use in pattern matching. Possible
880
- # keys are: `:year`, `:month`, `:day`, `:yday`, `:wday`, `:hour`, `:min`,
881
- # `:sec`, `:subsec`, `:dst`, `:zone`.
883
+ # keys are: <code>:year</code>, <code>:month</code>, <code>:day</code>,
884
+ # <code>:yday</code>, <code>:wday</code>, <code>:hour</code>, <code>:min</code>,
885
+ # <code>:sec</code>, <code>:subsec</code>, <code>:dst</code>,
886
+ # <code>:zone</code>.
882
887
  #
883
888
  # Possible usages:
884
889
  #
@@ -1135,9 +1140,9 @@ class Time < Object
1135
1140
  # # => ["0", "1", "1", "0", "0", "0"]
1136
1141
  # Time.new(*a) # => 0000-01-01 00:00:00 -0600
1137
1142
  #
1138
- # When positional argument `zone` or keyword argument `in:` is given, the new
1139
- # `Time` object is in the specified timezone. For the forms of argument `zone`,
1140
- # see [Timezone Specifiers](rdoc-ref:Time@Timezone+Specifiers):
1143
+ # When positional argument `zone` or keyword argument <code>in:</code> is given,
1144
+ # the new `Time` object is in the specified timezone. For the forms of argument
1145
+ # `zone`, see [Timezone Specifiers](rdoc-ref:Time@Timezone+Specifiers):
1141
1146
  #
1142
1147
  # Time.new(2000, 1, 1, 0, 0, 0, '+12:00')
1143
1148
  # # => 2000-01-01 00:00:00 +1200
@@ -1146,9 +1151,9 @@ class Time < Object
1146
1151
  # Time.new(in: '-12:00')
1147
1152
  # # => 2022-08-23 08:49:26.1941467 -1200
1148
1153
  #
1149
- # Since `in:` keyword argument just provides the default, so if the first
1150
- # argument in single string form contains time zone information, this keyword
1151
- # argument will be silently ignored.
1154
+ # Since <code>in:</code> keyword argument just provides the default, so if the
1155
+ # first argument in single string form contains time zone information, this
1156
+ # keyword argument will be silently ignored.
1152
1157
  #
1153
1158
  # Time.new('2000-01-01 00:00:00 +0100', in: '-0500').utc_offset # => 3600
1154
1159
  #
data/core/trace_point.rbs CHANGED
@@ -21,62 +21,62 @@
21
21
  # If you don't specify the types of events you want to listen for, TracePoint
22
22
  # will include all available events.
23
23
  #
24
- # **Note:** Do not depend on the current event set, as this list is subject to
25
- # change. Instead, it is recommended to specify the types of events you want to
26
- # use.
24
+ # <strong>Note:</strong> Do not depend on the current event set, as this list is
25
+ # subject to change. Instead, it is recommended to specify the types of events
26
+ # you want to use.
27
27
  #
28
28
  # To filter what is traced, you can pass any number of the following as
29
29
  # `events`:
30
30
  #
31
- # `:line`
31
+ # <code>:line</code>
32
32
  # : Execute an expression or statement on a new line.
33
33
  #
34
- # `:class`
34
+ # <code>:class</code>
35
35
  # : Start a class or module definition.
36
36
  #
37
- # `:end`
37
+ # <code>:end</code>
38
38
  # : Finish a class or module definition.
39
39
  #
40
- # `:call`
40
+ # <code>:call</code>
41
41
  # : Call a Ruby method.
42
42
  #
43
- # `:return`
43
+ # <code>:return</code>
44
44
  # : Return from a Ruby method.
45
45
  #
46
- # `:c_call`
46
+ # <code>:c_call</code>
47
47
  # : Call a C-language routine.
48
48
  #
49
- # `:c_return`
49
+ # <code>:c_return</code>
50
50
  # : Return from a C-language routine.
51
51
  #
52
- # `:raise`
52
+ # <code>:raise</code>
53
53
  # : Raise an exception.
54
54
  #
55
- # `:rescue`
55
+ # <code>:rescue</code>
56
56
  # : Rescue an exception.
57
57
  #
58
- # `:b_call`
58
+ # <code>:b_call</code>
59
59
  # : Event hook at block entry.
60
60
  #
61
- # `:b_return`
61
+ # <code>:b_return</code>
62
62
  # : Event hook at block ending.
63
63
  #
64
- # `:a_call`
64
+ # <code>:a_call</code>
65
65
  # : Event hook at all calls (`call`, `b_call`, and `c_call`).
66
66
  #
67
- # `:a_return`
67
+ # <code>:a_return</code>
68
68
  # : Event hook at all returns (`return`, `b_return`, and `c_return`).
69
69
  #
70
- # `:thread_begin`
70
+ # <code>:thread_begin</code>
71
71
  # : Event hook at thread beginning.
72
72
  #
73
- # `:thread_end`
73
+ # <code>:thread_end</code>
74
74
  # : Event hook at thread ending.
75
75
  #
76
- # `:fiber_switch`
76
+ # <code>:fiber_switch</code>
77
77
  # : Event hook at fiber switch.
78
78
  #
79
- # `:script_compiled`
79
+ # <code>:script_compiled</code>
80
80
  # : New Ruby code compiled (with `eval`, `load`, or `require`).
81
81
  #
82
82
  class TracePoint
@@ -140,7 +140,7 @@ class TracePoint
140
140
  #
141
141
  # If called when reentrance is already allowed, it raises a RuntimeError.
142
142
  #
143
- # **Example:**
143
+ # <strong>Example:</strong>
144
144
  #
145
145
  # # Without reentry
146
146
  # # ---------------
@@ -223,8 +223,8 @@ class TracePoint
223
223
  # -->
224
224
  # Returns the generated binding object from the event.
225
225
  #
226
- # Note that for `:c_call` and `:c_return` events, the method returns `nil`,
227
- # since C methods themselves do not have bindings.
226
+ # Note that for <code>:c_call</code> and <code>:c_return</code> events, the
227
+ # method returns `nil`, since C methods themselves do not have bindings.
228
228
  #
229
229
  def binding: () -> Binding?
230
230
 
@@ -259,12 +259,13 @@ class TracePoint
259
259
  # C.new.foo
260
260
  # end
261
261
  #
262
- # **Note:** #defined_class returns the singleton class.
262
+ # <strong>Note:</strong> #defined_class returns the singleton class.
263
263
  #
264
264
  # The 6th block parameter of Kernel#set_trace_func passes the original class
265
265
  # attached by the singleton class.
266
266
  #
267
- # **This is a difference between Kernel#set_trace_func and TracePoint.**
267
+ # <strong>This is a difference between Kernel#set_trace_func and
268
+ # TracePoint.</strong>
268
269
  #
269
270
  # class C; def self.foo; end; end
270
271
  # trace = TracePoint.new(:call) do |tp|
@@ -432,8 +433,8 @@ class TracePoint
432
433
  # rdoc-file=trace_point.rb
433
434
  # - raised_exception()
434
435
  # -->
435
- # Returns the exception raised on the `:raise` event or rescued on the `:rescue`
436
- # event.
436
+ # Returns the exception raised on the <code>:raise</code> event or rescued on
437
+ # the <code>:rescue</code> event.
437
438
  #
438
439
  def raised_exception: () -> Exception
439
440
 
@@ -441,7 +442,8 @@ class TracePoint
441
442
  # rdoc-file=trace_point.rb
442
443
  # - return_value()
443
444
  # -->
444
- # Returns the return value from `:return`, `:c_return`, and `:b_return` events.
445
+ # Returns the return value from <code>:return</code>, <code>:c_return</code>,
446
+ # and <code>:b_return</code> events.
445
447
  #
446
448
  def return_value: () -> untyped
447
449
 
@@ -452,7 +454,7 @@ class TracePoint
452
454
  # Returns the trace object during the event.
453
455
  #
454
456
  # Similar to the following, but it returns the correct object (the method
455
- # receiver) for `:c_call` and `:c_return` events:
457
+ # receiver) for <code>:c_call</code> and <code>:c_return</code> events:
456
458
  #
457
459
  # trace.binding.eval('self')
458
460
  #
@@ -463,7 +465,7 @@ class TracePoint
463
465
  # - eval_script()
464
466
  # -->
465
467
  # Returns the compiled source code (String) from eval methods on the
466
- # `:script_compiled` event. If loaded from a file, it returns `nil`.
468
+ # <code>:script_compiled</code> event. If loaded from a file, it returns `nil`.
467
469
  #
468
470
  def eval_script: () -> String?
469
471
 
@@ -472,7 +474,8 @@ class TracePoint
472
474
  # - instruction_sequence()
473
475
  # -->
474
476
  # Returns the compiled instruction sequence represented by a
475
- # RubyVM::InstructionSequence instance on the `:script_compiled` event.
477
+ # RubyVM::InstructionSequence instance on the <code>:script_compiled</code>
478
+ # event.
476
479
  #
477
480
  # Note that this method is CRuby-specific.
478
481
  #
data/core/true_class.rbs CHANGED
@@ -58,7 +58,7 @@ class TrueClass
58
58
  | (untyped obj) -> bool
59
59
 
60
60
  # <!-- rdoc-file=object.c -->
61
- # Returns string `'true'`:
61
+ # Returns string <code>'true'</code>:
62
62
  #
63
63
  # true.to_s # => "true"
64
64
  #
@@ -70,7 +70,7 @@ class TrueClass
70
70
  # rdoc-file=object.c
71
71
  # - true.to_s -> 'true'
72
72
  # -->
73
- # Returns string `'true'`:
73
+ # Returns string <code>'true'</code>:
74
74
  #
75
75
  # true.to_s # => "true"
76
76
  #
@@ -150,7 +150,7 @@ class UnboundMethod
150
150
  # - umeth.bind(obj) -> method
151
151
  # -->
152
152
  # Bind *umeth* to *obj*. If Klass was the class from which *umeth* was obtained,
153
- # `obj.kind_of?(Klass)` must be true.
153
+ # <code>obj.kind_of?(Klass)</code> must be true.
154
154
  #
155
155
  # class A
156
156
  # def test
@@ -170,7 +170,7 @@ class UnboundMethod
170
170
  # bm = um.bind(A.new)
171
171
  # bm.call
172
172
  #
173
- # *produces:*
173
+ # <em>produces:</em>
174
174
  #
175
175
  # In test, class = C
176
176
  # In test, class = B
@@ -199,12 +199,12 @@ class UnboundMethod
199
199
  # Net::HTTP.method(:get).inspect
200
200
  # #=> "#<Method: Net::HTTP.get(uri_or_host, path=..., port=...) <skip>/lib/ruby/2.7.0/net/http.rb:457>"
201
201
  #
202
- # `...` in argument definition means argument is optional (has some default
203
- # value).
202
+ # <code>...</code> in argument definition means argument is optional (has some
203
+ # default value).
204
204
  #
205
205
  # For methods defined in C (language core and extensions), location and argument
206
206
  # names can't be extracted, and only generic information is provided in form of
207
- # `*` (any number of arguments) or `_` (some positional argument).
207
+ # <code>*</code> (any number of arguments) or `_` (some positional argument).
208
208
  #
209
209
  # "cat".method(:count).inspect #=> "#<Method: String#count(*)>"
210
210
  # "cat".method(:+).inspect #=> "#<Method: String#+(_)>""
@@ -227,12 +227,12 @@ class UnboundMethod
227
227
  # Net::HTTP.method(:get).inspect
228
228
  # #=> "#<Method: Net::HTTP.get(uri_or_host, path=..., port=...) <skip>/lib/ruby/2.7.0/net/http.rb:457>"
229
229
  #
230
- # `...` in argument definition means argument is optional (has some default
231
- # value).
230
+ # <code>...</code> in argument definition means argument is optional (has some
231
+ # default value).
232
232
  #
233
233
  # For methods defined in C (language core and extensions), location and argument
234
234
  # names can't be extracted, and only generic information is provided in form of
235
- # `*` (any number of arguments) or `_` (some positional argument).
235
+ # <code>*</code> (any number of arguments) or `_` (some positional argument).
236
236
  #
237
237
  # "cat".method(:count).inspect #=> "#<Method: String#count(*)>"
238
238
  # "cat".method(:+).inspect #=> "#<Method: String#+(_)>""
@@ -330,8 +330,8 @@ class UnboundMethod
330
330
  # - umeth.bind_call(recv, args, ...) -> obj
331
331
  # -->
332
332
  # Bind *umeth* to *recv* and then invokes the method with the specified
333
- # arguments. This is semantically equivalent to `umeth.bind(recv).call(args,
334
- # ...)`.
333
+ # arguments. This is semantically equivalent to
334
+ # <code>umeth.bind(recv).call(args, ...)</code>.
335
335
  #
336
336
  def bind_call: (untyped recv, *untyped, **untyped) ?{ (?) -> untyped } -> untyped
337
337
  end
data/core/warning.rbs CHANGED
@@ -5,11 +5,11 @@
5
5
  #
6
6
  # Changing the behavior of Warning.warn is useful to customize how warnings are
7
7
  # handled by Ruby, for instance by filtering some warnings, and/or outputting
8
- # warnings somewhere other than `$stderr`.
8
+ # warnings somewhere other than <code>$stderr</code>.
9
9
  #
10
10
  # If you want to change the behavior of Warning.warn you should use
11
- # `Warning.extend(MyNewModuleWithWarnMethod)` and you can use `super` to get the
12
- # default behavior of printing the warning to `$stderr`.
11
+ # <code>Warning.extend(MyNewModuleWithWarnMethod)</code> and you can use `super`
12
+ # to get the default behavior of printing the warning to <code>$stderr</code>.
13
13
  #
14
14
  # Example:
15
15
  # module MyWarningFilter
@@ -41,18 +41,18 @@ module Warning
41
41
  # Returns the flag to show the warning messages for `category`. Supported
42
42
  # categories are:
43
43
  #
44
- # `:deprecated`
44
+ # <code>:deprecated</code>
45
45
  # : deprecation warnings
46
- # * assignment of non-nil value to `$,` and `$;`
46
+ # * assignment of non-nil value to <code>$,</code> and <code>$;</code>
47
47
  # * keyword arguments
48
48
  # etc.
49
49
  #
50
50
  #
51
- # `:experimental`
51
+ # <code>:experimental</code>
52
52
  # : experimental features
53
53
  #
54
54
  #
55
- # `:performance`
55
+ # <code>:performance</code>
56
56
  # : performance hints
57
57
  # * Shape variation limit
58
58
  #
data/docs/collection.md CHANGED
@@ -189,4 +189,4 @@ If the gem's RBS is included in the gem package, put it as `sig/manifest.yaml`.
189
189
  ## How it works
190
190
 
191
191
  `rbs collection` is integrated with Bundler.
192
- `rbs collection install` command generates `gem_rbs_collection.lock.yaml` from `gem_rbs_collection.yaml` and `Gemfile.lock`. It uses `Gemfile.lock` to detects dependencies.
192
+ `rbs collection install` command generates `rbs_collection.lock.yaml` from `rbs_collection.yaml` and `Gemfile.lock`. It uses `Gemfile.lock` to detects dependencies.