rbs 4.0.0.dev.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 (281) 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 +18 -11
  5. data/.github/workflows/comments.yml +5 -3
  6. data/.github/workflows/dependabot.yml +2 -2
  7. data/.github/workflows/ruby.yml +27 -34
  8. data/.github/workflows/rust.yml +95 -0
  9. data/.github/workflows/typecheck.yml +2 -2
  10. data/.github/workflows/windows.yml +2 -2
  11. data/.rubocop.yml +1 -1
  12. data/CHANGELOG.md +323 -0
  13. data/README.md +1 -1
  14. data/Rakefile +43 -33
  15. data/Steepfile +1 -0
  16. data/config.yml +426 -24
  17. data/core/array.rbs +307 -227
  18. data/core/basic_object.rbs +9 -8
  19. data/core/binding.rbs +0 -2
  20. data/core/builtin.rbs +2 -2
  21. data/core/class.rbs +6 -5
  22. data/core/comparable.rbs +55 -34
  23. data/core/complex.rbs +104 -78
  24. data/core/dir.rbs +61 -49
  25. data/core/encoding.rbs +12 -15
  26. data/core/enumerable.rbs +179 -87
  27. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  28. data/core/enumerator.rbs +65 -2
  29. data/core/errno.rbs +11 -2
  30. data/core/errors.rbs +58 -29
  31. data/core/exception.rbs +13 -13
  32. data/core/fiber.rbs +74 -54
  33. data/core/file.rbs +280 -177
  34. data/core/file_test.rbs +3 -3
  35. data/core/float.rbs +257 -92
  36. data/core/gc.rbs +425 -281
  37. data/core/hash.rbs +1045 -739
  38. data/core/integer.rbs +135 -137
  39. data/core/io/buffer.rbs +53 -42
  40. data/core/io/wait.rbs +13 -35
  41. data/core/io.rbs +192 -144
  42. data/core/kernel.rbs +216 -155
  43. data/core/marshal.rbs +4 -4
  44. data/core/match_data.rbs +15 -13
  45. data/core/math.rbs +107 -66
  46. data/core/method.rbs +69 -33
  47. data/core/module.rbs +244 -106
  48. data/core/nil_class.rbs +7 -6
  49. data/core/numeric.rbs +74 -63
  50. data/core/object.rbs +9 -11
  51. data/core/object_space.rbs +30 -23
  52. data/core/pathname.rbs +1322 -0
  53. data/core/proc.rbs +95 -58
  54. data/core/process.rbs +222 -202
  55. data/core/ractor.rbs +371 -515
  56. data/core/random.rbs +21 -3
  57. data/core/range.rbs +159 -57
  58. data/core/rational.rbs +60 -89
  59. data/core/rbs/unnamed/argf.rbs +60 -53
  60. data/core/rbs/unnamed/env_class.rbs +19 -14
  61. data/core/rbs/unnamed/main_class.rbs +123 -0
  62. data/core/rbs/unnamed/random.rbs +11 -118
  63. data/core/regexp.rbs +258 -214
  64. data/core/ruby.rbs +53 -0
  65. data/core/ruby_vm.rbs +38 -34
  66. data/core/rubygems/config_file.rbs +5 -5
  67. data/core/rubygems/errors.rbs +4 -71
  68. data/core/rubygems/requirement.rbs +5 -5
  69. data/core/rubygems/rubygems.rbs +16 -82
  70. data/core/rubygems/version.rbs +2 -3
  71. data/core/set.rbs +490 -360
  72. data/core/signal.rbs +26 -16
  73. data/core/string.rbs +3234 -1285
  74. data/core/struct.rbs +27 -26
  75. data/core/symbol.rbs +41 -34
  76. data/core/thread.rbs +135 -67
  77. data/core/time.rbs +81 -50
  78. data/core/trace_point.rbs +41 -35
  79. data/core/true_class.rbs +2 -2
  80. data/core/unbound_method.rbs +24 -16
  81. data/core/warning.rbs +7 -7
  82. data/docs/aliases.md +79 -0
  83. data/docs/collection.md +3 -3
  84. data/docs/config.md +171 -0
  85. data/docs/encoding.md +56 -0
  86. data/docs/gem.md +0 -1
  87. data/docs/inline.md +576 -0
  88. data/docs/sigs.md +3 -3
  89. data/docs/syntax.md +46 -16
  90. data/docs/type_fingerprint.md +21 -0
  91. data/exe/rbs +1 -1
  92. data/ext/rbs_extension/ast_translation.c +544 -116
  93. data/ext/rbs_extension/ast_translation.h +3 -0
  94. data/ext/rbs_extension/class_constants.c +16 -2
  95. data/ext/rbs_extension/class_constants.h +8 -0
  96. data/ext/rbs_extension/extconf.rb +5 -1
  97. data/ext/rbs_extension/legacy_location.c +33 -56
  98. data/ext/rbs_extension/legacy_location.h +37 -0
  99. data/ext/rbs_extension/main.c +44 -35
  100. data/include/rbs/ast.h +448 -173
  101. data/include/rbs/defines.h +27 -0
  102. data/include/rbs/lexer.h +30 -11
  103. data/include/rbs/location.h +25 -44
  104. data/include/rbs/parser.h +6 -6
  105. data/include/rbs/string.h +0 -2
  106. data/include/rbs/util/rbs_allocator.h +34 -13
  107. data/include/rbs/util/rbs_assert.h +12 -1
  108. data/include/rbs/util/rbs_constant_pool.h +0 -3
  109. data/include/rbs/util/rbs_encoding.h +2 -0
  110. data/include/rbs/util/rbs_unescape.h +2 -1
  111. data/include/rbs.h +8 -0
  112. data/lib/rbs/ast/annotation.rb +1 -1
  113. data/lib/rbs/ast/comment.rb +1 -1
  114. data/lib/rbs/ast/declarations.rb +10 -10
  115. data/lib/rbs/ast/members.rb +14 -14
  116. data/lib/rbs/ast/ruby/annotations.rb +293 -3
  117. data/lib/rbs/ast/ruby/comment_block.rb +24 -0
  118. data/lib/rbs/ast/ruby/declarations.rb +198 -3
  119. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +4 -0
  120. data/lib/rbs/ast/ruby/members.rb +532 -22
  121. data/lib/rbs/ast/type_param.rb +24 -4
  122. data/lib/rbs/buffer.rb +20 -15
  123. data/lib/rbs/cli/diff.rb +16 -15
  124. data/lib/rbs/cli/validate.rb +38 -106
  125. data/lib/rbs/cli.rb +52 -19
  126. data/lib/rbs/collection/config/lockfile_generator.rb +14 -2
  127. data/lib/rbs/collection/sources/git.rb +1 -0
  128. data/lib/rbs/definition.rb +1 -1
  129. data/lib/rbs/definition_builder/ancestor_builder.rb +62 -9
  130. data/lib/rbs/definition_builder/method_builder.rb +20 -0
  131. data/lib/rbs/definition_builder.rb +147 -25
  132. data/lib/rbs/diff.rb +7 -1
  133. data/lib/rbs/environment.rb +227 -74
  134. data/lib/rbs/environment_loader.rb +0 -6
  135. data/lib/rbs/errors.rb +27 -18
  136. data/lib/rbs/inline_parser.rb +342 -6
  137. data/lib/rbs/location_aux.rb +1 -1
  138. data/lib/rbs/locator.rb +5 -1
  139. data/lib/rbs/method_type.rb +5 -3
  140. data/lib/rbs/parser_aux.rb +20 -7
  141. data/lib/rbs/prototype/helpers.rb +57 -0
  142. data/lib/rbs/prototype/rb.rb +3 -28
  143. data/lib/rbs/prototype/rbi.rb +3 -20
  144. data/lib/rbs/prototype/runtime.rb +8 -0
  145. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  146. data/lib/rbs/resolver/type_name_resolver.rb +116 -38
  147. data/lib/rbs/subtractor.rb +3 -1
  148. data/lib/rbs/test/type_check.rb +19 -2
  149. data/lib/rbs/type_name.rb +1 -1
  150. data/lib/rbs/types.rb +88 -78
  151. data/lib/rbs/unit_test/type_assertions.rb +35 -8
  152. data/lib/rbs/validator.rb +2 -2
  153. data/lib/rbs/version.rb +1 -1
  154. data/lib/rbs.rb +1 -2
  155. data/lib/rdoc/discover.rb +1 -1
  156. data/lib/rdoc_plugin/parser.rb +1 -1
  157. data/rbs.gemspec +4 -3
  158. data/rust/.gitignore +1 -0
  159. data/rust/Cargo.lock +378 -0
  160. data/rust/Cargo.toml +7 -0
  161. data/rust/ruby-rbs/Cargo.toml +22 -0
  162. data/rust/ruby-rbs/build.rs +764 -0
  163. data/rust/ruby-rbs/examples/locations.rs +60 -0
  164. data/rust/ruby-rbs/src/lib.rs +1 -0
  165. data/rust/ruby-rbs/src/node/mod.rs +742 -0
  166. data/rust/ruby-rbs/tests/sanity.rs +47 -0
  167. data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
  168. data/rust/ruby-rbs-sys/Cargo.toml +23 -0
  169. data/rust/ruby-rbs-sys/build.rs +204 -0
  170. data/rust/ruby-rbs-sys/src/lib.rs +50 -0
  171. data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
  172. data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
  173. data/rust/ruby-rbs-sys/wrapper.h +1 -0
  174. data/schema/typeParam.json +17 -1
  175. data/sig/ast/ruby/annotations.rbs +315 -4
  176. data/sig/ast/ruby/comment_block.rbs +8 -0
  177. data/sig/ast/ruby/declarations.rbs +102 -4
  178. data/sig/ast/ruby/members.rbs +108 -2
  179. data/sig/cli/diff.rbs +5 -11
  180. data/sig/cli/validate.rbs +12 -8
  181. data/sig/cli.rbs +18 -18
  182. data/sig/definition.rbs +6 -1
  183. data/sig/definition_builder.rbs +2 -0
  184. data/sig/environment.rbs +70 -12
  185. data/sig/errors.rbs +13 -14
  186. data/sig/inline_parser.rbs +39 -2
  187. data/sig/locator.rbs +0 -2
  188. data/sig/manifest.yaml +0 -1
  189. data/sig/method_builder.rbs +3 -1
  190. data/sig/parser.rbs +31 -13
  191. data/sig/prototype/helpers.rbs +2 -0
  192. data/sig/resolver/type_name_resolver.rbs +35 -7
  193. data/sig/source.rbs +3 -3
  194. data/sig/type_param.rbs +13 -8
  195. data/sig/types.rbs +6 -7
  196. data/sig/unit_test/spy.rbs +0 -8
  197. data/sig/unit_test/type_assertions.rbs +11 -0
  198. data/src/ast.c +410 -153
  199. data/src/lexer.c +1392 -1313
  200. data/src/lexer.re +3 -0
  201. data/src/lexstate.c +58 -37
  202. data/src/location.c +8 -48
  203. data/src/parser.c +977 -516
  204. data/src/string.c +0 -48
  205. data/src/util/rbs_allocator.c +89 -71
  206. data/src/util/rbs_assert.c +1 -1
  207. data/src/util/rbs_buffer.c +2 -2
  208. data/src/util/rbs_constant_pool.c +10 -14
  209. data/src/util/rbs_encoding.c +4 -8
  210. data/src/util/rbs_unescape.c +56 -20
  211. data/stdlib/bigdecimal/0/big_decimal.rbs +116 -98
  212. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  213. data/stdlib/cgi/0/core.rbs +9 -393
  214. data/stdlib/cgi/0/manifest.yaml +1 -0
  215. data/stdlib/cgi-escape/0/escape.rbs +171 -0
  216. data/stdlib/coverage/0/coverage.rbs +7 -4
  217. data/stdlib/date/0/date.rbs +92 -79
  218. data/stdlib/date/0/date_time.rbs +25 -24
  219. data/stdlib/delegate/0/delegator.rbs +10 -7
  220. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  221. data/stdlib/digest/0/digest.rbs +110 -0
  222. data/stdlib/erb/0/erb.rbs +748 -347
  223. data/stdlib/etc/0/etc.rbs +55 -50
  224. data/stdlib/fileutils/0/fileutils.rbs +158 -139
  225. data/stdlib/forwardable/0/forwardable.rbs +13 -10
  226. data/stdlib/io-console/0/io-console.rbs +2 -2
  227. data/stdlib/json/0/json.rbs +217 -136
  228. data/stdlib/monitor/0/monitor.rbs +3 -3
  229. data/stdlib/net-http/0/net-http.rbs +162 -134
  230. data/stdlib/objspace/0/objspace.rbs +17 -34
  231. data/stdlib/open-uri/0/open-uri.rbs +48 -8
  232. data/stdlib/open3/0/open3.rbs +469 -10
  233. data/stdlib/openssl/0/openssl.rbs +475 -357
  234. data/stdlib/optparse/0/optparse.rbs +26 -17
  235. data/stdlib/pathname/0/pathname.rbs +11 -1381
  236. data/stdlib/pp/0/pp.rbs +9 -8
  237. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  238. data/stdlib/pstore/0/pstore.rbs +35 -30
  239. data/stdlib/psych/0/psych.rbs +65 -12
  240. data/stdlib/psych/0/store.rbs +2 -4
  241. data/stdlib/pty/0/pty.rbs +9 -6
  242. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  243. data/stdlib/rdoc/0/code_object.rbs +2 -1
  244. data/stdlib/rdoc/0/parser.rbs +1 -1
  245. data/stdlib/rdoc/0/rdoc.rbs +1 -1
  246. data/stdlib/rdoc/0/store.rbs +1 -1
  247. data/stdlib/resolv/0/resolv.rbs +25 -68
  248. data/stdlib/ripper/0/ripper.rbs +22 -19
  249. data/stdlib/securerandom/0/manifest.yaml +2 -0
  250. data/stdlib/securerandom/0/securerandom.rbs +7 -20
  251. data/stdlib/shellwords/0/shellwords.rbs +2 -2
  252. data/stdlib/singleton/0/singleton.rbs +3 -0
  253. data/stdlib/socket/0/addrinfo.rbs +7 -7
  254. data/stdlib/socket/0/basic_socket.rbs +3 -3
  255. data/stdlib/socket/0/ip_socket.rbs +10 -8
  256. data/stdlib/socket/0/socket.rbs +23 -10
  257. data/stdlib/socket/0/tcp_server.rbs +1 -1
  258. data/stdlib/socket/0/tcp_socket.rbs +11 -3
  259. data/stdlib/socket/0/udp_socket.rbs +1 -1
  260. data/stdlib/socket/0/unix_server.rbs +1 -1
  261. data/stdlib/stringio/0/stringio.rbs +1177 -85
  262. data/stdlib/strscan/0/string_scanner.rbs +27 -25
  263. data/stdlib/tempfile/0/tempfile.rbs +25 -21
  264. data/stdlib/time/0/time.rbs +8 -6
  265. data/stdlib/timeout/0/timeout.rbs +63 -7
  266. data/stdlib/tsort/0/cyclic.rbs +3 -0
  267. data/stdlib/tsort/0/tsort.rbs +7 -6
  268. data/stdlib/uri/0/common.rbs +42 -20
  269. data/stdlib/uri/0/file.rbs +3 -3
  270. data/stdlib/uri/0/generic.rbs +26 -18
  271. data/stdlib/uri/0/http.rbs +2 -2
  272. data/stdlib/uri/0/ldap.rbs +2 -2
  273. data/stdlib/uri/0/mailto.rbs +3 -3
  274. data/stdlib/uri/0/rfc2396_parser.rbs +12 -12
  275. data/stdlib/zlib/0/deflate.rbs +4 -3
  276. data/stdlib/zlib/0/gzip_reader.rbs +6 -6
  277. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  278. data/stdlib/zlib/0/inflate.rbs +1 -1
  279. data/stdlib/zlib/0/need_dict.rbs +1 -1
  280. data/stdlib/zlib/0/zstream.rbs +1 -0
  281. metadata +50 -6
