rbs 3.7.0 → 3.8.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +3 -3
  3. data/.github/workflows/ruby.yml +7 -7
  4. data/CHANGELOG.md +52 -0
  5. data/core/array.rbs +1743 -1580
  6. data/core/basic_object.rbs +38 -35
  7. data/core/comparable.rbs +1 -1
  8. data/core/complex.rbs +165 -93
  9. data/core/data.rbs +1 -1
  10. data/core/dir.rbs +1 -17
  11. data/core/encoding.rbs +12 -6
  12. data/core/enumerable.rbs +270 -266
  13. data/core/enumerator.rbs +0 -2
  14. data/core/env.rbs +1 -1
  15. data/core/errno.rbs +33 -16
  16. data/core/errors.rbs +2 -2
  17. data/core/exception.rbs +236 -170
  18. data/core/fiber.rbs +3 -2
  19. data/core/file.rbs +32 -74
  20. data/core/float.rbs +125 -72
  21. data/core/gc.rbs +138 -40
  22. data/core/hash.rbs +120 -141
  23. data/core/integer.rbs +79 -50
  24. data/core/io/buffer.rbs +49 -43
  25. data/core/io.rbs +97 -144
  26. data/core/kernel.rbs +290 -200
  27. data/core/match_data.rbs +76 -2
  28. data/core/math.rbs +0 -36
  29. data/core/module.rbs +28 -23
  30. data/core/nil_class.rbs +0 -3
  31. data/core/numeric.rbs +100 -103
  32. data/core/object.rbs +0 -4
  33. data/core/object_space/weak_key_map.rbs +3 -4
  34. data/core/object_space.rbs +3 -3
  35. data/core/proc.rbs +0 -2
  36. data/core/process.rbs +109 -57
  37. data/core/ractor.rbs +37 -4
  38. data/core/range.rbs +114 -87
  39. data/core/rational.rbs +0 -2
  40. data/core/rbs/unnamed/argf.rbs +234 -33
  41. data/core/rbs/unnamed/env_class.rbs +35 -53
  42. data/core/rbs/unnamed/random.rbs +1 -2
  43. data/core/regexp.rbs +4 -52
  44. data/core/ruby_vm.rbs +88 -9
  45. data/core/rubygems/config_file.rbs +3 -0
  46. data/core/rubygems/errors.rbs +0 -5
  47. data/core/rubygems/platform.rbs +0 -9
  48. data/core/rubygems/rubygems.rbs +0 -5
  49. data/core/rubygems/version.rbs +6 -6
  50. data/core/set.rbs +3 -15
  51. data/core/string.rbs +130 -136
  52. data/core/struct.rbs +6 -18
  53. data/core/symbol.rbs +14 -21
  54. data/core/thread.rbs +32 -35
  55. data/core/time.rbs +127 -50
  56. data/core/trace_point.rbs +16 -0
  57. data/core/true_class.rbs +0 -1
  58. data/core/warning.rbs +9 -2
  59. data/docs/architecture.md +1 -1
  60. data/docs/syntax.md +1 -1
  61. data/ext/rbs_extension/location.c +29 -19
  62. data/ext/rbs_extension/parser.c +267 -292
  63. data/ext/rbs_extension/parserstate.c +56 -22
  64. data/lib/rbs/annotate/annotations.rb +3 -3
  65. data/lib/rbs/annotate/rdoc_source.rb +2 -2
  66. data/lib/rbs/cli/diff.rb +3 -3
  67. data/lib/rbs/cli/validate.rb +1 -1
  68. data/lib/rbs/cli.rb +13 -13
  69. data/lib/rbs/collection/config.rb +3 -1
  70. data/lib/rbs/definition_builder/ancestor_builder.rb +3 -3
  71. data/lib/rbs/environment_loader.rb +1 -1
  72. data/lib/rbs/namespace.rb +1 -0
  73. data/lib/rbs/parser_aux.rb +2 -2
  74. data/lib/rbs/prototype/rb.rb +11 -8
  75. data/lib/rbs/prototype/rbi.rb +9 -5
  76. data/lib/rbs/prototype/runtime/value_object_generator.rb +7 -5
  77. data/lib/rbs/prototype/runtime.rb +4 -5
  78. data/lib/rbs/type_name.rb +14 -9
  79. data/lib/rbs/unit_test/type_assertions.rb +2 -2
  80. data/lib/rbs/validator.rb +3 -1
  81. data/lib/rbs/version.rb +1 -1
  82. data/lib/rdoc_plugin/parser.rb +2 -2
  83. data/rbs.gemspec +4 -0
  84. data/sig/ancestor_graph.rbs +4 -4
  85. data/sig/namespace.rbs +2 -3
  86. data/sig/resolver/constant_resolver.rbs +2 -2
  87. data/sig/resolver/context.rbs +1 -1
  88. data/sig/type_alias_regularity.rbs +5 -5
  89. data/sig/typename.rbs +8 -5
  90. data/sig/use_map.rbs +1 -1
  91. data/sig/validator.rbs +2 -2
  92. data/stdlib/base64/0/base64.rbs +0 -9
  93. data/stdlib/benchmark/0/benchmark.rbs +11 -2
  94. data/stdlib/bigdecimal/0/big_decimal.rbs +26 -182
  95. data/stdlib/cgi/0/core.rbs +47 -0
  96. data/stdlib/coverage/0/coverage.rbs +0 -3
  97. data/stdlib/csv/0/csv.rbs +18 -58
  98. data/stdlib/date/0/date.rbs +4 -19
  99. data/stdlib/did_you_mean/0/did_you_mean.rbs +0 -5
  100. data/stdlib/digest/0/digest.rbs +25 -2
  101. data/stdlib/erb/0/erb.rbs +0 -1
  102. data/stdlib/etc/0/etc.rbs +51 -34
  103. data/stdlib/fileutils/0/fileutils.rbs +3 -44
  104. data/stdlib/io-console/0/io-console.rbs +69 -15
  105. data/stdlib/ipaddr/0/ipaddr.rbs +8 -4
  106. data/stdlib/json/0/json.rbs +56 -71
  107. data/stdlib/logger/0/log_device.rbs +1 -1
  108. data/stdlib/logger/0/logger.rbs +3 -18
  109. data/stdlib/net-http/0/net-http.rbs +19 -77
  110. data/stdlib/nkf/0/nkf.rbs +30 -0
  111. data/stdlib/objspace/0/objspace.rbs +1 -2
  112. data/stdlib/observable/0/observable.rbs +1 -1
  113. data/stdlib/open-uri/0/open-uri.rbs +52 -0
  114. data/stdlib/open3/0/open3.rbs +0 -8
  115. data/stdlib/openssl/0/openssl.rbs +136 -69
  116. data/stdlib/optparse/0/optparse.rbs +58 -18
  117. data/stdlib/pathname/0/pathname.rbs +2 -8
  118. data/stdlib/pp/0/pp.rbs +3 -1
  119. data/stdlib/prettyprint/0/prettyprint.rbs +0 -4
  120. data/stdlib/pstore/0/pstore.rbs +0 -6
  121. data/stdlib/psych/0/psych.rbs +15 -4
  122. data/stdlib/pty/0/pty.rbs +46 -4
  123. data/stdlib/rdoc/0/code_object.rbs +0 -4
  124. data/stdlib/rdoc/0/markup.rbs +10 -12
  125. data/stdlib/rdoc/0/rdoc.rbs +1 -2
  126. data/stdlib/resolv/0/resolv.rbs +8 -3
  127. data/stdlib/ripper/0/ripper.rbs +0 -2
  128. data/stdlib/securerandom/0/securerandom.rbs +0 -2
  129. data/stdlib/shellwords/0/shellwords.rbs +11 -12
  130. data/stdlib/singleton/0/singleton.rbs +0 -1
  131. data/stdlib/socket/0/addrinfo.rbs +0 -1
  132. data/stdlib/socket/0/basic_socket.rbs +0 -5
  133. data/stdlib/socket/0/socket.rbs +49 -25
  134. data/stdlib/socket/0/tcp_server.rbs +0 -3
  135. data/stdlib/socket/0/tcp_socket.rbs +58 -3
  136. data/stdlib/socket/0/udp_socket.rbs +0 -1
  137. data/stdlib/socket/0/unix_server.rbs +0 -3
  138. data/stdlib/strscan/0/string_scanner.rbs +1265 -422
  139. data/stdlib/tempfile/0/tempfile.rbs +135 -28
  140. data/stdlib/time/0/time.rbs +48 -35
  141. data/stdlib/timeout/0/timeout.rbs +11 -8
  142. data/stdlib/tmpdir/0/tmpdir.rbs +8 -1
  143. data/stdlib/tsort/0/tsort.rbs +0 -4
  144. data/stdlib/uri/0/common.rbs +11 -30
  145. data/stdlib/uri/0/ftp.rbs +1 -1
  146. data/stdlib/uri/0/generic.rbs +22 -18
  147. data/stdlib/uri/0/http.rbs +2 -2
  148. data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
  149. data/stdlib/zlib/0/buf_error.rbs +1 -70
  150. data/stdlib/zlib/0/data_error.rbs +1 -70
  151. data/stdlib/zlib/0/deflate.rbs +8 -72
  152. data/stdlib/zlib/0/error.rbs +1 -70
  153. data/stdlib/zlib/0/gzip_file/crc_error.rbs +2 -105
  154. data/stdlib/zlib/0/gzip_file/error.rbs +2 -105
  155. data/stdlib/zlib/0/gzip_file/length_error.rbs +2 -105
  156. data/stdlib/zlib/0/gzip_file/no_footer.rbs +2 -105
  157. data/stdlib/zlib/0/gzip_file.rbs +1 -71
  158. data/stdlib/zlib/0/gzip_reader.rbs +3 -74
  159. data/stdlib/zlib/0/gzip_writer.rbs +1 -70
  160. data/stdlib/zlib/0/inflate.rbs +4 -71
  161. data/stdlib/zlib/0/mem_error.rbs +1 -70
  162. data/stdlib/zlib/0/need_dict.rbs +1 -70
  163. data/stdlib/zlib/0/stream_end.rbs +1 -70
  164. data/stdlib/zlib/0/stream_error.rbs +1 -70
  165. data/stdlib/zlib/0/version_error.rbs +1 -70
  166. data/stdlib/zlib/0/zlib.rbs +0 -2
  167. data/stdlib/zlib/0/zstream.rbs +4 -72
  168. metadata +4 -6