@@ -95,8 +95,10 @@
95
95
  # paths to filesystem entries:
96
96
  #
97
97
  # * If the argument is a string, that value is the path.
98
- # * If the argument has method `:to_path`, it is converted via that method.
99
- # * If the argument has method `:to_str`, it is converted via that method.
98
+ # * If the argument has method <code>:to_path</code>, it is converted via that
99
+ # method.
100
+ # * If the argument has method <code>:to_str</code>, it is converted via that
101
+ # method.
100
102
  #
101
103
  # ## About the Examples
102
104
  #
@@ -132,7 +134,7 @@
132
134
  # TOCTTOU, vulnerability that can exist when:
133
135
  #
134
136
  # * An ancestor directory of the entry at the target path is world writable;
135
- # such directories include `/tmp`.
137
+ # such directories include <code>/tmp</code>.
136
138
  # * The directory tree at the target path includes:
137
139
  #
138
140
  # * A world-writable descendant directory.
@@ -146,14 +148,14 @@
146
148
  # Also available are these methods, each of which calls
147
149
  # FileUtils.remove_entry_secure:
148
150
  #
149
- # * FileUtils.rm_r with keyword argument `secure: true`.
150
- # * FileUtils.rm_rf with keyword argument `secure: true`.
151
+ # * FileUtils.rm_r with keyword argument <code>secure: true</code>.
152
+ # * FileUtils.rm_rf with keyword argument <code>secure: true</code>.
151
153
  #
152
154
  # Finally, this method for moving entries calls FileUtils.remove_entry_secure if
153
155
  # the source and destination are on different file systems (which means that the
154
156
  # "move" is really a copy and remove):
155
157
  #
156
- # * FileUtils.mv with keyword argument `secure: true`.
158
+ # * FileUtils.mv with keyword argument <code>secure: true</code>.
157
159
  #
158
160
  # Method FileUtils.remove_entry_secure removes securely by applying a special
159
161
  # pre-process:
@@ -184,7 +186,8 @@ module FileUtils
184
186
 
185
187
  type mode = Integer | String
186
188
 
187
- type path = string | _ToPath
189
+ %a{deprecated: Use top-level `path` instead}
190
+ type path = ::path
188
191
 
189
192
  type pathlist = path | Array[path]
190
193
 
@@ -213,7 +216,7 @@ module FileUtils
213
216
  #
214
217
  # Keyword arguments:
215
218
  #
216
- # * `verbose: true` - prints an equivalent command:
219
+ # * <code>verbose: true</code> - prints an equivalent command:
217
220
  #
218
221
  # FileUtils.cd('..')
219
222
  # FileUtils.cd('fileutils')
@@ -248,7 +251,7 @@ module FileUtils
248
251
  # -->
249
252
  # Changes permissions on the entries at the paths given in `list` (a single path
250
253
  # or an array of paths) to the permissions given by `mode`; returns `list` if it
251
- # is an array, `[list]` otherwise:
254
+ # is an array, <code>[list]</code> otherwise:
252
255
  #
253
256
  # * Modifies each entry that is a regular file using
254
257
  # [File.chmod](rdoc-ref:File.chmod).
@@ -267,30 +270,33 @@ module FileUtils
267
270
  #
268
271
  # * String `mode`: represents the permissions to be set:
269
272
  #
270
- # The string is of the form `[targets][[operator][perms[,perms]]`, where:
273
+ # The string is of the form
274
+ # <code>[targets][[operator][perms[,perms]]</code>, where:
271
275
  #
272
276
  # * `targets` may be any combination of these letters:
273
277
  #