@@ -9,7 +9,6 @@
9
9
  # * Supplements [class File](rdoc-ref:File) (but is not included or extended
10
10
  # there).
11
11
  #
12
- #
13
12
  # Here, module FileUtils provides methods that are useful for:
14
13
  #
15
14
  # * [Creating](rdoc-ref:FileUtils@Creating).
@@ -21,7 +20,6 @@
21
20
  # * [Moving](rdoc-ref:FileUtils@Moving).
22
21
  # * [Options](rdoc-ref:FileUtils@Options).
23
22
  #
24
- #
25
23
  # ### Creating
26
24
  #
27
25
  # * ::mkdir: Creates directories.
@@ -33,7 +31,6 @@
33
31
  # * ::ln_sf: Creates symbolic links, overwriting if necessary.
34
32
  # * ::ln_sr: Creates symbolic links relative to targets
35
33
  #
36
- #
37
34
  # ### Deleting
38
35
  #
39
36
  # * ::remove_dir: Removes a directory and its descendants.
@@ -47,14 +44,12 @@
47
44
  # * ::rm_rf, ::rmtree: Like ::rm_r, but removes forcibly.
48
45
  # * ::rmdir: Removes directories.
49
46
  #
50
- #
51
47
  # ### Querying
52
48
  #
53
49
  # * ::pwd, ::getwd: Returns the path to the working directory.