274
- # * `'u'`: permissions apply to the file's owner.
275
- # * `'g'`: permissions apply to users in the file's group.
276
- # * `'o'`: permissions apply to other users not in the file's group.
277
- # * `'a'` (the default): permissions apply to all users.
278
+ # * <code>'u'</code>: permissions apply to the file's owner.
279
+ # * <code>'g'</code>: permissions apply to users in the file's group.
280
+ # * <code>'o'</code>: permissions apply to other users not in the
281
+ # file's group.
282
+ # * <code>'a'</code> (the default): permissions apply to all users.
278
283
  #
279
284
  # * `operator` may be one of these letters:
280
285
  #
281
- # * `'+'`: adds permissions.
282
- # * `'-'`: removes permissions.
283
- # * `'='`: sets (replaces) permissions.
286
+ # * <code>'+'</code>: adds permissions.
287
+ # * <code>'-'</code>: removes permissions.
288
+ # * <code>'='</code>: sets (replaces) permissions.
284
289
  #
285
290
  # * `perms` (may be repeated, with separating commas) may be any
286
291
  # combination of these letters:
287
292
  #
288
- # * `'r'`: Read.
289
- # * `'w'`: Write.
290
- # * `'x'`: Execute (search, for a directory).
291
- # * `'X'`: Search (for a directories only; must be used with `'+'`)
292
- # * `'s'`: Uid or gid.
293
- # * `'t'`: Sticky bit.
293
+ # * <code>'r'</code>: Read.
294
+ # * <code>'w'</code>: Write.
295
+ # * <code>'x'</code>: Execute (search, for a directory).
296
+ # * <code>'X'</code>: Search (for a directories only; must be used
297
+ # with <code>'+'</code>)
298
+ # * <code>'s'</code>: Uid or gid.
299
+ # * <code>'t'</code>: Sticky bit.
294
300
  #
295
301
  # Examples:
296
302
  #
@@ -299,8 +305,8 @@ module FileUtils
299
305
  #
300
306
  # Keyword arguments:
301
307
  #
302
- # * `noop: true` - does not change permissions; returns `nil`.
303
- # * `verbose: true` - prints an equivalent command:
308
+ # * <code>noop: true</code> - does not change permissions; returns `nil`.
309
+ # * <code>verbose: true</code> - prints an equivalent command:
304
310
  #
305
311
  # FileUtils.chmod(0755, 'src0.txt', noop: true, verbose: true)
306
312
  # FileUtils.chmod(0644, ['src0.txt', 'src0.dat'], noop: true, verbose: true)
@@ -332,7 +338,7 @@ module FileUtils
332
338
  # -->
333
339
  # Changes the owner and group on the entries at the paths given in `list` (a
334
340
  # single path or an array of paths) to the given `user` and `group`; returns
335
- # `list` if it is an array, `[list]` otherwise:
341
+ # `list` if it is an array, <code>[list]</code> otherwise:
336
342
  #
337
343
  # * Modifies each entry that is a regular file using
338
344
  # [File.chown](rdoc-ref:File.chown).
@@ -344,10 +350,10 @@ module FileUtils
344
350
  #
345
351
  # User and group:
346
352
  #
347
- # * Argument `user` may be a user name or a user id; if `nil` or `-1`, the
348
- # user is not changed.
349
- # * Argument `group` may be a group name or a group id; if `nil` or `-1`, the
350
- # group is not changed.
353
+ # * Argument `user` may be a user name or a user id; if `nil` or
354
+ # <code>-1</code>, the user is not changed.
355
+ # * Argument `group` may be a group name or a group id; if `nil` or
356
+ # <code>-1</code>, the group is not changed.
351
357
  # * The user must be a member of the group.
352
358
  #
353
359
  # Examples:
@@ -373,8 +379,8 @@ module FileUtils
373
379
  #
374
380
  # Keyword arguments:
375
381
  #
376
- # * `noop: true` - does not change permissions; returns `nil`.
377
- # * `verbose: true` - prints an equivalent command:
382
+ # * <code>noop: true</code> - does not change permissions; returns `nil`.
383
+ # * <code>verbose: true</code> - prints an equivalent command:
378
384
  #
379
385
  # FileUtils.chown('user2', 'group1', 'src0.txt', noop: true, verbose: true)
380
386
  # FileUtils.chown(1004, 1004, 'src0.txt', noop: true, verbose: true)
@@ -522,11 +528,13 @@ module FileUtils
522
528
  # symbolic links; other file types (FIFO streams, device files, etc.) are not
523
529
  # supported.
524
530
  #
525
- # Keyword arguments:
531
+ # Optional arguments:
526
532
  #
527
- # * `dereference_root: true` - if `src` is a symbolic link, follows the link.
528
- # * `preserve: true` - preserves file times.
529
- # * `remove_destination: true` - removes `dest` before copying files.
533
+ # * `dereference_root` - if `src` is a symbolic link, follows the link
534
+ # (`false` by default).
535
+ # * `preserve` - preserves file times (`false` by default).
536
+ # * `remove_destination` - removes `dest` before copying files (`false` by
537
+ # default).
530
538
  #
531
539
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
532
540
  #
@@ -547,12 +555,13 @@ module FileUtils
547
555
  # FileUtils.copy_file('src0.txt', 'dest0.txt')
548
556
  # File.file?('dest0.txt') # => true
549
557
  #
550
- # Keyword arguments:
558
+ # Optional arguments:
551
559
  #
552
- # * `dereference: false` - if `src` is a symbolic link, does not follow the
553
- # link.
554
- # * `preserve: true` - preserves file times.
555
- # * `remove_destination: true` - removes `dest` before copying files.
560
+ # * `dereference` - if `src` is a symbolic link, follows the link (`true` by
561
+ # default).
562
+ # * `preserve` - preserves file times (`false` by default).
563
+ # * `remove_destination` - removes `dest` before copying files (`false` by
564
+ # default).
556
565
  #
557
566
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
558
567
  #
@@ -587,7 +596,7 @@ module FileUtils
587
596
  # File.file?('dest0.txt') # => true
588
597
  #
589
598
  # If `src` is the path to a file and `dest` is the path to a directory, copies
590
- # `src` to `dest/src`:
599
+ # `src` to <code>dest/src</code>:
591
600
  #
592
601
  # FileUtils.touch('src1.txt')
593
602
  # FileUtils.mkdir('dest1')
@@ -606,9 +615,9 @@ module FileUtils
606
615
  #
607
616
  # Keyword arguments:
608
617
  #
609
- # * `preserve: true` - preserves file times.
610
- # * `noop: true` - does not copy files.
611
- # * `verbose: true` - prints an equivalent command:
618
+ # * <code>preserve: true</code> - preserves file times.
619
+ # * <code>noop: true</code> - does not copy files.
620
+ # * <code>verbose: true</code> - prints an equivalent command:
612
621
  #