54
50
  # * ::uptodate?: Returns whether a given entry is newer than given other
55
51
  # entries.
56
52
  #
57
- #
58
53
  # ### Setting
59
54
  #
60
55
  # * ::cd, ::chdir: Sets the working directory.
@@ -65,14 +60,12 @@
65
60
  # * ::touch: Sets modification and access times for entries, creating if
66
61
  # necessary.
67
62
  #
68
- #
69
63
  # ### Comparing
70
64
  #
71
65
  # * ::compare_file, ::cmp, ::identical?: Returns whether two entries are
72
66
  # identical.
73
67
  # * ::compare_stream: Returns whether two streams are identical.
74
68
  #
75
- #
76
69
  # ### Copying
77
70
  #
78
71
  # * ::copy_entry: Recursively copies an entry.
@@ -84,12 +77,10 @@
84
77
  # * ::install: Recursively copies files, optionally setting mode, owner, and
85
78
  # group.
86
79
  #
87
- #
88
80
  # ### Moving
89
81
  #
90
82
  # * ::mv, ::move: Moves entries.
91
83
  #
92
- #
93
84
  # ### Options
94
85
  #
95
86
  # * ::collect_method: Returns the names of methods that accept a given option.
@@ -98,7 +89,6 @@
98
89
  # * ::options: Returns all option names.
99
90
  # * ::options_of: Returns the names of the options for a given method.
100
91
  #
101
- #
102
92
  # ## Path Arguments
103
93
  #
104
94
  # Some methods in FileUtils accept *path* arguments, which are interpreted as
@@ -108,7 +98,6 @@
108
98
  # * If the argument has method `:to_path`, it is converted via that method.
109
99
  # * If the argument has method `:to_str`, it is converted via that method.
110
100
  #
111
- #
112
101
  # ## About the Examples
113
102
  #
114
103
  # Some examples here involve trees of file entries. For these, we sometimes
@@ -149,28 +138,23 @@
149
138
  # * A world-writable descendant directory.
150
139
  # * A symbolic link.
151
140
  #
152
- #
153
- #
154
141
  # To avoid that vulnerability, you can use this method to remove entries:
155
142
  #
156
143
  # * FileUtils.remove_entry_secure: removes recursively if the target path
157
144
  # points to a directory.
158
145
  #
159
- #
160
146
  # Also available are these methods, each of which calls
161
147
  # FileUtils.remove_entry_secure:
162
148
  #
163
149
  # * FileUtils.rm_r with keyword argument `secure: true`.
164
150
  # * FileUtils.rm_rf with keyword argument `secure: true`.
165
151
  #
166
- #
167
152
  # Finally, this method for moving entries calls FileUtils.remove_entry_secure if
168
153
  # the source and destination are on different file systems (which means that the
169
154
  # "move" is really a copy and remove):
170
155
  #
171
156
  # * FileUtils.mv with keyword argument `secure: true`.
172
157
  #
173
- #
174
158
  # Method FileUtils.remove_entry_secure removes securely by applying a special
175
159
  # pre-process:
176
160
  #
@@ -180,7 +164,6 @@
180
164
  # * The owner of the target directory should be either the current process or
181
165
  # the super user (root).
182
166
  #
183
- #
184
167
  # WARNING: You must ensure that **ALL** parent directories cannot be moved by
185
168
  # other untrusted users. For example, parent directories should not be owned by
186
169
  # untrusted users, and should not be world writable except when the sticky bit
@@ -194,6 +177,9 @@
194
177
  # 52).
195
178
  #
196
179
  module FileUtils
180
+ # <!-- rdoc-file=lib/fileutils.rb -->
181
+ # The version number.
182
+ #
197
183
  VERSION: String
198
184
 
199
185
  type mode = Integer | String
@@ -237,7 +223,6 @@ module FileUtils
237
223
  # cd ..
238
224
  # cd fileutils
239
225
  #
240
- #
241
226
  # Related: FileUtils.pwd.
242
227
  #
243
228
  def self?.cd: (path dir, ?verbose: boolish) -> void
@@ -270,7 +255,6 @@ module FileUtils
270
255
  # * Modifies each entry that is a symbolic link using
271
256
  # [File.lchmod](rdoc-ref:File.lchmod).
272
257
  #
273
- #
274
258
  # Argument `list` or its elements should be [interpretable as
275
259
  # paths](rdoc-ref:FileUtils@Path+Arguments).
276
260
  #
@@ -292,14 +276,12 @@ module FileUtils
292
276
  # * `'o'`: permissions apply to other users not in the file's group.
293
277
  # * `'a'` (the default): permissions apply to all users.
294
278
  #
295
- #
296
279
  # * `operator` may be one of these letters:
297
280
  #