613
622
  # FileUtils.cp('src0.txt', 'dest0.txt', noop: true, verbose: true)
614
623
  # FileUtils.cp('src1.txt', 'dest1', noop: true, verbose: true)
@@ -671,8 +680,8 @@ module FileUtils
671
680
  # # |-- src2.txt
672
681
  # # `-- src3.txt
673
682
  #
674
- # If `src` and `dest` are both paths to directories, creates links `dest/src`
675
- # and descendents pointing to `src` and its descendents:
683
+ # If `src` and `dest` are both paths to directories, creates links
684
+ # <code>dest/src</code> and descendents pointing to `src` and its descendents:
676
685
  #
677
686
  # tree('src1')
678
687
  # # => src1
@@ -696,7 +705,7 @@ module FileUtils
696
705
  #
697
706
  # If `src` is an array of paths to entries and `dest` is the path to a
698
707
  # directory, for each path `filepath` in `src`, creates a link at
699
- # `dest/filepath` pointing to that path:
708
+ # <code>dest/filepath</code> pointing to that path:
700
709
  #
701
710
  # tree('src2')
702
711
  # # => src2
@@ -719,11 +728,12 @@ module FileUtils
719
728
  #
720
729
  # Keyword arguments:
721
730
  #
722
- # * `dereference_root: false` - if `src` is a symbolic link, does not
723
- # dereference it.
724
- # * `noop: true` - does not create links.
725
- # * `remove_destination: true` - removes `dest` before creating links.
726
- # * `verbose: true` - prints an equivalent command:
731
+ # * <code>dereference_root: false</code> - if `src` is a symbolic link, does
732
+ # not dereference it.
733
+ # * <code>noop: true</code> - does not create links.
734
+ # * <code>remove_destination: true</code> - removes `dest` before creating
735
+ # links.
736
+ # * <code>verbose: true</code> - prints an equivalent command:
727
737
  #
728
738
  # FileUtils.cp_lr('src0', 'dest0', noop: true, verbose: true)
729
739
  # FileUtils.cp_lr('src1', 'dest1', noop: true, verbose: true)
@@ -736,7 +746,7 @@ module FileUtils
736
746
  # cp -lr src2/sub0 src2/sub1 dest2
737
747
  #
738
748
  # Raises an exception if `dest` is the path to an existing file or directory and
739
- # keyword argument `remove_destination: true` is not given.
749
+ # keyword argument <code>remove_destination: true</code> is not given.
740
750
  #
741
751
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
742
752
  #
@@ -763,7 +773,7 @@ module FileUtils
763
773
  # File.file?('dest0.txt') # => true
764
774
  #
765
775
  # If `src` is the path to a file and `dest` is the path to a directory, copies
766
- # `src` to `dest/src`:
776
+ # `src` to <code>dest/src</code>:
767
777
  #
768
778
  # FileUtils.touch('src1.txt')
769
779
  # FileUtils.mkdir('dest1')
@@ -793,7 +803,7 @@ module FileUtils
793
803
  # # `-- src3.txt
794
804
  #
795
805
  # If `src` and `dest` are paths to directories, recursively copies `src` to
796
- # `dest/src`:
806
+ # <code>dest/src</code>:
797
807
  #
798
808
  # tree('src3')
799
809
  # # => src3
@@ -821,12 +831,13 @@ module FileUtils
821
831
  #
822
832
  # Keyword arguments:
823
833
  #
824
- # * `dereference_root: false` - if `src` is a symbolic link, does not
825
- # dereference it.
826
- # * `noop: true` - does not copy files.
827
- # * `preserve: true` - preserves file times.
828
- # * `remove_destination: true` - removes `dest` before copying files.
829
- # * `verbose: true` - prints an equivalent command:
834
+ # * <code>dereference_root: false</code> - if `src` is a symbolic link, does
835
+ # not dereference it.
836
+ # * <code>noop: true</code> - does not copy files.
837
+ # * <code>preserve: true</code> - preserves file times.
838
+ # * <code>remove_destination: true</code> - removes `dest` before copying
839
+ # files.
840
+ # * <code>verbose: true</code> - prints an equivalent command:
830
841
  #
831
842
  # FileUtils.cp_r('src0.txt', 'dest0.txt', noop: true, verbose: true)
832
843
  # FileUtils.cp_r('src1.txt', 'dest1', noop: true, verbose: true)
@@ -883,8 +894,8 @@ module FileUtils
883
894
  # FileUtils.install('src1.txt', 'dest1.txt')
884
895
  # File.read('dest1.txt') # => "aaa\n"
885
896
  #
886
- # If `dest` is a directory entry, copies from `src` to `dest/src`, overwriting
887
- # if necessary:
897
+ # If `dest` is a directory entry, copies from `src` to <code>dest/src</code>,
898
+ # overwriting if necessary:
888
899
  #
889
900
  # File.read('src2.txt') # => "aaa\n"
890
901
  # File.read('dest2/src2.txt') # => "bbb\n"
@@ -892,7 +903,7 @@ module FileUtils
892
903
  # File.read('dest2/src2.txt') # => "aaa\n"
893
904
  #
894
905
  # If `src` is an array of paths and `dest` points to a directory, copies each
895
- # path `path` in `src` to `dest/path`:
906
+ # path `path` in `src` to <code>dest/path</code>:
896
907
  #
897
908
  # File.file?('src3.txt') # => true
898
909
  # File.file?('src3.dat') # => true
@@ -903,16 +914,16 @@ module FileUtils
903
914
  #
904
915
  # Keyword arguments:
905
916
  #
906
- # * `group: *group`* - changes the group if not `nil`, using
917
+ # * <code>group: <i>group</i></code> - changes the group if not `nil`, using
907
918
  # [File.chown](rdoc-ref:File.chown).
908
- # * `mode: *permissions`* - changes the permissions. using
919
+ # * <code>mode: <i>permissions</i></code> - changes the permissions. using
909
920
  # [File.chmod](rdoc-ref:File.chmod).
910
- # * `noop: true` - does not copy entries; returns `nil`.
911
- # * `owner: *owner`* - changes the owner if not `nil`, using
921
+ # * <code>noop: true</code> - does not copy entries; returns `nil`.
922
+ # * <code>owner: <i>owner</i></code> - changes the owner if not `nil`, using
912
923
  # [File.chown](rdoc-ref:File.chown).
913
- # * `preserve: true` - preserve timestamps using
924
+ # * <code>preserve: true</code> - preserve timestamps using
914
925
  # [File.utime](rdoc-ref:File.utime).
915
- # * `verbose: true` - prints an equivalent command:
926
+ # * <code>verbose: true</code> - prints an equivalent command:
916
927
  #