298
281
  # * `'+'`: adds permissions.
299
282
  # * `'-'`: removes permissions.
300
283
  # * `'='`: sets (replaces) permissions.
301
284
  #
302
- #
303
285
  # * `perms` (may be repeated, with separating commas) may be any
304
286
  # combination of these letters:
305
287
  #
@@ -310,14 +292,11 @@ module FileUtils
310
292
  # * `'s'`: Uid or gid.
311
293
  # * `'t'`: Sticky bit.
312
294
  #
313
- #
314
- #
315
295
  # Examples:
316
296
  #
317
297
  # FileUtils.chmod('u=wrx,go=rx', 'src1.txt')
318
298
  # FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby')
319
299
  #
320
- #
321
300
  # Keyword arguments:
322
301
  #
323
302
  # * `noop: true` - does not change permissions; returns `nil`.
@@ -335,7 +314,6 @@ module FileUtils
335
314
  # chmod u=wrx,go=rx src1.txt
336
315
  # chmod u=wrx,go=rx /usr/bin/ruby
337
316
  #
338
- #
339
317
  # Related: FileUtils.chmod_R.
340
318
  #
341
319
  def self?.chmod: (mode mode, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
@@ -361,7 +339,6 @@ module FileUtils
361
339
  # * Modifies each entry that is a symbolic link using
362
340
  # [File.lchown](rdoc-ref:File.lchown).
363
341
  #
364
- #
365
342
  # Argument `list` or its elements should be [interpretable as
366
343
  # paths](rdoc-ref:FileUtils@Path+Arguments).
367
344
  #
@@ -373,7 +350,6 @@ module FileUtils
373
350
  # group is not changed.
374
351
  # * The user must be a member of the group.
375
352
  #
376
- #
377
353
  # Examples:
378
354
  #
379
355
  # # One path.
@@ -414,7 +390,6 @@ module FileUtils
414
390
  # chown user2:group1 src0.txt
415
391
  # chown user2:group1 .
416
392
  #
417
- #
418
393
  # Related: FileUtils.chown_R.
419
394
  #
420
395
  def self?.chown: (String? user, String? group, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
@@ -553,7 +528,6 @@ module FileUtils
553
528
  # * `preserve: true` - preserves file times.
554
529
  # * `remove_destination: true` - removes `dest` before copying files.
555
530
  #
556
- #
557
531
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
558
532
  #
559
533
  def self?.copy_entry: (path src, path dest, ?boolish preserve, ?boolish dereference_root, ?boolish remove_destination) -> void
@@ -580,7 +554,6 @@ module FileUtils
580
554
  # * `preserve: true` - preserves file times.
581
555
  # * `remove_destination: true` - removes `dest` before copying files.
582
556
  #
583
- #
584
557
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
585
558
  #
586
559
  def self?.copy_file: (path src, path dest, ?boolish preserve, ?boolish dereference) -> void
@@ -647,7 +620,6 @@ module FileUtils
647
620
  # cp src1.txt dest1
648
621
  # cp src2.txt src2.dat dest2
649
622
  #
650
- #
651
623
  # Raises an exception if `src` is a directory.
652
624
  #
653
625
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
@@ -763,7 +735,6 @@ module FileUtils
763
735
  # cp -lr src1 dest1
764
736
  # cp -lr src2/sub0 src2/sub1 dest2
765
737
  #
766
- #
767
738
  # Raises an exception if `dest` is the path to an existing file or directory and
768
739
  # keyword argument `remove_destination: true` is not given.
769
740
  #
@@ -869,7 +840,6 @@ module FileUtils
869
840
  # cp -r src2 dest2
870
841
  # cp -r src3 dest3
871
842
  #
872
- #
873
843
  # Raises an exception of `src` is the path to a directory and `dest` is the path
874
844
  # to a file.
875
845
  #
@@ -954,7 +924,6 @@ module FileUtils
954
924
  # install -c src1.txt dest1.txt
955
925
  # install -c src2.txt dest2
956
926
  #
957
- #
958
927
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
959
928
  #
960
929
  def self?.install: (path src, path dest, ?mode: mode?, ?owner: String?, ?group: String?, ?preserve: boolish, ?noop: boolish, ?verbose: boolish) -> void
@@ -999,7 +968,6 @@ module FileUtils
999
968
  # * `dereference_root: true` - dereferences `src` if it is a symbolic link.
1000
969
  # * `remove_destination: true` - removes `dest` before creating links.
1001
970
  #
1002
- #
1003
971
  # Raises an exception if `dest` is the path to an existing file or directory and
1004
972
  # keyword argument `remove_destination: true` is not given.
1005
973
  #
@@ -1058,7 +1026,6 @@ module FileUtils
1058
1026
  # ln tmp2/t.dat tmp3
1059
1027
  # ln tmp0/t.txt tmp2/t.dat tmp4/
1060
1028
  #
1061
- #
1062
1029
  # Raises an exception if `dest` is the path to an existing file and keyword
1063
1030
  # argument `force` is not `true`.
1064
1031
  #
@@ -1110,7 +1077,6 @@ module FileUtils
1110
1077
  #
1111
1078
  # FileUtils.ln_s('src1.txt', 'dest1.txt') # Raises Errno::EEXIST.
1112
1079
  #
1113
- #
1114
1080
  # If `dest` is the path to a directory, creates a symbolic link at `dest/src`
1115
1081
  # pointing to `src`:
1116
1082
  #
@@ -1150,7 +1116,6 @@ module FileUtils
1150
1116
  # ln -sf src2.txt dest2.txt
1151
1117
  # ln -s srcdir3/src0.txt srcdir3/src1.txt destdir3
1152
1118
  #
1153
- #
1154
1119
  # Related: FileUtils.ln_sf.
1155
1120
  #
1156
1121
  def self?.ln_s: (pathlist src, path dest, ?force: boolish, ?relative: boolish, ?target_directory: boolish, ?noop: boolish, ?verbose: boolish) -> void
@@ -1216,7 +1181,6 @@ module FileUtils
1216
1181
  # mkdir tmp0 tmp1
1217
1182
  # mkdir -m 700 tmp2 tmp3
1218
1183
  #
1219
- #
1220
1184
  # Raises an exception if any path points to an existing file or directory, or if
1221
1185
  # for any reason a directory cannot be created.
1222
1186
  #
@@ -1257,7 +1221,6 @@ module FileUtils
1257
1221
  # mkdir -p tmp0 tmp1
1258
1222
  # mkdir -p -m 700 tmp2 tmp3
1259
1223
  #
1260
- #
1261
1224
  # Raises an exception if for any reason a directory cannot be created.
1262
1225
  #
1263
1226
  # FileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.
@@ -1524,7 +1487,6 @@ module FileUtils
1524
1487
  #
1525
1488
  # rm src0.dat src0.txt
1526
1489
  #
1527
- #
1528
1490
  # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1529
1491
  #
1530
1492
  def self?.rm: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish) -> void
@@ -1625,7 +1587,6 @@ module FileUtils
1625
1587
  # rm -r src0.dat src0.txt
1626
1588
  # rm -r src1
1627
1589
  #
1628
- #
1629
1590
  # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1630
1591
  #
1631
1592
  def self?.rm_r: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish, ?secure: boolish) -> void
@@ -1695,7 +1656,6 @@ module FileUtils
1695
1656
  # rmdir -p tmp0/tmp1 tmp2/tmp3
1696
1657
  # rmdir -p tmp4/tmp5
1697
1658
  #
1698
- #
1699
1659
  # Raises an exception if a directory does not exist or if for any reason a
1700
1660
  # directory cannot be removed.
1701
1661
  #
@@ -1749,7 +1709,6 @@ module FileUtils
1749
1709
  # touch src0.txt src0.dat
1750
1710
  # touch src0.txt
1751
1711
  #
1752
- #
1753
1712
  # Related: FileUtils.uptodate?.
1754
1713
  #
1755
1714
  def self?.touch: (pathlist list, ?noop: boolish, ?verbose: boolish, ?mtime: (Time | Numeric)?, ?nocreate: boolish) -> void
@@ -39,22 +39,33 @@ class IO
39
39
 
40
40
  # <!--
41
41
  # rdoc-file=ext/io/console/console.c
42
- # - beep()
42
+ # - io.beep
43
43
  # -->
44
+ # Beeps on the output console.
45
+ #
46
+ # You must require 'io/console' to use this method.
44
47
  #
45
48
  def beep: () -> self
46
49
 
47
50
  # <!--
48
51
  # rdoc-file=ext/io/console/console.c