917
928
  # FileUtils.install('src0.txt', 'dest0.txt', noop: true, verbose: true)
918
929
  # FileUtils.install('src1.txt', 'dest1.txt', noop: true, verbose: true)
@@ -963,13 +974,15 @@ module FileUtils
963
974
  # File.file?('dest1/dir1/t2.txt') # => true
964
975
  # File.file?('dest1/dir1/t3.txt') # => true
965
976
  #
966
- # Keyword arguments:
977
+ # Optional arguments:
967
978
  #
968
- # * `dereference_root: true` - dereferences `src` if it is a symbolic link.
969
- # * `remove_destination: true` - removes `dest` before creating links.
979
+ # * `dereference_root` - dereferences `src` if it is a symbolic link (`false`
980
+ # by default).
981
+ # * `remove_destination` - removes `dest` before creating links (`false` by
982
+ # default).
970
983
  #
971
984
  # Raises an exception if `dest` is the path to an existing file or directory and
972
- # keyword argument `remove_destination: true` is not given.
985
+ # optional argument `remove_destination` is not given.
973
986
  #
974
987
  # Related: FileUtils.ln (has different options).
975
988
  #
@@ -994,8 +1007,8 @@ module FileUtils
994
1007
  # Dir.children('tmp1/') # => ["t.lnk"]
995
1008
  #
996
1009
  # When `src` is the path to an existing file and `dest` is the path to an
997
- # existing directory, creates a hard link at `dest/src` pointing to `src`;
998
- # returns zero:
1010
+ # existing directory, creates a hard link at <code>dest/src</code> pointing to
1011
+ # `src`; returns zero:
999
1012
  #
1000
1013
  # Dir.children('tmp2') # => ["t.dat"]
1001
1014
  # Dir.children('tmp3') # => []
@@ -1004,7 +1017,7 @@ module FileUtils
1004
1017
  #
1005
1018
  # When `src` is an array of paths to existing files and `dest` is the path to an
1006
1019
  # existing directory, then for each path `target` in `src`, creates a hard link
1007
- # at `dest/target` pointing to `target`; returns `src`:
1020
+ # at <code>dest/target</code> pointing to `target`; returns `src`:
1008
1021
  #
1009
1022
  # Dir.children('tmp4/') # => []
1010
1023
  # FileUtils.ln(['tmp0/t.txt', 'tmp2/t.dat'], 'tmp4/') # => ["tmp0/t.txt", "tmp2/t.dat"]
@@ -1012,9 +1025,9 @@ module FileUtils
1012
1025
  #
1013
1026
  # Keyword arguments:
1014
1027
  #
1015
- # * `force: true` - overwrites `dest` if it exists.
1016
- # * `noop: true` - does not create links.
1017
- # * `verbose: true` - prints an equivalent command:
1028
+ # * <code>force: true</code> - overwrites `dest` if it exists.
1029
+ # * <code>noop: true</code> - does not create links.
1030
+ # * <code>verbose: true</code> - prints an equivalent command:
1018
1031
  #
1019
1032
  # FileUtils.ln('tmp0/t.txt', 'tmp1/t.lnk', verbose: true)
1020
1033
  # FileUtils.ln('tmp2/t.dat', 'tmp3', verbose: true)
@@ -1067,8 +1080,8 @@ module FileUtils
1067
1080
  # File.symlink?('dest0.txt') # => true
1068
1081
  #
1069
1082
  # * When `dest` is the path to an existing file, creates a symbolic link at
1070
- # `dest` pointing to `src` if and only if keyword argument `force: true` is
1071
- # given (raises an exception otherwise):
1083
+ # `dest` pointing to `src` if and only if keyword argument <code>force:
1084
+ # true</code> is given (raises an exception otherwise):
1072
1085
  #
1073
1086
  # FileUtils.touch('src1.txt')
1074
1087
  # FileUtils.touch('dest1.txt')
@@ -1077,8 +1090,8 @@ module FileUtils
1077
1090
  #
1078
1091
  # FileUtils.ln_s('src1.txt', 'dest1.txt') # Raises Errno::EEXIST.
1079
1092
  #
1080
- # If `dest` is the path to a directory, creates a symbolic link at `dest/src`
1081
- # pointing to `src`:
1093
+ # If `dest` is the path to a directory, creates a symbolic link at
1094
+ # <code>dest/src</code> pointing to `src`:
1082
1095
  #
1083
1096
  # FileUtils.touch('src2.txt')
1084
1097
  # FileUtils.mkdir('destdir2')
@@ -1086,8 +1099,8 @@ module FileUtils
1086
1099
  # File.symlink?('destdir2/src2.txt') # => true
1087
1100
  #
1088
1101
  # If `src` is an array of paths to existing files and `dest` is a directory, for
1089
- # each child `child` in `src` creates a symbolic link `dest/child` pointing to
1090
- # `child`:
1102
+ # each child `child` in `src` creates a symbolic link <code>dest/child</code>
1103
+ # pointing to `child`:
1091
1104
  #
1092
1105
  # FileUtils.mkdir('srcdir3')
1093
1106
  # FileUtils.touch('srcdir3/src0.txt')
@@ -1099,10 +1112,10 @@ module FileUtils
1099
1112
  #
1100
1113
  # Keyword arguments:
1101
1114
  #
1102
- # * `force: true` - overwrites `dest` if it exists.
1103
- # * `relative: false` - create links relative to `dest`.
1104
- # * `noop: true` - does not create links.
1105
- # * `verbose: true` - prints an equivalent command:
1115
+ # * <code>force: true</code> - overwrites `dest` if it exists.
1116
+ # * <code>relative: false</code> - create links relative to `dest`.
1117
+ # * <code>noop: true</code> - does not create links.
1118
+ # * <code>verbose: true</code> - prints an equivalent command:
1106
1119
  #
1107
1120
  # FileUtils.ln_s('src0.txt', 'dest0.txt', noop: true, verbose: true)
1108
1121
  # FileUtils.ln_s('src1.txt', 'destdir1', noop: true, verbose: true)
@@ -1138,7 +1151,8 @@ module FileUtils
1138
1151
  # rdoc-file=lib/fileutils.rb
1139
1152
  # - ln_sf(src, dest, noop: nil, verbose: nil)
1140
1153
  # -->
1141
- # Like FileUtils.ln_s, but always with keyword argument `force: true` given.
1154
+ # Like FileUtils.ln_s, but always with keyword argument <code>force: true</code>
1155
+ # given.
1142
1156
  #
1143
1157
  def self?.ln_sf: (pathlist src, path dest, ?noop: boolish, ?verbose: boolish) -> void
1144
1158
 
@@ -1155,23 +1169,25 @@ module FileUtils
1155
1169
  # - mkdir(list, mode: nil, noop: nil, verbose: nil)