49
- # - check_winsize_changed()
52
+ # - io.check_winsize_changed { ... } -> io
50
53
  # -->
54
+ # Yields while console input events are queued.
55
+ #
56
+ # This method is Windows only.
57
+ #
58
+ # You must require 'io/console' to use this method.
51
59
  #
52
60
  def check_winsize_changed: () { () -> void } -> self
53
61
 
54
62
  # <!--
55
63
  # rdoc-file=ext/io/console/console.c
56
- # - clear_screen()
64
+ # - io.clear_screen -> io
57
65
  # -->
66
+ # Clears the entire screen and moves the cursor top-left corner.
67
+ #
68
+ # You must require 'io/console' to use this method.
58
69
  #
59
70
  def clear_screen: () -> self
60
71
 
@@ -119,36 +130,53 @@ class IO
119
130
 
120
131
  # <!--
121
132
  # rdoc-file=ext/io/console/console.c
122
- # - cursor=(p1)
133
+ # - io.cursor = [line, column] -> io
123
134
  # -->
135
+ # Same as `io.goto(line, column)`
136
+ #
137
+ # See IO#goto.
138
+ #
139
+ # You must require 'io/console' to use this method.
124
140
  #
125
141
  def cursor=: ([ Integer, Integer ]) -> [ Integer, Integer ]
126
142
 
127
143
  # <!--
128
144
  # rdoc-file=ext/io/console/console.c
129
- # - cursor_down(p1)
145
+ # - io.cursor_down(n) -> io
130
146
  # -->
147
+ # Moves the cursor down `n` lines.
148
+ #
149
+ # You must require 'io/console' to use this method.
131
150
  #
132
151
  def cursor_down: (int) -> self
133
152
 
134
153
  # <!--
135
154
  # rdoc-file=ext/io/console/console.c
136
- # - cursor_left(p1)
155
+ # - io.cursor_left(n) -> io
137
156
  # -->
157
+ # Moves the cursor left `n` columns.
158
+ #
159
+ # You must require 'io/console' to use this method.
138
160
  #
139
161
  def cursor_left: (int) -> self
140
162
 
141
163
  # <!--
142
164
  # rdoc-file=ext/io/console/console.c
143
- # - cursor_right(p1)
165
+ # - io.cursor_right(n) -> io
144
166
  # -->
167
+ # Moves the cursor right `n` columns.
168
+ #
169
+ # You must require 'io/console' to use this method.
145
170
  #
146
171
  def cursor_right: (int) -> self
147
172
 
148
173
  # <!--
149
174
  # rdoc-file=ext/io/console/console.c
150
- # - cursor_up(p1)
175
+ # - io.cursor_up(n) -> io
151
176
  # -->
177
+ # Moves the cursor up `n` lines.
178
+ #
179
+ # You must require 'io/console' to use this method.
152
180
  #
153
181
  def cursor_up: (int) -> self
154
182
 
@@ -175,15 +203,23 @@ class IO
175
203
 
176
204
  # <!--
177
205
  # rdoc-file=ext/io/console/console.c
178
- # - erase_line(p1)
206
+ # - io.erase_line(mode) -> io
179
207
  # -->
208
+ # Erases the line at the cursor corresponding to `mode`. `mode` may be either:
209
+ # 0: after cursor 1: before and cursor 2: entire line
210
+ #
211
+ # You must require 'io/console' to use this method.
180
212
  #
181
213
  def erase_line: (0 | 1 | 2 | nil) -> self
182
214
 
183
215
  # <!--
184
216
  # rdoc-file=ext/io/console/console.c
185
- # - erase_screen(p1)
217
+ # - io.erase_screen(mode) -> io
186
218
  # -->
219
+ # Erases the screen at the cursor corresponding to `mode`. `mode` may be either:
220
+ # 0: after cursor 1: before and cursor 2: entire screen
221
+ #
222
+ # You must require 'io/console' to use this method.
187
223
  #