1156
1170
  # -->
1157
1171
  # Creates directories at the paths in the given `list` (a single path or an
1158
- # array of paths); returns `list` if it is an array, `[list]` otherwise.
1172
+ # array of paths); returns `list` if it is an array, <code>[list]</code>
1173
+ # otherwise.
1159
1174
  #
1160
1175
  # Argument `list` or its elements should be [interpretable as
1161
1176
  # paths](rdoc-ref:FileUtils@Path+Arguments).
1162
1177
  #
1163
1178
  # With no keyword arguments, creates a directory at each `path` in `list` by
1164
- # calling: `Dir.mkdir(path, mode)`; see [Dir.mkdir](rdoc-ref:Dir.mkdir):
1179
+ # calling: <code>Dir.mkdir(path, mode)</code>; see
1180
+ # [Dir.mkdir](rdoc-ref:Dir.mkdir):
1165
1181
  #
1166
1182
  # FileUtils.mkdir(%w[tmp0 tmp1]) # => ["tmp0", "tmp1"]
1167
1183
  # FileUtils.mkdir('tmp4') # => ["tmp4"]
1168
1184
  #
1169
1185
  # Keyword arguments:
1170
1186
  #
1171
- # * `mode: *mode`* - also calls `File.chmod(mode, path)`; see
1172
- # [File.chmod](rdoc-ref:File.chmod).
1173
- # * `noop: true` - does not create directories.
1174
- # * `verbose: true` - prints an equivalent command:
1187
+ # * <code>mode: <i>mode</i></code> - also calls <code>File.chmod(mode,
1188
+ # path)</code>; see [File.chmod](rdoc-ref:File.chmod).
1189
+ # * <code>noop: true</code> - does not create directories.
1190
+ # * <code>verbose: true</code> - prints an equivalent command:
1175
1191
  #
1176
1192
  # FileUtils.mkdir(%w[tmp0 tmp1], verbose: true)
1177
1193
  # FileUtils.mkdir(%w[tmp2 tmp3], mode: 0700, verbose: true)
@@ -1194,24 +1210,24 @@ module FileUtils
1194
1210
  # -->
1195
1211
  # Creates directories at the paths in the given `list` (a single path or an
1196
1212
  # array of paths), also creating ancestor directories as needed; returns `list`
1197
- # if it is an array, `[list]` otherwise.
1213
+ # if it is an array, <code>[list]</code> otherwise.
1198
1214
  #
1199
1215
  # Argument `list` or its elements should be [interpretable as
1200
1216
  # paths](rdoc-ref:FileUtils@Path+Arguments).
1201
1217
  #
1202
1218
  # With no keyword arguments, creates a directory at each `path` in `list`, along
1203
- # with any needed ancestor directories, by calling: `Dir.mkdir(path, mode)`; see
1204
- # [Dir.mkdir](rdoc-ref:Dir.mkdir):
1219
+ # with any needed ancestor directories, by calling: <code>Dir.mkdir(path,
1220
+ # mode)</code>; see [Dir.mkdir](rdoc-ref:Dir.mkdir):
1205
1221
  #
1206
1222
  # FileUtils.mkdir_p(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
1207
1223
  # FileUtils.mkdir_p('tmp4/tmp5') # => ["tmp4/tmp5"]
1208
1224
  #
1209
1225
  # Keyword arguments:
1210
1226
  #
1211
- # * `mode: *mode`* - also calls `File.chmod(mode, path)`; see
1212
- # [File.chmod](rdoc-ref:File.chmod).
1213
- # * `noop: true` - does not create directories.
1214
- # * `verbose: true` - prints an equivalent command:
1227
+ # * <code>mode: <i>mode</i></code> - also calls <code>File.chmod(mode,
1228
+ # path)</code>; see [File.chmod](rdoc-ref:File.chmod).
1229
+ # * <code>noop: true</code> - does not create directories.
1230
+ # * <code>verbose: true</code> - prints an equivalent command:
1215
1231
  #
1216
1232
  # FileUtils.mkdir_p(%w[tmp0 tmp1], verbose: true)
1217
1233
  # FileUtils.mkdir_p(%w[tmp2 tmp3], mode: 0700, verbose: true)
@@ -1269,8 +1285,8 @@ module FileUtils
1269
1285
  # If `src` and `dest` are on different file systems, first copies, then removes
1270
1286
  # `src`.
1271
1287
  #
1272
- # May cause a local vulnerability if not called with keyword argument `secure:
1273
- # true`; see [Avoiding the TOCTTOU
1288
+ # May cause a local vulnerability if not called with keyword argument
1289
+ # <code>secure: true</code>; see [Avoiding the TOCTTOU
1274
1290
  # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1275
1291
  #
1276
1292
  # If `src` is the path to a single file or directory and `dest` does not exist,
@@ -1307,13 +1323,13 @@ module FileUtils
1307
1323
  #
1308
1324
  # Keyword arguments:
1309
1325
  #
1310
- # * `force: true` - if the move includes removing `src` (that is, if `src` and
1311
- # `dest` are on different file systems), ignores raised exceptions of
1312
- # StandardError and its descendants.
1313
- # * `noop: true` - does not move files.
1314
- # * `secure: true` - removes `src` securely; see details at
1326
+ # * <code>force: true</code> - if the move includes removing `src` (that is,
1327
+ # if `src` and `dest` are on different file systems), ignores raised
1328
+ # exceptions of StandardError and its descendants.
1329
+ # * <code>noop: true</code> - does not move files.
1330
+ # * <code>secure: true</code> - removes `src` securely; see details at
1315
1331
  # FileUtils.remove_entry_secure.
1316
- # * `verbose: true` - prints an equivalent command:
1332
+ # * <code>verbose: true</code> - prints an equivalent command:
1317
1333
  #
1318
1334
  # FileUtils.mv('src0', 'dest0', noop: true, verbose: true)
1319
1335
  # FileUtils.mv(['src1.txt', 'src1'], 'dest1', noop: true, verbose: true)
@@ -1464,7 +1480,7 @@ module FileUtils
1464
1480
  # - rm(list, force: nil, noop: nil, verbose: nil)
1465
1481
  # -->
1466
1482
  # Removes entries at the paths in the given `list` (a single path or an array of
1467
- # paths) returns `list`, if it is an array, `[list]` otherwise.
1483
+ # paths) returns `list`, if it is an array, <code>[list]</code> otherwise.
1468
1484
  #
1469
1485
  # Argument `list` or its elements should be [interpretable as
1470
1486
  # paths](rdoc-ref:FileUtils@Path+Arguments).
@@ -1476,10 +1492,10 @@ module FileUtils
1476
1492
  #
1477
1493
  # Keyword arguments:
1478
1494
  #
1479
- # * `force: true` - ignores raised exceptions of StandardError and its
1480
- # descendants.
1481
- # * `noop: true` - does not remove files; returns `nil`.
1482
- # * `verbose: true` - prints an equivalent command:
1495
+ # * <code>force: true</code> - ignores raised exceptions of StandardError and
1496
+ # its descendants.
1497
+ # * <code>noop: true</code> - does not remove files; returns `nil`.
1498
+ # * <code>verbose: true</code> - prints an equivalent command:
1483
1499
  #
1484
1500
  # FileUtils.rm(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1485
1501
  #
@@ -1541,13 +1557,13 @@ module FileUtils
1541
1557
  # - rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
1542
1558
  # -->
1543
1559
  # Removes entries at the paths in the given `list` (a single path or an array of
1544
- # paths); returns `list`, if it is an array, `[list]` otherwise.
1560
+ # paths); returns `list`, if it is an array, <code>[list]</code> otherwise.
1545
1561
  #
1546
1562
  # Argument `list` or its elements should be [interpretable as
1547
1563
  # paths](rdoc-ref:FileUtils@Path+Arguments).
1548
1564
  #
1549
- # May cause a local vulnerability if not called with keyword argument `secure:
1550
- # true`; see [Avoiding the TOCTTOU
1565
+ # May cause a local vulnerability if not called with keyword argument
1566
+ # <code>secure: true</code>; see [Avoiding the TOCTTOU
1551
1567
  # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1552
1568
  #
1553
1569
  # For each file path, removes the file at that path:
@@ -1572,12 +1588,12 @@ module FileUtils
1572
1588
  #
1573
1589
  # Keyword arguments:
1574
1590
  #
1575
- # * `force: true` - ignores raised exceptions of StandardError and its
1576
- # descendants.
1577
- # * `noop: true` - does not remove entries; returns `nil`.
1578
- # * `secure: true` - removes `src` securely; see details at
1591
+ # * <code>force: true</code> - ignores raised exceptions of StandardError and
1592
+ # its descendants.
1593
+ # * <code>noop: true</code> - does not remove entries; returns `nil`.
1594
+ # * <code>secure: true</code> - removes `src` securely; see details at
1579
1595
  # FileUtils.remove_entry_secure.
1580
- # * `verbose: true` - prints an equivalent command:
1596
+ # * <code>verbose: true</code> - prints an equivalent command:
1581
1597
  #
1582
1598
  # FileUtils.rm_r(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1583
1599
  # FileUtils.rm_r('src1', noop: true, verbose: true)
@@ -1602,8 +1618,8 @@ module FileUtils
1602
1618
  # Argument `list` or its elements should be [interpretable as
1603
1619
  # paths](rdoc-ref:FileUtils@Path+Arguments).
1604
1620
  #
1605
- # May cause a local vulnerability if not called with keyword argument `secure:
1606
- # true`; see [Avoiding the TOCTTOU
1621
+ # May cause a local vulnerability if not called with keyword argument
1622
+ # <code>secure: true</code>; see [Avoiding the TOCTTOU
1607
1623
  # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1608
1624
  #
1609
1625
  # See FileUtils.rm_r for keyword arguments.
@@ -1631,22 +1647,24 @@ module FileUtils
1631
1647
  # - rmdir(list, parents: nil, noop: nil, verbose: nil)
1632
1648
  # -->
1633
1649
  # Removes directories at the paths in the given `list` (a single path or an
1634
- # array of paths); returns `list`, if it is an array, `[list]` otherwise.
1650
+ # array of paths); returns `list`, if it is an array, <code>[list]</code>
1651
+ # otherwise.
1635
1652
  #
1636
1653
  # Argument `list` or its elements should be [interpretable as
1637
1654
  # paths](rdoc-ref:FileUtils@Path+Arguments).
1638
1655
  #
1639
1656
  # With no keyword arguments, removes the directory at each `path` in `list`, by
1640
- # calling: `Dir.rmdir(path)`; see [Dir.rmdir](rdoc-ref:Dir.rmdir):
1657
+ # calling: <code>Dir.rmdir(path)</code>; see [Dir.rmdir](rdoc-ref:Dir.rmdir):
1641
1658
  #
1642
1659
  # FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
1643
1660
  # FileUtils.rmdir('tmp4/tmp5') # => ["tmp4/tmp5"]
1644
1661
  #
1645
1662
  # Keyword arguments:
1646
1663
  #
1647
- # * `parents: true` - removes successive ancestor directories if empty.
1648
- # * `noop: true` - does not remove directories.
1649
- # * `verbose: true` - prints an equivalent command:
1664
+ # * <code>parents: true</code> - removes successive ancestor directories if
1665
+ # empty.
1666
+ # * <code>noop: true</code> - does not remove directories.
1667
+ # * <code>verbose: true</code> - prints an equivalent command:
1650
1668
  #
1651
1669
  # FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3], parents: true, verbose: true)
1652
1670
  # FileUtils.rmdir('tmp4/tmp5', parents: true, verbose: true)
@@ -1669,7 +1687,7 @@ module FileUtils
1669
1687
  # -->
1670
1688
  # Updates modification times (mtime) and access times (atime) of the entries
1671
1689
  # given by the paths in `list` (a single path or an array of paths); returns
1672
- # `list` if it is an array, `[list]` otherwise.
1690
+ # `list` if it is an array, <code>[list]</code> otherwise.
1673
1691
  #
1674
1692
  # By default, creates an empty file for any path to a non-existent entry; use
1675
1693
  # keyword argument `nocreate` to raise an exception instead.
@@ -1693,11 +1711,12 @@ module FileUtils
1693
1711
  #
1694
1712
  # Keyword arguments:
1695
1713
  #
1696
- # * `mtime: *time`* - sets the entry's mtime to the given time, instead of the
1697
- # current time.
1698
- # * `nocreate: true` - raises an exception if the entry does not exist.
1699
- # * `noop: true` - does not touch entries; returns `nil`.
1700
- # * `verbose: true` - prints an equivalent command:
1714
+ # * <code>mtime: <i>time</i></code> - sets the entry's mtime to the given
1715
+ # time, instead of the current time.
1716
+ # * <code>nocreate: true</code> - raises an exception if the entry does not
1717
+ # exist.
1718
+ # * <code>noop: true</code> - does not touch entries; returns `nil`.
1719
+ # * <code>verbose: true</code> - prints an equivalent command:
1701
1720
  #
1702
1721
  # FileUtils.touch('src0.txt', noop: true, verbose: true)
1703
1722
  # FileUtils.touch(['src0.txt', 'src0.dat'], noop: true, verbose: true)