188
224
  def erase_screen: (0 | 1 | 2 | 3 | nil) -> self
189
225
 
@@ -220,15 +256,21 @@ class IO
220
256
 
221
257
  # <!--
222
258
  # rdoc-file=ext/io/console/console.c
223
- # - goto(p1, p2)
259
+ # - io.goto(line, column) -> io
224
260
  # -->
261
+ # Set the cursor position at `line` and `column`.
262
+ #
263
+ # You must require 'io/console' to use this method.
225
264
  #
226
265
  def goto: (int, int) -> self
227
266
 
228
267
  # <!--
229
268
  # rdoc-file=ext/io/console/console.c
230
- # - goto_column(p1)
269
+ # - io.goto_column(column) -> io
231
270
  # -->
271
+ # Set the cursor position at `column` in the same line of the current position.
272
+ #
273
+ # You must require 'io/console' to use this method.
232
274
  #
233
275
  def goto_column: (int) -> self
234
276
 
@@ -278,8 +320,14 @@ class IO
278
320
 
279
321
  # <!--
280
322
  # rdoc-file=ext/io/console/console.c
281
- # - pressed?(p1)
323
+ # - io.pressed?(key) -> bool
282
324
  # -->
325
+ # Returns `true` if `key` is pressed. `key` may be a virtual key code or its
326
+ # name (String or Symbol) with out "VK_" prefix.
327
+ #
328
+ # This method is Windows only.
329
+ #
330
+ # You must require 'io/console' to use this method.
283
331
  #
284
332
  def pressed?: (Integer | interned) -> bool
285
333
 
@@ -324,15 +372,21 @@ class IO
324
372
 
325
373
  # <!--
326
374
  # rdoc-file=ext/io/console/console.c
327
- # - scroll_backward(p1)
375
+ # - io.scroll_backward(n) -> io
328
376
  # -->
377
+ # Scrolls the entire scrolls backward `n` lines.
378
+ #
379
+ # You must require 'io/console' to use this method.
329
380
  #
330
381
  def scroll_backward: (int) -> self
331
382
 
332
383
  # <!--
333
384
  # rdoc-file=ext/io/console/console.c
334
- # - scroll_forward(p1)
385
+ # - io.scroll_forward(n) -> io
335
386
  # -->
387
+ # Scrolls the entire scrolls forward `n` lines.
388
+ #
389
+ # You must require 'io/console' to use this method.
336
390
  #
337
391
  def scroll_forward: (int) -> self
338
392
 
@@ -37,7 +37,8 @@ class IPAddr
37
37
  # - ntop(addr)
38
38
  # -->
39
39
  # Convert a network byte ordered string form of an IP address into human
40
- # readable form.
40
+ # readable form. It expects the string to be encoded in Encoding::ASCII_8BIT
41
+ # (BINARY).
41
42
  #
42
43
  def self.ntop: (String addr) -> String
43
44
 
@@ -240,8 +241,10 @@ class IPAddr
240
241
  # - link_local?()
241
242
  # -->
242
243
  # Returns true if the ipaddr is a link-local address. IPv4 addresses in
243
- # 169.254.0.0/16 reserved by RFC 3927 and Link-Local IPv6 Unicast Addresses in
244
- # fe80::/10 reserved by RFC 4291 are considered link-local.
244
+ # 169.254.0.0/16 reserved by RFC 3927 and link-local IPv6 Unicast Addresses in
245
+ # fe80::/10 reserved by RFC 4291 are considered link-local. Link-local IPv4
246
+ # addresses in the IPv4-mapped IPv6 address range are also considered
247
+ # link-local.
245
248
  #
246
249
  def link_local?: () -> bool
247
250
 
@@ -249,7 +252,8 @@ class IPAddr
249
252
  # rdoc-file=lib/ipaddr.rb
250
253
  # - loopback?()
251
254
  # -->
252
- # Returns true if the ipaddr is a loopback address.
255
+ # Returns true if the ipaddr is a loopback address. Loopback IPv4 addresses in
256
+ # the IPv4-mapped IPv6 address range are also considered as loopback addresses.
253
257
  #
254
258
  def loopback?: () -> bool
255
259