rbs-relaxed 3.9.0.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 (484) hide show
  1. checksums.yaml +7 -0
  2. data/.github/dependabot.yml +22 -0
  3. data/.github/workflows/comments.yml +35 -0
  4. data/.github/workflows/dependabot.yml +30 -0
  5. data/.github/workflows/ruby.yml +82 -0
  6. data/.github/workflows/typecheck.yml +38 -0
  7. data/.github/workflows/windows.yml +43 -0
  8. data/.gitignore +23 -0
  9. data/.rubocop.yml +68 -0
  10. data/BSDL +22 -0
  11. data/CHANGELOG.md +1868 -0
  12. data/COPYING +56 -0
  13. data/README.md +203 -0
  14. data/Rakefile +417 -0
  15. data/Steepfile +44 -0
  16. data/config.yml +313 -0
  17. data/core/array.rbs +4062 -0
  18. data/core/basic_object.rbs +375 -0
  19. data/core/binding.rbs +150 -0
  20. data/core/builtin.rbs +277 -0
  21. data/core/class.rbs +220 -0
  22. data/core/comparable.rbs +171 -0
  23. data/core/complex.rbs +786 -0
  24. data/core/constants.rbs +96 -0
  25. data/core/data.rbs +415 -0
  26. data/core/dir.rbs +981 -0
  27. data/core/encoding.rbs +1371 -0
  28. data/core/enumerable.rbs +2405 -0
  29. data/core/enumerator/product.rbs +92 -0
  30. data/core/enumerator.rbs +630 -0
  31. data/core/env.rbs +6 -0
  32. data/core/errno.rbs +673 -0
  33. data/core/errors.rbs +760 -0
  34. data/core/exception.rbs +485 -0
  35. data/core/false_class.rbs +82 -0
  36. data/core/fiber.rbs +550 -0
  37. data/core/fiber_error.rbs +11 -0
  38. data/core/file.rbs +2936 -0
  39. data/core/file_test.rbs +331 -0
  40. data/core/float.rbs +1151 -0
  41. data/core/gc.rbs +644 -0
  42. data/core/global_variables.rbs +184 -0
  43. data/core/hash.rbs +1861 -0
  44. data/core/integer.rbs +1413 -0
  45. data/core/io/buffer.rbs +984 -0
  46. data/core/io/wait.rbs +70 -0
  47. data/core/io.rbs +3406 -0
  48. data/core/kernel.rbs +3096 -0
  49. data/core/marshal.rbs +207 -0
  50. data/core/match_data.rbs +635 -0
  51. data/core/math.rbs +729 -0
  52. data/core/method.rbs +386 -0
  53. data/core/module.rbs +1704 -0
  54. data/core/nil_class.rbs +209 -0
  55. data/core/numeric.rbs +818 -0
  56. data/core/object.rbs +110 -0
  57. data/core/object_space/weak_key_map.rbs +166 -0
  58. data/core/object_space.rbs +190 -0
  59. data/core/proc.rbs +868 -0
  60. data/core/process.rbs +2296 -0
  61. data/core/ractor.rbs +1068 -0
  62. data/core/random.rbs +237 -0
  63. data/core/range.rbs +1107 -0
  64. data/core/rational.rbs +531 -0
  65. data/core/rb_config.rbs +88 -0
  66. data/core/rbs/unnamed/argf.rbs +1229 -0
  67. data/core/rbs/unnamed/env_class.rbs +1209 -0
  68. data/core/rbs/unnamed/random.rbs +293 -0
  69. data/core/refinement.rbs +59 -0
  70. data/core/regexp.rbs +1930 -0
  71. data/core/ruby_vm.rbs +765 -0
  72. data/core/rubygems/basic_specification.rbs +6 -0
  73. data/core/rubygems/config_file.rbs +38 -0
  74. data/core/rubygems/dependency_installer.rbs +6 -0
  75. data/core/rubygems/errors.rbs +176 -0
  76. data/core/rubygems/installer.rbs +15 -0
  77. data/core/rubygems/path_support.rbs +6 -0
  78. data/core/rubygems/platform.rbs +7 -0
  79. data/core/rubygems/request_set.rbs +49 -0
  80. data/core/rubygems/requirement.rbs +148 -0
  81. data/core/rubygems/rubygems.rbs +1171 -0
  82. data/core/rubygems/source_list.rbs +15 -0
  83. data/core/rubygems/specification.rbs +23 -0
  84. data/core/rubygems/stream_ui.rbs +5 -0
  85. data/core/rubygems/uninstaller.rbs +10 -0
  86. data/core/rubygems/version.rbs +294 -0
  87. data/core/set.rbs +621 -0
  88. data/core/signal.rbs +100 -0
  89. data/core/string.rbs +3583 -0
  90. data/core/struct.rbs +667 -0
  91. data/core/symbol.rbs +475 -0
  92. data/core/thread.rbs +1765 -0
  93. data/core/thread_group.rbs +79 -0
  94. data/core/time.rbs +1762 -0
  95. data/core/trace_point.rbs +477 -0
  96. data/core/true_class.rbs +98 -0
  97. data/core/unbound_method.rbs +329 -0
  98. data/core/warning.rbs +87 -0
  99. data/docs/CONTRIBUTING.md +106 -0
  100. data/docs/architecture.md +110 -0
  101. data/docs/collection.md +192 -0
  102. data/docs/data_and_struct.md +86 -0
  103. data/docs/gem.md +57 -0
  104. data/docs/rbs_by_example.md +309 -0
  105. data/docs/repo.md +125 -0
  106. data/docs/sigs.md +167 -0
  107. data/docs/stdlib.md +147 -0
  108. data/docs/syntax.md +910 -0
  109. data/docs/tools.md +17 -0
  110. data/exe/rbs +7 -0
  111. data/ext/rbs_extension/extconf.rb +15 -0
  112. data/ext/rbs_extension/lexer.c +2728 -0
  113. data/ext/rbs_extension/lexer.h +179 -0
  114. data/ext/rbs_extension/lexer.re +147 -0
  115. data/ext/rbs_extension/lexstate.c +175 -0
  116. data/ext/rbs_extension/location.c +325 -0
  117. data/ext/rbs_extension/location.h +85 -0
  118. data/ext/rbs_extension/main.c +33 -0
  119. data/ext/rbs_extension/parser.c +2973 -0
  120. data/ext/rbs_extension/parser.h +18 -0
  121. data/ext/rbs_extension/parserstate.c +397 -0
  122. data/ext/rbs_extension/parserstate.h +163 -0
  123. data/ext/rbs_extension/rbs_extension.h +31 -0
  124. data/ext/rbs_extension/unescape.c +32 -0
  125. data/goodcheck.yml +91 -0
  126. data/include/rbs/constants.h +82 -0
  127. data/include/rbs/ruby_objs.h +72 -0
  128. data/include/rbs/util/rbs_constant_pool.h +219 -0
  129. data/include/rbs.h +7 -0
  130. data/lib/rbs/ancestor_graph.rb +92 -0
  131. data/lib/rbs/annotate/annotations.rb +199 -0
  132. data/lib/rbs/annotate/formatter.rb +92 -0
  133. data/lib/rbs/annotate/rdoc_annotator.rb +400 -0
  134. data/lib/rbs/annotate/rdoc_source.rb +131 -0
  135. data/lib/rbs/annotate.rb +8 -0
  136. data/lib/rbs/ast/annotation.rb +29 -0
  137. data/lib/rbs/ast/comment.rb +29 -0
  138. data/lib/rbs/ast/declarations.rb +467 -0
  139. data/lib/rbs/ast/directives.rb +49 -0
  140. data/lib/rbs/ast/members.rb +451 -0
  141. data/lib/rbs/ast/type_param.rb +225 -0
  142. data/lib/rbs/ast/visitor.rb +137 -0
  143. data/lib/rbs/buffer.rb +67 -0
  144. data/lib/rbs/builtin_names.rb +58 -0
  145. data/lib/rbs/cli/colored_io.rb +48 -0
  146. data/lib/rbs/cli/diff.rb +83 -0
  147. data/lib/rbs/cli/validate.rb +357 -0
  148. data/lib/rbs/cli.rb +1223 -0
  149. data/lib/rbs/collection/cleaner.rb +38 -0
  150. data/lib/rbs/collection/config/lockfile.rb +92 -0
  151. data/lib/rbs/collection/config/lockfile_generator.rb +218 -0
  152. data/lib/rbs/collection/config.rb +81 -0
  153. data/lib/rbs/collection/installer.rb +32 -0
  154. data/lib/rbs/collection/sources/base.rb +14 -0
  155. data/lib/rbs/collection/sources/git.rb +258 -0
  156. data/lib/rbs/collection/sources/local.rb +81 -0
  157. data/lib/rbs/collection/sources/rubygems.rb +48 -0
  158. data/lib/rbs/collection/sources/stdlib.rb +50 -0
  159. data/lib/rbs/collection/sources.rb +38 -0
  160. data/lib/rbs/collection.rb +16 -0
  161. data/lib/rbs/constant.rb +28 -0
  162. data/lib/rbs/definition.rb +401 -0
  163. data/lib/rbs/definition_builder/ancestor_builder.rb +620 -0
  164. data/lib/rbs/definition_builder/method_builder.rb +254 -0
  165. data/lib/rbs/definition_builder.rb +845 -0
  166. data/lib/rbs/diff.rb +125 -0
  167. data/lib/rbs/environment/use_map.rb +77 -0
  168. data/lib/rbs/environment.rb +829 -0
  169. data/lib/rbs/environment_loader.rb +173 -0
  170. data/lib/rbs/environment_walker.rb +155 -0
  171. data/lib/rbs/errors.rb +645 -0
  172. data/lib/rbs/factory.rb +18 -0
  173. data/lib/rbs/file_finder.rb +28 -0
  174. data/lib/rbs/location_aux.rb +138 -0
  175. data/lib/rbs/locator.rb +243 -0
  176. data/lib/rbs/method_type.rb +143 -0
  177. data/lib/rbs/namespace.rb +125 -0
  178. data/lib/rbs/parser/lex_result.rb +15 -0
  179. data/lib/rbs/parser/token.rb +23 -0
  180. data/lib/rbs/parser_aux.rb +114 -0
  181. data/lib/rbs/prototype/helpers.rb +140 -0
  182. data/lib/rbs/prototype/node_usage.rb +99 -0
  183. data/lib/rbs/prototype/rb.rb +840 -0
  184. data/lib/rbs/prototype/rbi.rb +641 -0
  185. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  186. data/lib/rbs/prototype/runtime/reflection.rb +19 -0
  187. data/lib/rbs/prototype/runtime/value_object_generator.rb +279 -0
  188. data/lib/rbs/prototype/runtime.rb +667 -0
  189. data/lib/rbs/repository.rb +127 -0
  190. data/lib/rbs/resolver/constant_resolver.rb +219 -0
  191. data/lib/rbs/resolver/type_name_resolver.rb +91 -0
  192. data/lib/rbs/sorter.rb +198 -0
  193. data/lib/rbs/substitution.rb +83 -0
  194. data/lib/rbs/subtractor.rb +201 -0
  195. data/lib/rbs/test/errors.rb +80 -0
  196. data/lib/rbs/test/guaranteed.rb +30 -0
  197. data/lib/rbs/test/hook.rb +212 -0
  198. data/lib/rbs/test/observer.rb +19 -0
  199. data/lib/rbs/test/setup.rb +84 -0
  200. data/lib/rbs/test/setup_helper.rb +50 -0
  201. data/lib/rbs/test/tester.rb +167 -0
  202. data/lib/rbs/test/type_check.rb +435 -0
  203. data/lib/rbs/test.rb +112 -0
  204. data/lib/rbs/type_alias_dependency.rb +100 -0
  205. data/lib/rbs/type_alias_regularity.rb +126 -0
  206. data/lib/rbs/type_name.rb +109 -0
  207. data/lib/rbs/types.rb +1596 -0
  208. data/lib/rbs/unit_test/convertibles.rb +176 -0
  209. data/lib/rbs/unit_test/spy.rb +138 -0
  210. data/lib/rbs/unit_test/type_assertions.rb +347 -0
  211. data/lib/rbs/unit_test/with_aliases.rb +143 -0
  212. data/lib/rbs/unit_test.rb +6 -0
  213. data/lib/rbs/validator.rb +186 -0
  214. data/lib/rbs/variance_calculator.rb +189 -0
  215. data/lib/rbs/vendorer.rb +71 -0
  216. data/lib/rbs/version.rb +5 -0
  217. data/lib/rbs/writer.rb +424 -0
  218. data/lib/rbs.rb +94 -0
  219. data/lib/rdoc/discover.rb +20 -0
  220. data/lib/rdoc_plugin/parser.rb +163 -0
  221. data/rbs-relaxed.gemspec +48 -0
  222. data/schema/annotation.json +14 -0
  223. data/schema/comment.json +26 -0
  224. data/schema/decls.json +326 -0
  225. data/schema/function.json +87 -0
  226. data/schema/location.json +56 -0
  227. data/schema/members.json +266 -0
  228. data/schema/methodType.json +50 -0
  229. data/schema/typeParam.json +36 -0
  230. data/schema/types.json +317 -0
  231. data/sig/ancestor_builder.rbs +163 -0
  232. data/sig/ancestor_graph.rbs +60 -0
  233. data/sig/annotate/annotations.rbs +102 -0
  234. data/sig/annotate/formatter.rbs +24 -0
  235. data/sig/annotate/rdoc_annotater.rbs +82 -0
  236. data/sig/annotate/rdoc_source.rbs +30 -0
  237. data/sig/annotation.rbs +27 -0
  238. data/sig/buffer.rbs +32 -0
  239. data/sig/builtin_names.rbs +44 -0
  240. data/sig/cli/colored_io.rbs +15 -0
  241. data/sig/cli/diff.rbs +21 -0
  242. data/sig/cli/validate.rbs +43 -0
  243. data/sig/cli.rbs +87 -0
  244. data/sig/collection/cleaner.rbs +13 -0
  245. data/sig/collection/config/lockfile.rbs +74 -0
  246. data/sig/collection/config/lockfile_generator.rbs +66 -0
  247. data/sig/collection/config.rbs +46 -0
  248. data/sig/collection/installer.rbs +17 -0
  249. data/sig/collection/sources.rbs +214 -0
  250. data/sig/collection.rbs +4 -0
  251. data/sig/comment.rbs +26 -0
  252. data/sig/constant.rbs +21 -0
  253. data/sig/declarations.rbs +267 -0
  254. data/sig/definition.rbs +173 -0
  255. data/sig/definition_builder.rbs +165 -0
  256. data/sig/diff.rbs +28 -0
  257. data/sig/directives.rbs +77 -0
  258. data/sig/environment.rbs +279 -0
  259. data/sig/environment_loader.rbs +111 -0
  260. data/sig/environment_walker.rbs +65 -0
  261. data/sig/errors.rbs +405 -0
  262. data/sig/factory.rbs +5 -0
  263. data/sig/file_finder.rbs +28 -0
  264. data/sig/location.rbs +110 -0
  265. data/sig/locator.rbs +58 -0
  266. data/sig/manifest.yaml +7 -0
  267. data/sig/members.rbs +258 -0
  268. data/sig/method_builder.rbs +84 -0
  269. data/sig/method_types.rbs +58 -0
  270. data/sig/namespace.rbs +146 -0
  271. data/sig/parser.rbs +100 -0
  272. data/sig/prototype/helpers.rbs +27 -0
  273. data/sig/prototype/node_usage.rbs +20 -0
  274. data/sig/prototype/rb.rbs +96 -0
  275. data/sig/prototype/rbi.rbs +75 -0
  276. data/sig/prototype/runtime.rbs +182 -0
  277. data/sig/rbs.rbs +21 -0
  278. data/sig/rdoc/rbs.rbs +67 -0
  279. data/sig/repository.rbs +85 -0
  280. data/sig/resolver/constant_resolver.rbs +92 -0
  281. data/sig/resolver/context.rbs +34 -0
  282. data/sig/resolver/type_name_resolver.rbs +35 -0
  283. data/sig/shims/bundler.rbs +38 -0
  284. data/sig/shims/enumerable.rbs +5 -0
  285. data/sig/shims/rubygems.rbs +19 -0
  286. data/sig/sorter.rbs +41 -0
  287. data/sig/substitution.rbs +48 -0
  288. data/sig/subtractor.rbs +37 -0
  289. data/sig/test/errors.rbs +52 -0
  290. data/sig/test/guranteed.rbs +9 -0
  291. data/sig/test/type_check.rbs +19 -0
  292. data/sig/test.rbs +82 -0
  293. data/sig/type_alias_dependency.rbs +53 -0
  294. data/sig/type_alias_regularity.rbs +98 -0
  295. data/sig/type_param.rbs +110 -0
  296. data/sig/typename.rbs +79 -0
  297. data/sig/types.rbs +579 -0
  298. data/sig/unit_test/convertibles.rbs +154 -0
  299. data/sig/unit_test/spy.rbs +30 -0
  300. data/sig/unit_test/type_assertions.rbs +196 -0
  301. data/sig/unit_test/with_aliases.rbs +136 -0
  302. data/sig/use_map.rbs +35 -0
  303. data/sig/util.rbs +9 -0
  304. data/sig/validator.rbs +63 -0
  305. data/sig/variance_calculator.rbs +87 -0
  306. data/sig/vendorer.rbs +51 -0
  307. data/sig/version.rbs +3 -0
  308. data/sig/visitor.rbs +47 -0
  309. data/sig/writer.rbs +127 -0
  310. data/src/constants.c +153 -0
  311. data/src/ruby_objs.c +795 -0
  312. data/src/util/rbs_constant_pool.c +342 -0
  313. data/stdlib/abbrev/0/abbrev.rbs +66 -0
  314. data/stdlib/abbrev/0/array.rbs +26 -0
  315. data/stdlib/base64/0/base64.rbs +355 -0
  316. data/stdlib/benchmark/0/benchmark.rbs +452 -0
  317. data/stdlib/bigdecimal/0/big_decimal.rbs +1629 -0
  318. data/stdlib/bigdecimal-math/0/big_math.rbs +119 -0
  319. data/stdlib/bigdecimal-math/0/manifest.yaml +2 -0
  320. data/stdlib/cgi/0/core.rbs +1285 -0
  321. data/stdlib/cgi/0/manifest.yaml +3 -0
  322. data/stdlib/coverage/0/coverage.rbs +263 -0
  323. data/stdlib/csv/0/csv.rbs +3776 -0
  324. data/stdlib/csv/0/manifest.yaml +3 -0
  325. data/stdlib/date/0/date.rbs +1585 -0
  326. data/stdlib/date/0/date_time.rbs +616 -0
  327. data/stdlib/date/0/time.rbs +26 -0
  328. data/stdlib/dbm/0/dbm.rbs +421 -0
  329. data/stdlib/delegate/0/delegator.rbs +184 -0
  330. data/stdlib/delegate/0/kernel.rbs +47 -0
  331. data/stdlib/delegate/0/simple_delegator.rbs +96 -0
  332. data/stdlib/did_you_mean/0/did_you_mean.rbs +343 -0
  333. data/stdlib/digest/0/digest.rbs +577 -0
  334. data/stdlib/erb/0/erb.rbs +532 -0
  335. data/stdlib/etc/0/etc.rbs +865 -0
  336. data/stdlib/fileutils/0/fileutils.rbs +1734 -0
  337. data/stdlib/find/0/find.rbs +49 -0
  338. data/stdlib/forwardable/0/forwardable.rbs +268 -0
  339. data/stdlib/io-console/0/io-console.rbs +414 -0
  340. data/stdlib/ipaddr/0/ipaddr.rbs +428 -0
  341. data/stdlib/json/0/json.rbs +1916 -0
  342. data/stdlib/kconv/0/kconv.rbs +166 -0
  343. data/stdlib/logger/0/formatter.rbs +45 -0
  344. data/stdlib/logger/0/log_device.rbs +100 -0
  345. data/stdlib/logger/0/logger.rbs +796 -0
  346. data/stdlib/logger/0/manifest.yaml +2 -0
  347. data/stdlib/logger/0/period.rbs +17 -0
  348. data/stdlib/logger/0/severity.rbs +34 -0
  349. data/stdlib/minitest/0/kernel.rbs +42 -0
  350. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +52 -0
  351. data/stdlib/minitest/0/minitest/assertion.rbs +17 -0
  352. data/stdlib/minitest/0/minitest/assertions.rbs +590 -0
  353. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +23 -0
  354. data/stdlib/minitest/0/minitest/bench_spec.rbs +102 -0
  355. data/stdlib/minitest/0/minitest/benchmark.rbs +259 -0
  356. data/stdlib/minitest/0/minitest/composite_reporter.rbs +25 -0
  357. data/stdlib/minitest/0/minitest/compress.rbs +13 -0
  358. data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
  359. data/stdlib/minitest/0/minitest/expectation.rbs +2 -0
  360. data/stdlib/minitest/0/minitest/expectations.rbs +21 -0
  361. data/stdlib/minitest/0/minitest/guard.rbs +64 -0
  362. data/stdlib/minitest/0/minitest/mock.rbs +64 -0
  363. data/stdlib/minitest/0/minitest/parallel/executor.rbs +46 -0
  364. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +5 -0
  365. data/stdlib/minitest/0/minitest/parallel/test.rbs +3 -0
  366. data/stdlib/minitest/0/minitest/parallel.rbs +2 -0
  367. data/stdlib/minitest/0/minitest/pride_io.rbs +62 -0
  368. data/stdlib/minitest/0/minitest/pride_lol.rbs +19 -0
  369. data/stdlib/minitest/0/minitest/progress_reporter.rbs +11 -0
  370. data/stdlib/minitest/0/minitest/reportable.rbs +53 -0
  371. data/stdlib/minitest/0/minitest/reporter.rbs +5 -0
  372. data/stdlib/minitest/0/minitest/result.rbs +28 -0
  373. data/stdlib/minitest/0/minitest/runnable.rbs +163 -0
  374. data/stdlib/minitest/0/minitest/skip.rbs +6 -0
  375. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +48 -0
  376. data/stdlib/minitest/0/minitest/spec/dsl.rbs +129 -0
  377. data/stdlib/minitest/0/minitest/spec.rbs +11 -0
  378. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +81 -0
  379. data/stdlib/minitest/0/minitest/summary_reporter.rbs +18 -0
  380. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +92 -0
  381. data/stdlib/minitest/0/minitest/test.rbs +69 -0
  382. data/stdlib/minitest/0/minitest/unexpected_error.rbs +12 -0
  383. data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
  384. data/stdlib/minitest/0/minitest/unit/test_case.rbs +3 -0
  385. data/stdlib/minitest/0/minitest/unit.rbs +4 -0
  386. data/stdlib/minitest/0/minitest.rbs +115 -0
  387. data/stdlib/monitor/0/monitor.rbs +363 -0
  388. data/stdlib/mutex_m/0/mutex_m.rbs +104 -0
  389. data/stdlib/net-http/0/manifest.yaml +3 -0
  390. data/stdlib/net-http/0/net-http.rbs +5552 -0
  391. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  392. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  393. data/stdlib/net-smtp/0/manifest.yaml +2 -0
  394. data/stdlib/net-smtp/0/net-smtp.rbs +55 -0
  395. data/stdlib/nkf/0/nkf.rbs +402 -0
  396. data/stdlib/objspace/0/objspace.rbs +487 -0
  397. data/stdlib/observable/0/observable.rbs +217 -0
  398. data/stdlib/open-uri/0/manifest.yaml +4 -0
  399. data/stdlib/open-uri/0/open-uri.rbs +393 -0
  400. data/stdlib/open3/0/open3.rbs +147 -0
  401. data/stdlib/openssl/0/manifest.yaml +3 -0
  402. data/stdlib/openssl/0/openssl.rbs +12113 -0
  403. data/stdlib/optparse/0/optparse.rbs +1725 -0
  404. data/stdlib/pathname/0/pathname.rbs +1406 -0
  405. data/stdlib/pp/0/manifest.yaml +2 -0
  406. data/stdlib/pp/0/pp.rbs +300 -0
  407. data/stdlib/prettyprint/0/prettyprint.rbs +383 -0
  408. data/stdlib/pstore/0/pstore.rbs +603 -0
  409. data/stdlib/psych/0/core_ext.rbs +12 -0
  410. data/stdlib/psych/0/dbm.rbs +237 -0
  411. data/stdlib/psych/0/manifest.yaml +3 -0
  412. data/stdlib/psych/0/psych.rbs +402 -0
  413. data/stdlib/psych/0/store.rbs +59 -0
  414. data/stdlib/pty/0/pty.rbs +237 -0
  415. data/stdlib/rdoc/0/code_object.rbs +51 -0
  416. data/stdlib/rdoc/0/comment.rbs +59 -0
  417. data/stdlib/rdoc/0/context.rbs +153 -0
  418. data/stdlib/rdoc/0/markup.rbs +117 -0
  419. data/stdlib/rdoc/0/parser.rbs +56 -0
  420. data/stdlib/rdoc/0/rdoc.rbs +391 -0
  421. data/stdlib/rdoc/0/ri.rbs +17 -0
  422. data/stdlib/rdoc/0/store.rbs +48 -0
  423. data/stdlib/rdoc/0/top_level.rbs +97 -0
  424. data/stdlib/resolv/0/manifest.yaml +3 -0
  425. data/stdlib/resolv/0/resolv.rbs +1830 -0
  426. data/stdlib/ripper/0/ripper.rbs +1648 -0
  427. data/stdlib/securerandom/0/securerandom.rbs +62 -0
  428. data/stdlib/shellwords/0/shellwords.rbs +229 -0
  429. data/stdlib/singleton/0/singleton.rbs +131 -0
  430. data/stdlib/socket/0/addrinfo.rbs +666 -0
  431. data/stdlib/socket/0/basic_socket.rbs +590 -0
  432. data/stdlib/socket/0/constants.rbs +2295 -0
  433. data/stdlib/socket/0/ip_socket.rbs +92 -0
  434. data/stdlib/socket/0/socket.rbs +4157 -0
  435. data/stdlib/socket/0/socket_error.rbs +5 -0
  436. data/stdlib/socket/0/tcp_server.rbs +192 -0
  437. data/stdlib/socket/0/tcp_socket.rbs +79 -0
  438. data/stdlib/socket/0/udp_socket.rbs +133 -0
  439. data/stdlib/socket/0/unix_server.rbs +169 -0
  440. data/stdlib/socket/0/unix_socket.rbs +172 -0
  441. data/stdlib/stringio/0/stringio.rbs +567 -0
  442. data/stdlib/strscan/0/string_scanner.rbs +1627 -0
  443. data/stdlib/tempfile/0/tempfile.rbs +479 -0
  444. data/stdlib/time/0/time.rbs +432 -0
  445. data/stdlib/timeout/0/timeout.rbs +81 -0
  446. data/stdlib/tmpdir/0/tmpdir.rbs +69 -0
  447. data/stdlib/tsort/0/cyclic.rbs +5 -0
  448. data/stdlib/tsort/0/interfaces.rbs +20 -0
  449. data/stdlib/tsort/0/tsort.rbs +409 -0
  450. data/stdlib/uri/0/common.rbs +582 -0
  451. data/stdlib/uri/0/file.rbs +118 -0
  452. data/stdlib/uri/0/ftp.rbs +13 -0
  453. data/stdlib/uri/0/generic.rbs +1108 -0
  454. data/stdlib/uri/0/http.rbs +104 -0
  455. data/stdlib/uri/0/https.rbs +14 -0
  456. data/stdlib/uri/0/ldap.rbs +230 -0
  457. data/stdlib/uri/0/ldaps.rbs +14 -0
  458. data/stdlib/uri/0/mailto.rbs +92 -0
  459. data/stdlib/uri/0/rfc2396_parser.rbs +189 -0
  460. data/stdlib/uri/0/rfc3986_parser.rbs +2 -0
  461. data/stdlib/uri/0/ws.rbs +13 -0
  462. data/stdlib/uri/0/wss.rbs +9 -0
  463. data/stdlib/yaml/0/manifest.yaml +2 -0
  464. data/stdlib/yaml/0/yaml.rbs +1 -0
  465. data/stdlib/zlib/0/buf_error.rbs +10 -0
  466. data/stdlib/zlib/0/data_error.rbs +10 -0
  467. data/stdlib/zlib/0/deflate.rbs +210 -0
  468. data/stdlib/zlib/0/error.rbs +20 -0
  469. data/stdlib/zlib/0/gzip_file/crc_error.rbs +12 -0
  470. data/stdlib/zlib/0/gzip_file/error.rbs +23 -0
  471. data/stdlib/zlib/0/gzip_file/length_error.rbs +12 -0
  472. data/stdlib/zlib/0/gzip_file/no_footer.rbs +11 -0
  473. data/stdlib/zlib/0/gzip_file.rbs +156 -0
  474. data/stdlib/zlib/0/gzip_reader.rbs +293 -0
  475. data/stdlib/zlib/0/gzip_writer.rbs +166 -0
  476. data/stdlib/zlib/0/inflate.rbs +180 -0
  477. data/stdlib/zlib/0/mem_error.rbs +10 -0
  478. data/stdlib/zlib/0/need_dict.rbs +13 -0
  479. data/stdlib/zlib/0/stream_end.rbs +11 -0
  480. data/stdlib/zlib/0/stream_error.rbs +11 -0
  481. data/stdlib/zlib/0/version_error.rbs +11 -0
  482. data/stdlib/zlib/0/zlib.rbs +449 -0
  483. data/stdlib/zlib/0/zstream.rbs +200 -0
  484. metadata +532 -0
@@ -0,0 +1,1734 @@
1
+ # <!-- rdoc-file=lib/fileutils.rb -->
2
+ # Namespace for file utility methods for copying, moving, removing, etc.
3
+ #
4
+ # ## What's Here
5
+ #
6
+ # First, what’s elsewhere. Module FileUtils:
7
+ #
8
+ # * Inherits from [class Object](rdoc-ref:Object).
9
+ # * Supplements [class File](rdoc-ref:File) (but is not included or extended
10
+ # there).
11
+ #
12
+ # Here, module FileUtils provides methods that are useful for:
13
+ #
14
+ # * [Creating](rdoc-ref:FileUtils@Creating).
15
+ # * [Deleting](rdoc-ref:FileUtils@Deleting).
16
+ # * [Querying](rdoc-ref:FileUtils@Querying).
17
+ # * [Setting](rdoc-ref:FileUtils@Setting).
18
+ # * [Comparing](rdoc-ref:FileUtils@Comparing).
19
+ # * [Copying](rdoc-ref:FileUtils@Copying).
20
+ # * [Moving](rdoc-ref:FileUtils@Moving).
21
+ # * [Options](rdoc-ref:FileUtils@Options).
22
+ #
23
+ # ### Creating
24
+ #
25
+ # * ::mkdir: Creates directories.
26
+ # * ::mkdir_p, ::makedirs, ::mkpath: Creates directories, also creating
27
+ # ancestor directories as needed.
28
+ # * ::link_entry: Creates a hard link.
29
+ # * ::ln, ::link: Creates hard links.
30
+ # * ::ln_s, ::symlink: Creates symbolic links.
31
+ # * ::ln_sf: Creates symbolic links, overwriting if necessary.
32
+ # * ::ln_sr: Creates symbolic links relative to targets
33
+ #
34
+ # ### Deleting
35
+ #
36
+ # * ::remove_dir: Removes a directory and its descendants.
37
+ # * ::remove_entry: Removes an entry, including its descendants if it is a
38
+ # directory.
39
+ # * ::remove_entry_secure: Like ::remove_entry, but removes securely.
40
+ # * ::remove_file: Removes a file entry.
41
+ # * ::rm, ::remove: Removes entries.
42
+ # * ::rm_f, ::safe_unlink: Like ::rm, but removes forcibly.
43
+ # * ::rm_r: Removes entries and their descendants.
44
+ # * ::rm_rf, ::rmtree: Like ::rm_r, but removes forcibly.
45
+ # * ::rmdir: Removes directories.
46
+ #
47
+ # ### Querying
48
+ #
49
+ # * ::pwd, ::getwd: Returns the path to the working directory.
50
+ # * ::uptodate?: Returns whether a given entry is newer than given other
51
+ # entries.
52
+ #
53
+ # ### Setting
54
+ #
55
+ # * ::cd, ::chdir: Sets the working directory.
56
+ # * ::chmod: Sets permissions for an entry.
57
+ # * ::chmod_R: Sets permissions for an entry and its descendants.
58
+ # * ::chown: Sets the owner and group for entries.
59
+ # * ::chown_R: Sets the owner and group for entries and their descendants.
60
+ # * ::touch: Sets modification and access times for entries, creating if
61
+ # necessary.
62
+ #
63
+ # ### Comparing
64
+ #
65
+ # * ::compare_file, ::cmp, ::identical?: Returns whether two entries are
66
+ # identical.
67
+ # * ::compare_stream: Returns whether two streams are identical.
68
+ #
69
+ # ### Copying
70
+ #
71
+ # * ::copy_entry: Recursively copies an entry.
72
+ # * ::copy_file: Copies an entry.
73
+ # * ::copy_stream: Copies a stream.
74
+ # * ::cp, ::copy: Copies files.
75
+ # * ::cp_lr: Recursively creates hard links.
76
+ # * ::cp_r: Recursively copies files, retaining mode, owner, and group.
77
+ # * ::install: Recursively copies files, optionally setting mode, owner, and
78
+ # group.
79
+ #
80
+ # ### Moving
81
+ #
82
+ # * ::mv, ::move: Moves entries.
83
+ #
84
+ # ### Options
85
+ #
86
+ # * ::collect_method: Returns the names of methods that accept a given option.
87
+ # * ::commands: Returns the names of methods that accept options.
88
+ # * ::have_option?: Returns whether a given method accepts a given option.
89
+ # * ::options: Returns all option names.
90
+ # * ::options_of: Returns the names of the options for a given method.
91
+ #
92
+ # ## Path Arguments
93
+ #
94
+ # Some methods in FileUtils accept *path* arguments, which are interpreted as
95
+ # paths to filesystem entries:
96
+ #
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.
100
+ #
101
+ # ## About the Examples
102
+ #
103
+ # Some examples here involve trees of file entries. For these, we sometimes
104
+ # display trees using the [tree command-line
105
+ # utility](https://en.wikipedia.org/wiki/Tree_(command)), which is a recursive
106
+ # directory-listing utility that produces a depth-indented listing of files and
107
+ # directories.
108
+ #
109
+ # We use a helper method to launch the command and control the format:
110
+ #
111
+ # def tree(dirpath = '.')
112
+ # command = "tree --noreport --charset=ascii #{dirpath}"
113
+ # system(command)
114
+ # end
115
+ #
116
+ # To illustrate:
117
+ #
118
+ # tree('src0')
119
+ # # => src0
120
+ # # |-- sub0
121
+ # # | |-- src0.txt
122
+ # # | `-- src1.txt
123
+ # # `-- sub1
124
+ # # |-- src2.txt
125
+ # # `-- src3.txt
126
+ #
127
+ # ## Avoiding the TOCTTOU Vulnerability
128
+ #
129
+ # For certain methods that recursively remove entries, there is a potential
130
+ # vulnerability called the [Time-of-check to
131
+ # time-of-use](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use), or
132
+ # TOCTTOU, vulnerability that can exist when:
133
+ #
134
+ # * An ancestor directory of the entry at the target path is world writable;
135
+ # such directories include `/tmp`.
136
+ # * The directory tree at the target path includes:
137
+ #
138
+ # * A world-writable descendant directory.
139
+ # * A symbolic link.
140
+ #
141
+ # To avoid that vulnerability, you can use this method to remove entries:
142
+ #
143
+ # * FileUtils.remove_entry_secure: removes recursively if the target path
144
+ # points to a directory.
145
+ #
146
+ # Also available are these methods, each of which calls
147
+ # FileUtils.remove_entry_secure:
148
+ #
149
+ # * FileUtils.rm_r with keyword argument `secure: true`.
150
+ # * FileUtils.rm_rf with keyword argument `secure: true`.
151
+ #
152
+ # Finally, this method for moving entries calls FileUtils.remove_entry_secure if
153
+ # the source and destination are on different file systems (which means that the
154
+ # "move" is really a copy and remove):
155
+ #
156
+ # * FileUtils.mv with keyword argument `secure: true`.
157
+ #
158
+ # Method FileUtils.remove_entry_secure removes securely by applying a special
159
+ # pre-process:
160
+ #
161
+ # * If the target path points to a directory, this method uses methods
162
+ # [File#chown](rdoc-ref:File#chown) and [File#chmod](rdoc-ref:File#chmod) in
163
+ # removing directories.
164
+ # * The owner of the target directory should be either the current process or
165
+ # the super user (root).
166
+ #
167
+ # WARNING: You must ensure that **ALL** parent directories cannot be moved by
168
+ # other untrusted users. For example, parent directories should not be owned by
169
+ # untrusted users, and should not be world writable except when the sticky bit
170
+ # is set.
171
+ #
172
+ # For details of this security vulnerability, see Perl cases:
173
+ #
174
+ # * [CVE-2005-0448](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-04
175
+ # 48).
176
+ # * [CVE-2004-0452](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-04
177
+ # 52).
178
+ #
179
+ module FileUtils
180
+ # <!-- rdoc-file=lib/fileutils.rb -->
181
+ # The version number.
182
+ #
183
+ VERSION: String
184
+
185
+ type mode = Integer | String
186
+
187
+ type path = string | _ToPath
188
+
189
+ type pathlist = path | Array[path]
190
+
191
+ # <!--
192
+ # rdoc-file=lib/fileutils.rb
193
+ # - cd(dir, verbose: nil) { |dir| ... }
194
+ # -->
195
+ # Changes the working directory to the given `dir`, which should be
196
+ # [interpretable as a path](rdoc-ref:FileUtils@Path+Arguments):
197
+ #
198
+ # With no block given, changes the current directory to the directory at `dir`;
199
+ # returns zero:
200
+ #
201
+ # FileUtils.pwd # => "/rdoc/fileutils"
202
+ # FileUtils.cd('..')
203
+ # FileUtils.pwd # => "/rdoc"
204
+ # FileUtils.cd('fileutils')
205
+ #
206
+ # With a block given, changes the current directory to the directory at `dir`,
207
+ # calls the block with argument `dir`, and restores the original current
208
+ # directory; returns the block's value:
209
+ #
210
+ # FileUtils.pwd # => "/rdoc/fileutils"
211
+ # FileUtils.cd('..') { |arg| [arg, FileUtils.pwd] } # => ["..", "/rdoc"]
212
+ # FileUtils.pwd # => "/rdoc/fileutils"
213
+ #
214
+ # Keyword arguments:
215
+ #
216
+ # * `verbose: true` - prints an equivalent command:
217
+ #
218
+ # FileUtils.cd('..')
219
+ # FileUtils.cd('fileutils')
220
+ #
221
+ # Output:
222
+ #
223
+ # cd ..
224
+ # cd fileutils
225
+ #
226
+ # Related: FileUtils.pwd.
227
+ #
228
+ def self?.cd: (path dir, ?verbose: boolish) -> void
229
+ | [X] (path dir, ?verbose: boolish) { (String) -> X } -> X
230
+
231
+ # <!--
232
+ # rdoc-file=lib/fileutils.rb
233
+ # - chdir(dir, verbose: nil)
234
+ # -->
235
+ #
236
+ alias self.chdir self.cd
237
+
238
+ # <!--
239
+ # rdoc-file=lib/fileutils.rb
240
+ # - chdir(dir, verbose: nil)
241
+ # -->
242
+ #
243
+ alias chdir cd
244
+
245
+ # <!--
246
+ # rdoc-file=lib/fileutils.rb
247
+ # - chmod(mode, list, noop: nil, verbose: nil)
248
+ # -->
249
+ # Changes permissions on the entries at the paths given in `list` (a single path
250
+ # or an array of paths) to the permissions given by `mode`; returns `list` if it
251
+ # is an array, `[list]` otherwise:
252
+ #
253
+ # * Modifies each entry that is a regular file using
254
+ # [File.chmod](rdoc-ref:File.chmod).
255
+ # * Modifies each entry that is a symbolic link using
256
+ # [File.lchmod](rdoc-ref:File.lchmod).
257
+ #
258
+ # Argument `list` or its elements should be [interpretable as
259
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
260
+ #
261
+ # Argument `mode` may be either an integer or a string:
262
+ #
263
+ # * Integer `mode`: represents the permission bits to be set:
264
+ #
265
+ # FileUtils.chmod(0755, 'src0.txt')
266
+ # FileUtils.chmod(0644, ['src0.txt', 'src0.dat'])
267
+ #
268
+ # * String `mode`: represents the permissions to be set:
269
+ #
270
+ # The string is of the form `[targets][[operator][perms[,perms]]`, where:
271
+ #
272
+ # * `targets` may be any combination of these letters:
273
+ #
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
+ #
279
+ # * `operator` may be one of these letters:
280
+ #
281
+ # * `'+'`: adds permissions.
282
+ # * `'-'`: removes permissions.
283
+ # * `'='`: sets (replaces) permissions.
284
+ #
285
+ # * `perms` (may be repeated, with separating commas) may be any
286
+ # combination of these letters:
287
+ #
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.
294
+ #
295
+ # Examples:
296
+ #
297
+ # FileUtils.chmod('u=wrx,go=rx', 'src1.txt')
298
+ # FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby')
299
+ #
300
+ # Keyword arguments:
301
+ #
302
+ # * `noop: true` - does not change permissions; returns `nil`.
303
+ # * `verbose: true` - prints an equivalent command:
304
+ #
305
+ # FileUtils.chmod(0755, 'src0.txt', noop: true, verbose: true)
306
+ # FileUtils.chmod(0644, ['src0.txt', 'src0.dat'], noop: true, verbose: true)
307
+ # FileUtils.chmod('u=wrx,go=rx', 'src1.txt', noop: true, verbose: true)
308
+ # FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby', noop: true, verbose: true)
309
+ #
310
+ # Output:
311
+ #
312
+ # chmod 755 src0.txt
313
+ # chmod 644 src0.txt src0.dat
314
+ # chmod u=wrx,go=rx src1.txt
315
+ # chmod u=wrx,go=rx /usr/bin/ruby
316
+ #
317
+ # Related: FileUtils.chmod_R.
318
+ #
319
+ def self?.chmod: (mode mode, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
320
+
321
+ # <!--
322
+ # rdoc-file=lib/fileutils.rb
323
+ # - chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
324
+ # -->
325
+ # Like FileUtils.chmod, but changes permissions recursively.
326
+ #
327
+ def self?.chmod_R: (mode mode, pathlist list, ?noop: boolish, ?verbose: boolish, ?force: boolish) -> void
328
+
329
+ # <!--
330
+ # rdoc-file=lib/fileutils.rb
331
+ # - chown(user, group, list, noop: nil, verbose: nil)
332
+ # -->
333
+ # Changes the owner and group on the entries at the paths given in `list` (a
334
+ # single path or an array of paths) to the given `user` and `group`; returns
335
+ # `list` if it is an array, `[list]` otherwise:
336
+ #
337
+ # * Modifies each entry that is a regular file using
338
+ # [File.chown](rdoc-ref:File.chown).
339
+ # * Modifies each entry that is a symbolic link using
340
+ # [File.lchown](rdoc-ref:File.lchown).
341
+ #
342
+ # Argument `list` or its elements should be [interpretable as
343
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
344
+ #
345
+ # User and group:
346
+ #
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.
351
+ # * The user must be a member of the group.
352
+ #
353
+ # Examples:
354
+ #
355
+ # # One path.
356
+ # # User and group as string names.
357
+ # File.stat('src0.txt').uid # => 1004
358
+ # File.stat('src0.txt').gid # => 1004
359
+ # FileUtils.chown('user2', 'group1', 'src0.txt')
360
+ # File.stat('src0.txt').uid # => 1006
361
+ # File.stat('src0.txt').gid # => 1005
362
+ #
363
+ # # User and group as uid and gid.
364
+ # FileUtils.chown(1004, 1004, 'src0.txt')
365
+ # File.stat('src0.txt').uid # => 1004
366
+ # File.stat('src0.txt').gid # => 1004
367
+ #
368
+ # # Array of paths.
369
+ # FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'])
370
+ #
371
+ # # Directory (not recursive).
372
+ # FileUtils.chown('user2', 'group1', '.')
373
+ #
374
+ # Keyword arguments:
375
+ #
376
+ # * `noop: true` - does not change permissions; returns `nil`.
377
+ # * `verbose: true` - prints an equivalent command:
378
+ #
379
+ # FileUtils.chown('user2', 'group1', 'src0.txt', noop: true, verbose: true)
380
+ # FileUtils.chown(1004, 1004, 'src0.txt', noop: true, verbose: true)
381
+ # FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'], noop: true, verbose: true)
382
+ # FileUtils.chown('user2', 'group1', path, noop: true, verbose: true)
383
+ # FileUtils.chown('user2', 'group1', '.', noop: true, verbose: true)
384
+ #
385
+ # Output:
386
+ #
387
+ # chown user2:group1 src0.txt
388
+ # chown 1004:1004 src0.txt
389
+ # chown 1006:1005 src0.txt src0.dat
390
+ # chown user2:group1 src0.txt
391
+ # chown user2:group1 .
392
+ #
393
+ # Related: FileUtils.chown_R.
394
+ #
395
+ def self?.chown: (String? user, String? group, pathlist list, ?noop: boolish, ?verbose: boolish) -> void
396
+
397
+ # <!--
398
+ # rdoc-file=lib/fileutils.rb
399
+ # - chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
400
+ # -->
401
+ # Like FileUtils.chown, but changes owner and group recursively.
402
+ #
403
+ def self?.chown_R: (String? user, String? group, pathlist list, ?noop: boolish, ?verbose: boolish, ?force: boolish) -> void
404
+
405
+ # <!--
406
+ # rdoc-file=lib/fileutils.rb
407
+ # - collect_method(opt)
408
+ # -->
409
+ # Returns an array of the string method names of the methods that accept the
410
+ # given keyword option `opt`; the argument must be a symbol:
411
+ #
412
+ # FileUtils.collect_method(:preserve) # => ["cp", "copy", "cp_r", "install"]
413
+ #
414
+ def self.collect_method: (Symbol opt) -> Array[String]
415
+
416
+ # <!--
417
+ # rdoc-file=lib/fileutils.rb
418
+ # - commands()
419
+ # -->
420
+ # Returns an array of the string names of FileUtils methods that accept one or
421
+ # more keyword arguments:
422
+ #
423
+ # FileUtils.commands.sort.take(3) # => ["cd", "chdir", "chmod"]
424
+ #
425
+ def self.commands: () -> Array[String]
426
+
427
+ # <!--
428
+ # rdoc-file=lib/fileutils.rb
429
+ # - compare_file(a, b)
430
+ # -->
431
+ # Returns `true` if the contents of files `a` and `b` are identical, `false`
432
+ # otherwise.
433
+ #
434
+ # Arguments `a` and `b` should be [interpretable as a
435
+ # path](rdoc-ref:FileUtils@Path+Arguments).
436
+ #
437
+ # FileUtils.identical? and FileUtils.cmp are aliases for FileUtils.compare_file.
438
+ #
439
+ # Related: FileUtils.compare_stream.
440
+ #
441
+ def self?.compare_file: (path a, path b) -> bool
442
+
443
+ # <!--
444
+ # rdoc-file=lib/fileutils.rb
445
+ # - cmp(a, b)
446
+ # -->
447
+ #
448
+ alias self.cmp self.compare_file
449
+
450
+ # <!--
451
+ # rdoc-file=lib/fileutils.rb
452
+ # - cmp(a, b)
453
+ # -->
454
+ #
455
+ alias cmp compare_file
456
+
457
+ # <!--
458
+ # rdoc-file=lib/fileutils.rb
459
+ # - identical?(a, b)
460
+ # -->
461
+ #
462
+ alias self.identical? self.compare_file
463
+
464
+ # <!--
465
+ # rdoc-file=lib/fileutils.rb
466
+ # - identical?(a, b)
467
+ # -->
468
+ #
469
+ alias identical? compare_file
470
+
471
+ # <!--
472
+ # rdoc-file=lib/fileutils.rb
473
+ # - compare_stream(a, b)
474
+ # -->
475
+ # Returns `true` if the contents of streams `a` and `b` are identical, `false`
476
+ # otherwise.
477
+ #
478
+ # Arguments `a` and `b` should be [interpretable as a
479
+ # path](rdoc-ref:FileUtils@Path+Arguments).
480
+ #
481
+ # Related: FileUtils.compare_file.
482
+ #
483
+ def self?.compare_stream: (IO a, IO b) -> bool
484
+
485
+ # <!--
486
+ # rdoc-file=lib/fileutils.rb
487
+ # - copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
488
+ # -->
489
+ # Recursively copies files from `src` to `dest`.
490
+ #
491
+ # Arguments `src` and `dest` should be [interpretable as
492
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
493
+ #
494
+ # If `src` is the path to a file, copies `src` to `dest`:
495
+ #
496
+ # FileUtils.touch('src0.txt')
497
+ # File.exist?('dest0.txt') # => false
498
+ # FileUtils.copy_entry('src0.txt', 'dest0.txt')
499
+ # File.file?('dest0.txt') # => true
500
+ #
501
+ # If `src` is a directory, recursively copies `src` to `dest`:
502
+ #
503
+ # tree('src1')
504
+ # # => src1
505
+ # # |-- dir0
506
+ # # | |-- src0.txt
507
+ # # | `-- src1.txt
508
+ # # `-- dir1
509
+ # # |-- src2.txt
510
+ # # `-- src3.txt
511
+ # FileUtils.copy_entry('src1', 'dest1')
512
+ # tree('dest1')
513
+ # # => dest1
514
+ # # |-- dir0
515
+ # # | |-- src0.txt
516
+ # # | `-- src1.txt
517
+ # # `-- dir1
518
+ # # |-- src2.txt
519
+ # # `-- src3.txt
520
+ #
521
+ # The recursive copying preserves file types for regular files, directories, and
522
+ # symbolic links; other file types (FIFO streams, device files, etc.) are not
523
+ # supported.
524
+ #
525
+ # Keyword arguments:
526
+ #
527
+ # * `dereference_root: true` - if `src` is a symbolic link, follows the link.
528
+ # * `preserve: true` - preserves file times.
529
+ # * `remove_destination: true` - removes `dest` before copying files.
530
+ #
531
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
532
+ #
533
+ def self?.copy_entry: (path src, path dest, ?boolish preserve, ?boolish dereference_root, ?boolish remove_destination) -> void
534
+
535
+ # <!--
536
+ # rdoc-file=lib/fileutils.rb
537
+ # - copy_file(src, dest, preserve = false, dereference = true)
538
+ # -->
539
+ # Copies file from `src` to `dest`, which should not be directories.
540
+ #
541
+ # Arguments `src` and `dest` should be [interpretable as
542
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
543
+ #
544
+ # Examples:
545
+ #
546
+ # FileUtils.touch('src0.txt')
547
+ # FileUtils.copy_file('src0.txt', 'dest0.txt')
548
+ # File.file?('dest0.txt') # => true
549
+ #
550
+ # Keyword arguments:
551
+ #
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.
556
+ #
557
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
558
+ #
559
+ def self?.copy_file: (path src, path dest, ?boolish preserve, ?boolish dereference) -> void
560
+
561
+ # <!--
562
+ # rdoc-file=lib/fileutils.rb
563
+ # - copy_stream(src, dest)
564
+ # -->
565
+ # Copies IO stream `src` to IO stream `dest` via
566
+ # [IO.copy_stream](rdoc-ref:IO.copy_stream).
567
+ #
568
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
569
+ #
570
+ def self?.copy_stream: (_Reader src, _Writer dest) -> void
571
+
572
+ # <!--
573
+ # rdoc-file=lib/fileutils.rb
574
+ # - cp(src, dest, preserve: nil, noop: nil, verbose: nil)
575
+ # -->
576
+ # Copies files.
577
+ #
578
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
579
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
580
+ #
581
+ # If `src` is the path to a file and `dest` is not the path to a directory,
582
+ # copies `src` to `dest`:
583
+ #
584
+ # FileUtils.touch('src0.txt')
585
+ # File.exist?('dest0.txt') # => false
586
+ # FileUtils.cp('src0.txt', 'dest0.txt')
587
+ # File.file?('dest0.txt') # => true
588
+ #
589
+ # If `src` is the path to a file and `dest` is the path to a directory, copies
590
+ # `src` to `dest/src`:
591
+ #
592
+ # FileUtils.touch('src1.txt')
593
+ # FileUtils.mkdir('dest1')
594
+ # FileUtils.cp('src1.txt', 'dest1')
595
+ # File.file?('dest1/src1.txt') # => true
596
+ #
597
+ # If `src` is an array of paths to files and `dest` is the path to a directory,
598
+ # copies from each `src` to `dest`:
599
+ #
600
+ # src_file_paths = ['src2.txt', 'src2.dat']
601
+ # FileUtils.touch(src_file_paths)
602
+ # FileUtils.mkdir('dest2')
603
+ # FileUtils.cp(src_file_paths, 'dest2')
604
+ # File.file?('dest2/src2.txt') # => true
605
+ # File.file?('dest2/src2.dat') # => true
606
+ #
607
+ # Keyword arguments:
608
+ #
609
+ # * `preserve: true` - preserves file times.
610
+ # * `noop: true` - does not copy files.
611
+ # * `verbose: true` - prints an equivalent command:
612
+ #
613
+ # FileUtils.cp('src0.txt', 'dest0.txt', noop: true, verbose: true)
614
+ # FileUtils.cp('src1.txt', 'dest1', noop: true, verbose: true)
615
+ # FileUtils.cp(src_file_paths, 'dest2', noop: true, verbose: true)
616
+ #
617
+ # Output:
618
+ #
619
+ # cp src0.txt dest0.txt
620
+ # cp src1.txt dest1
621
+ # cp src2.txt src2.dat dest2
622
+ #
623
+ # Raises an exception if `src` is a directory.
624
+ #
625
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
626
+ #
627
+ def self?.cp: (pathlist src, path dest, ?preserve: boolish, ?noop: boolish, ?verbose: boolish) -> void
628
+
629
+ # <!--
630
+ # rdoc-file=lib/fileutils.rb
631
+ # - copy(src, dest, preserve: nil, noop: nil, verbose: nil)
632
+ # -->
633
+ #
634
+ alias self.copy self.cp
635
+
636
+ # <!--
637
+ # rdoc-file=lib/fileutils.rb
638
+ # - copy(src, dest, preserve: nil, noop: nil, verbose: nil)
639
+ # -->
640
+ #
641
+ alias copy cp
642
+
643
+ # <!--
644
+ # rdoc-file=lib/fileutils.rb
645
+ # - cp_lr(src, dest, noop: nil, verbose: nil, dereference_root: true, remove_destination: false)
646
+ # -->
647
+ # Creates [hard links](https://en.wikipedia.org/wiki/Hard_link).
648
+ #
649
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
650
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
651
+ #
652
+ # If `src` is the path to a directory and `dest` does not exist, creates links
653
+ # `dest` and descendents pointing to `src` and its descendents:
654
+ #
655
+ # tree('src0')
656
+ # # => src0
657
+ # # |-- sub0
658
+ # # | |-- src0.txt
659
+ # # | `-- src1.txt
660
+ # # `-- sub1
661
+ # # |-- src2.txt
662
+ # # `-- src3.txt
663
+ # File.exist?('dest0') # => false
664
+ # FileUtils.cp_lr('src0', 'dest0')
665
+ # tree('dest0')
666
+ # # => dest0
667
+ # # |-- sub0
668
+ # # | |-- src0.txt
669
+ # # | `-- src1.txt
670
+ # # `-- sub1
671
+ # # |-- src2.txt
672
+ # # `-- src3.txt
673
+ #
674
+ # If `src` and `dest` are both paths to directories, creates links `dest/src`
675
+ # and descendents pointing to `src` and its descendents:
676
+ #
677
+ # tree('src1')
678
+ # # => src1
679
+ # # |-- sub0
680
+ # # | |-- src0.txt
681
+ # # | `-- src1.txt
682
+ # # `-- sub1
683
+ # # |-- src2.txt
684
+ # # `-- src3.txt
685
+ # FileUtils.mkdir('dest1')
686
+ # FileUtils.cp_lr('src1', 'dest1')
687
+ # tree('dest1')
688
+ # # => dest1
689
+ # # `-- src1
690
+ # # |-- sub0
691
+ # # | |-- src0.txt
692
+ # # | `-- src1.txt
693
+ # # `-- sub1
694
+ # # |-- src2.txt
695
+ # # `-- src3.txt
696
+ #
697
+ # If `src` is an array of paths to entries and `dest` is the path to a
698
+ # directory, for each path `filepath` in `src`, creates a link at
699
+ # `dest/filepath` pointing to that path:
700
+ #
701
+ # tree('src2')
702
+ # # => src2
703
+ # # |-- sub0
704
+ # # | |-- src0.txt
705
+ # # | `-- src1.txt
706
+ # # `-- sub1
707
+ # # |-- src2.txt
708
+ # # `-- src3.txt
709
+ # FileUtils.mkdir('dest2')
710
+ # FileUtils.cp_lr(['src2/sub0', 'src2/sub1'], 'dest2')
711
+ # tree('dest2')
712
+ # # => dest2
713
+ # # |-- sub0
714
+ # # | |-- src0.txt
715
+ # # | `-- src1.txt
716
+ # # `-- sub1
717
+ # # |-- src2.txt
718
+ # # `-- src3.txt
719
+ #
720
+ # Keyword arguments:
721
+ #
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:
727
+ #
728
+ # FileUtils.cp_lr('src0', 'dest0', noop: true, verbose: true)
729
+ # FileUtils.cp_lr('src1', 'dest1', noop: true, verbose: true)
730
+ # FileUtils.cp_lr(['src2/sub0', 'src2/sub1'], 'dest2', noop: true, verbose: true)
731
+ #
732
+ # Output:
733
+ #
734
+ # cp -lr src0 dest0
735
+ # cp -lr src1 dest1
736
+ # cp -lr src2/sub0 src2/sub1 dest2
737
+ #
738
+ # Raises an exception if `dest` is the path to an existing file or directory and
739
+ # keyword argument `remove_destination: true` is not given.
740
+ #
741
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
742
+ #
743
+ def self?.cp_lr: (pathlist src, path dest, ?noop: boolish, ?verbose: boolish, ?dereference_root: boolish, ?remove_destination: boolish) -> void
744
+
745
+ # <!--
746
+ # rdoc-file=lib/fileutils.rb
747
+ # - cp_r(src, dest, preserve: nil, noop: nil, verbose: nil, dereference_root: true, remove_destination: nil)
748
+ # -->
749
+ # Recursively copies files.
750
+ #
751
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
752
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
753
+ #
754
+ # The mode, owner, and group are retained in the copy; to change those, use
755
+ # FileUtils.install instead.
756
+ #
757
+ # If `src` is the path to a file and `dest` is not the path to a directory,
758
+ # copies `src` to `dest`:
759
+ #
760
+ # FileUtils.touch('src0.txt')
761
+ # File.exist?('dest0.txt') # => false
762
+ # FileUtils.cp_r('src0.txt', 'dest0.txt')
763
+ # File.file?('dest0.txt') # => true
764
+ #
765
+ # If `src` is the path to a file and `dest` is the path to a directory, copies
766
+ # `src` to `dest/src`:
767
+ #
768
+ # FileUtils.touch('src1.txt')
769
+ # FileUtils.mkdir('dest1')
770
+ # FileUtils.cp_r('src1.txt', 'dest1')
771
+ # File.file?('dest1/src1.txt') # => true
772
+ #
773
+ # If `src` is the path to a directory and `dest` does not exist, recursively
774
+ # copies `src` to `dest`:
775
+ #
776
+ # tree('src2')
777
+ # # => src2
778
+ # # |-- dir0
779
+ # # | |-- src0.txt
780
+ # # | `-- src1.txt
781
+ # # `-- dir1
782
+ # # |-- src2.txt
783
+ # # `-- src3.txt
784
+ # FileUtils.exist?('dest2') # => false
785
+ # FileUtils.cp_r('src2', 'dest2')
786
+ # tree('dest2')
787
+ # # => dest2
788
+ # # |-- dir0
789
+ # # | |-- src0.txt
790
+ # # | `-- src1.txt
791
+ # # `-- dir1
792
+ # # |-- src2.txt
793
+ # # `-- src3.txt
794
+ #
795
+ # If `src` and `dest` are paths to directories, recursively copies `src` to
796
+ # `dest/src`:
797
+ #
798
+ # tree('src3')
799
+ # # => src3
800
+ # # |-- dir0
801
+ # # | |-- src0.txt
802
+ # # | `-- src1.txt
803
+ # # `-- dir1
804
+ # # |-- src2.txt
805
+ # # `-- src3.txt
806
+ # FileUtils.mkdir('dest3')
807
+ # FileUtils.cp_r('src3', 'dest3')
808
+ # tree('dest3')
809
+ # # => dest3
810
+ # # `-- src3
811
+ # # |-- dir0
812
+ # # | |-- src0.txt
813
+ # # | `-- src1.txt
814
+ # # `-- dir1
815
+ # # |-- src2.txt
816
+ # # `-- src3.txt
817
+ #
818
+ # If `src` is an array of paths and `dest` is a directory, recursively copies
819
+ # from each path in `src` to `dest`; the paths in `src` may point to files
820
+ # and/or directories.
821
+ #
822
+ # Keyword arguments:
823
+ #
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:
830
+ #
831
+ # FileUtils.cp_r('src0.txt', 'dest0.txt', noop: true, verbose: true)
832
+ # FileUtils.cp_r('src1.txt', 'dest1', noop: true, verbose: true)
833
+ # FileUtils.cp_r('src2', 'dest2', noop: true, verbose: true)
834
+ # FileUtils.cp_r('src3', 'dest3', noop: true, verbose: true)
835
+ #
836
+ # Output:
837
+ #
838
+ # cp -r src0.txt dest0.txt
839
+ # cp -r src1.txt dest1
840
+ # cp -r src2 dest2
841
+ # cp -r src3 dest3
842
+ #
843
+ # Raises an exception of `src` is the path to a directory and `dest` is the path
844
+ # to a file.
845
+ #
846
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
847
+ #
848
+ def self?.cp_r: (pathlist src, path dest, ?preserve: boolish, ?noop: boolish, ?verbose: boolish, ?dereference_root: boolish, ?remove_destination: boolish) -> void
849
+
850
+ # <!--
851
+ # rdoc-file=lib/fileutils.rb
852
+ # - have_option?(mid, opt)
853
+ # -->
854
+ # Returns `true` if method `mid` accepts the given option `opt`, `false`
855
+ # otherwise; the arguments may be strings or symbols:
856
+ #
857
+ # FileUtils.have_option?(:chmod, :noop) # => true
858
+ # FileUtils.have_option?('chmod', 'secure') # => false
859
+ #
860
+ def self.have_option?: (Symbol mid, Symbol opt) -> bool
861
+
862
+ # <!--
863
+ # rdoc-file=lib/fileutils.rb
864
+ # - install(src, dest, mode: nil, owner: nil, group: nil, preserve: nil, noop: nil, verbose: nil)
865
+ # -->
866
+ # Copies a file entry. See
867
+ # [install(1)](https://man7.org/linux/man-pages/man1/install.1.html).
868
+ #
869
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
870
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments);
871
+ #
872
+ # If the entry at `dest` does not exist, copies from `src` to `dest`:
873
+ #
874
+ # File.read('src0.txt') # => "aaa\n"
875
+ # File.exist?('dest0.txt') # => false
876
+ # FileUtils.install('src0.txt', 'dest0.txt')
877
+ # File.read('dest0.txt') # => "aaa\n"
878
+ #
879
+ # If `dest` is a file entry, copies from `src` to `dest`, overwriting:
880
+ #
881
+ # File.read('src1.txt') # => "aaa\n"
882
+ # File.read('dest1.txt') # => "bbb\n"
883
+ # FileUtils.install('src1.txt', 'dest1.txt')
884
+ # File.read('dest1.txt') # => "aaa\n"
885
+ #
886
+ # If `dest` is a directory entry, copies from `src` to `dest/src`, overwriting
887
+ # if necessary:
888
+ #
889
+ # File.read('src2.txt') # => "aaa\n"
890
+ # File.read('dest2/src2.txt') # => "bbb\n"
891
+ # FileUtils.install('src2.txt', 'dest2')
892
+ # File.read('dest2/src2.txt') # => "aaa\n"
893
+ #
894
+ # If `src` is an array of paths and `dest` points to a directory, copies each
895
+ # path `path` in `src` to `dest/path`:
896
+ #
897
+ # File.file?('src3.txt') # => true
898
+ # File.file?('src3.dat') # => true
899
+ # FileUtils.mkdir('dest3')
900
+ # FileUtils.install(['src3.txt', 'src3.dat'], 'dest3')
901
+ # File.file?('dest3/src3.txt') # => true
902
+ # File.file?('dest3/src3.dat') # => true
903
+ #
904
+ # Keyword arguments:
905
+ #
906
+ # * `group: *group`* - changes the group if not `nil`, using
907
+ # [File.chown](rdoc-ref:File.chown).
908
+ # * `mode: *permissions`* - changes the permissions. using
909
+ # [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
912
+ # [File.chown](rdoc-ref:File.chown).
913
+ # * `preserve: true` - preserve timestamps using
914
+ # [File.utime](rdoc-ref:File.utime).
915
+ # * `verbose: true` - prints an equivalent command:
916
+ #
917
+ # FileUtils.install('src0.txt', 'dest0.txt', noop: true, verbose: true)
918
+ # FileUtils.install('src1.txt', 'dest1.txt', noop: true, verbose: true)
919
+ # FileUtils.install('src2.txt', 'dest2', noop: true, verbose: true)
920
+ #
921
+ # Output:
922
+ #
923
+ # install -c src0.txt dest0.txt
924
+ # install -c src1.txt dest1.txt
925
+ # install -c src2.txt dest2
926
+ #
927
+ # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
928
+ #
929
+ def self?.install: (path src, path dest, ?mode: mode?, ?owner: String?, ?group: String?, ?preserve: boolish, ?noop: boolish, ?verbose: boolish) -> void
930
+
931
+ # <!--
932
+ # rdoc-file=lib/fileutils.rb
933
+ # - link_entry(src, dest, dereference_root = false, remove_destination = false)
934
+ # -->
935
+ # Creates [hard links](https://en.wikipedia.org/wiki/Hard_link); returns `nil`.
936
+ #
937
+ # Arguments `src` and `dest` should be [interpretable as
938
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
939
+ #
940
+ # If `src` is the path to a file and `dest` does not exist, creates a hard link
941
+ # at `dest` pointing to `src`:
942
+ #
943
+ # FileUtils.touch('src0.txt')
944
+ # File.exist?('dest0.txt') # => false
945
+ # FileUtils.link_entry('src0.txt', 'dest0.txt')
946
+ # File.file?('dest0.txt') # => true
947
+ #
948
+ # If `src` is the path to a directory and `dest` does not exist, recursively
949
+ # creates hard links at `dest` pointing to paths in `src`:
950
+ #
951
+ # FileUtils.mkdir_p(['src1/dir0', 'src1/dir1'])
952
+ # src_file_paths = [
953
+ # 'src1/dir0/t0.txt',
954
+ # 'src1/dir0/t1.txt',
955
+ # 'src1/dir1/t2.txt',
956
+ # 'src1/dir1/t3.txt',
957
+ # ]
958
+ # FileUtils.touch(src_file_paths)
959
+ # File.directory?('dest1') # => true
960
+ # FileUtils.link_entry('src1', 'dest1')
961
+ # File.file?('dest1/dir0/t0.txt') # => true
962
+ # File.file?('dest1/dir0/t1.txt') # => true
963
+ # File.file?('dest1/dir1/t2.txt') # => true
964
+ # File.file?('dest1/dir1/t3.txt') # => true
965
+ #
966
+ # Keyword arguments:
967
+ #
968
+ # * `dereference_root: true` - dereferences `src` if it is a symbolic link.
969
+ # * `remove_destination: true` - removes `dest` before creating links.
970
+ #
971
+ # Raises an exception if `dest` is the path to an existing file or directory and
972
+ # keyword argument `remove_destination: true` is not given.
973
+ #
974
+ # Related: FileUtils.ln (has different options).
975
+ #
976
+ def self?.link_entry: (path src, path dest, ?boolish dereference_root, ?boolish remove_destination) -> void
977
+
978
+ # <!--
979
+ # rdoc-file=lib/fileutils.rb
980
+ # - ln(src, dest, force: nil, noop: nil, verbose: nil)
981
+ # -->
982
+ # Creates [hard links](https://en.wikipedia.org/wiki/Hard_link).
983
+ #
984
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
985
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
986
+ #
987
+ # When `src` is the path to an existing file and `dest` is the path to a
988
+ # non-existent file, creates a hard link at `dest` pointing to `src`; returns
989
+ # zero:
990
+ #
991
+ # Dir.children('tmp0/') # => ["t.txt"]
992
+ # Dir.children('tmp1/') # => []
993
+ # FileUtils.ln('tmp0/t.txt', 'tmp1/t.lnk') # => 0
994
+ # Dir.children('tmp1/') # => ["t.lnk"]
995
+ #
996
+ # 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:
999
+ #
1000
+ # Dir.children('tmp2') # => ["t.dat"]
1001
+ # Dir.children('tmp3') # => []
1002
+ # FileUtils.ln('tmp2/t.dat', 'tmp3') # => 0
1003
+ # Dir.children('tmp3') # => ["t.dat"]
1004
+ #
1005
+ # When `src` is an array of paths to existing files and `dest` is the path to an
1006
+ # existing directory, then for each path `target` in `src`, creates a hard link
1007
+ # at `dest/target` pointing to `target`; returns `src`:
1008
+ #
1009
+ # Dir.children('tmp4/') # => []
1010
+ # FileUtils.ln(['tmp0/t.txt', 'tmp2/t.dat'], 'tmp4/') # => ["tmp0/t.txt", "tmp2/t.dat"]
1011
+ # Dir.children('tmp4/') # => ["t.dat", "t.txt"]
1012
+ #
1013
+ # Keyword arguments:
1014
+ #
1015
+ # * `force: true` - overwrites `dest` if it exists.
1016
+ # * `noop: true` - does not create links.
1017
+ # * `verbose: true` - prints an equivalent command:
1018
+ #
1019
+ # FileUtils.ln('tmp0/t.txt', 'tmp1/t.lnk', verbose: true)
1020
+ # FileUtils.ln('tmp2/t.dat', 'tmp3', verbose: true)
1021
+ # FileUtils.ln(['tmp0/t.txt', 'tmp2/t.dat'], 'tmp4/', verbose: true)
1022
+ #
1023
+ # Output:
1024
+ #
1025
+ # ln tmp0/t.txt tmp1/t.lnk
1026
+ # ln tmp2/t.dat tmp3
1027
+ # ln tmp0/t.txt tmp2/t.dat tmp4/
1028
+ #
1029
+ # Raises an exception if `dest` is the path to an existing file and keyword
1030
+ # argument `force` is not `true`.
1031
+ #
1032
+ # Related: FileUtils.link_entry (has different options).
1033
+ #
1034
+ def self?.ln: (pathlist src, path dest, ?force: boolish, ?noop: boolish, ?verbose: boolish) -> void
1035
+
1036
+ # <!--
1037
+ # rdoc-file=lib/fileutils.rb
1038
+ # - link(src, dest, force: nil, noop: nil, verbose: nil)
1039
+ # -->
1040
+ #
1041
+ alias self.link self.ln
1042
+
1043
+ # <!--
1044
+ # rdoc-file=lib/fileutils.rb
1045
+ # - link(src, dest, force: nil, noop: nil, verbose: nil)
1046
+ # -->
1047
+ #
1048
+ alias link ln
1049
+
1050
+ # <!--
1051
+ # rdoc-file=lib/fileutils.rb
1052
+ # - ln_s(src, dest, force: nil, relative: false, target_directory: true, noop: nil, verbose: nil)
1053
+ # -->
1054
+ # Creates [symbolic links](https://en.wikipedia.org/wiki/Symbolic_link).
1055
+ #
1056
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
1057
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
1058
+ #
1059
+ # If `src` is the path to an existing file:
1060
+ #
1061
+ # * When `dest` is the path to a non-existent file, creates a symbolic link at
1062
+ # `dest` pointing to `src`:
1063
+ #
1064
+ # FileUtils.touch('src0.txt')
1065
+ # File.exist?('dest0.txt') # => false
1066
+ # FileUtils.ln_s('src0.txt', 'dest0.txt')
1067
+ # File.symlink?('dest0.txt') # => true
1068
+ #
1069
+ # * 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):
1072
+ #
1073
+ # FileUtils.touch('src1.txt')
1074
+ # FileUtils.touch('dest1.txt')
1075
+ # FileUtils.ln_s('src1.txt', 'dest1.txt', force: true)
1076
+ # FileTest.symlink?('dest1.txt') # => true
1077
+ #
1078
+ # FileUtils.ln_s('src1.txt', 'dest1.txt') # Raises Errno::EEXIST.
1079
+ #
1080
+ # If `dest` is the path to a directory, creates a symbolic link at `dest/src`
1081
+ # pointing to `src`:
1082
+ #
1083
+ # FileUtils.touch('src2.txt')
1084
+ # FileUtils.mkdir('destdir2')
1085
+ # FileUtils.ln_s('src2.txt', 'destdir2')
1086
+ # File.symlink?('destdir2/src2.txt') # => true
1087
+ #
1088
+ # 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`:
1091
+ #
1092
+ # FileUtils.mkdir('srcdir3')
1093
+ # FileUtils.touch('srcdir3/src0.txt')
1094
+ # FileUtils.touch('srcdir3/src1.txt')
1095
+ # FileUtils.mkdir('destdir3')
1096
+ # FileUtils.ln_s(['srcdir3/src0.txt', 'srcdir3/src1.txt'], 'destdir3')
1097
+ # File.symlink?('destdir3/src0.txt') # => true
1098
+ # File.symlink?('destdir3/src1.txt') # => true
1099
+ #
1100
+ # Keyword arguments:
1101
+ #
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:
1106
+ #
1107
+ # FileUtils.ln_s('src0.txt', 'dest0.txt', noop: true, verbose: true)
1108
+ # FileUtils.ln_s('src1.txt', 'destdir1', noop: true, verbose: true)
1109
+ # FileUtils.ln_s('src2.txt', 'dest2.txt', force: true, noop: true, verbose: true)
1110
+ # FileUtils.ln_s(['srcdir3/src0.txt', 'srcdir3/src1.txt'], 'destdir3', noop: true, verbose: true)
1111
+ #
1112
+ # Output:
1113
+ #
1114
+ # ln -s src0.txt dest0.txt
1115
+ # ln -s src1.txt destdir1
1116
+ # ln -sf src2.txt dest2.txt
1117
+ # ln -s srcdir3/src0.txt srcdir3/src1.txt destdir3
1118
+ #
1119
+ # Related: FileUtils.ln_sf.
1120
+ #
1121
+ def self?.ln_s: (pathlist src, path dest, ?force: boolish, ?relative: boolish, ?target_directory: boolish, ?noop: boolish, ?verbose: boolish) -> void
1122
+
1123
+ # <!--
1124
+ # rdoc-file=lib/fileutils.rb
1125
+ # - symlink(src, dest, force: nil, relative: false, target_directory: true, noop: nil, verbose: nil)
1126
+ # -->
1127
+ #
1128
+ alias self.symlink self.ln_s
1129
+
1130
+ # <!--
1131
+ # rdoc-file=lib/fileutils.rb
1132
+ # - symlink(src, dest, force: nil, relative: false, target_directory: true, noop: nil, verbose: nil)
1133
+ # -->
1134
+ #
1135
+ alias symlink ln_s
1136
+
1137
+ # <!--
1138
+ # rdoc-file=lib/fileutils.rb
1139
+ # - ln_sf(src, dest, noop: nil, verbose: nil)
1140
+ # -->
1141
+ # Like FileUtils.ln_s, but always with keyword argument `force: true` given.
1142
+ #
1143
+ def self?.ln_sf: (pathlist src, path dest, ?noop: boolish, ?verbose: boolish) -> void
1144
+
1145
+ # <!--
1146
+ # rdoc-file=lib/fileutils.rb
1147
+ # - ln_sr(src, dest, target_directory: true, force: nil, noop: nil, verbose: nil)
1148
+ # -->
1149
+ # Like FileUtils.ln_s, but create links relative to `dest`.
1150
+ #
1151
+ def self?.ln_sr: (pathlist src, path dest, ?target_directory: boolish, ?noop: boolish, ?verbose: boolish) -> void
1152
+
1153
+ # <!--
1154
+ # rdoc-file=lib/fileutils.rb
1155
+ # - mkdir(list, mode: nil, noop: nil, verbose: nil)
1156
+ # -->
1157
+ # 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.
1159
+ #
1160
+ # Argument `list` or its elements should be [interpretable as
1161
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1162
+ #
1163
+ # 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):
1165
+ #
1166
+ # FileUtils.mkdir(%w[tmp0 tmp1]) # => ["tmp0", "tmp1"]
1167
+ # FileUtils.mkdir('tmp4') # => ["tmp4"]
1168
+ #
1169
+ # Keyword arguments:
1170
+ #
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:
1175
+ #
1176
+ # FileUtils.mkdir(%w[tmp0 tmp1], verbose: true)
1177
+ # FileUtils.mkdir(%w[tmp2 tmp3], mode: 0700, verbose: true)
1178
+ #
1179
+ # Output:
1180
+ #
1181
+ # mkdir tmp0 tmp1
1182
+ # mkdir -m 700 tmp2 tmp3
1183
+ #
1184
+ # Raises an exception if any path points to an existing file or directory, or if
1185
+ # for any reason a directory cannot be created.
1186
+ #
1187
+ # Related: FileUtils.mkdir_p.
1188
+ #
1189
+ def self?.mkdir: (pathlist list, ?mode: Integer?, ?noop: boolish, ?verbose: boolish) -> void
1190
+
1191
+ # <!--
1192
+ # rdoc-file=lib/fileutils.rb
1193
+ # - mkdir_p(list, mode: nil, noop: nil, verbose: nil)
1194
+ # -->
1195
+ # Creates directories at the paths in the given `list` (a single path or an
1196
+ # array of paths), also creating ancestor directories as needed; returns `list`
1197
+ # if it is an array, `[list]` otherwise.
1198
+ #
1199
+ # Argument `list` or its elements should be [interpretable as
1200
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1201
+ #
1202
+ # 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):
1205
+ #
1206
+ # FileUtils.mkdir_p(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
1207
+ # FileUtils.mkdir_p('tmp4/tmp5') # => ["tmp4/tmp5"]
1208
+ #
1209
+ # Keyword arguments:
1210
+ #
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:
1215
+ #
1216
+ # FileUtils.mkdir_p(%w[tmp0 tmp1], verbose: true)
1217
+ # FileUtils.mkdir_p(%w[tmp2 tmp3], mode: 0700, verbose: true)
1218
+ #
1219
+ # Output:
1220
+ #
1221
+ # mkdir -p tmp0 tmp1
1222
+ # mkdir -p -m 700 tmp2 tmp3
1223
+ #
1224
+ # Raises an exception if for any reason a directory cannot be created.
1225
+ #
1226
+ # FileUtils.mkpath and FileUtils.makedirs are aliases for FileUtils.mkdir_p.
1227
+ #
1228
+ # Related: FileUtils.mkdir.
1229
+ #
1230
+ def self?.mkdir_p: (pathlist list, ?mode: mode?, ?noop: boolish, ?verbose: boolish) -> void
1231
+
1232
+ # <!--
1233
+ # rdoc-file=lib/fileutils.rb
1234
+ # - makedirs(list, mode: nil, noop: nil, verbose: nil)
1235
+ # -->
1236
+ #
1237
+ alias self.makedirs self.mkdir_p
1238
+
1239
+ # <!--
1240
+ # rdoc-file=lib/fileutils.rb
1241
+ # - makedirs(list, mode: nil, noop: nil, verbose: nil)
1242
+ # -->
1243
+ #
1244
+ alias makedirs mkdir_p
1245
+
1246
+ # <!--
1247
+ # rdoc-file=lib/fileutils.rb
1248
+ # - mkpath(list, mode: nil, noop: nil, verbose: nil)
1249
+ # -->
1250
+ #
1251
+ alias self.mkpath self.mkdir_p
1252
+
1253
+ # <!--
1254
+ # rdoc-file=lib/fileutils.rb
1255
+ # - mkpath(list, mode: nil, noop: nil, verbose: nil)
1256
+ # -->
1257
+ #
1258
+ alias mkpath mkdir_p
1259
+
1260
+ # <!--
1261
+ # rdoc-file=lib/fileutils.rb
1262
+ # - mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
1263
+ # -->
1264
+ # Moves entries.
1265
+ #
1266
+ # Arguments `src` (a single path or an array of paths) and `dest` (a single
1267
+ # path) should be [interpretable as paths](rdoc-ref:FileUtils@Path+Arguments).
1268
+ #
1269
+ # If `src` and `dest` are on different file systems, first copies, then removes
1270
+ # `src`.
1271
+ #
1272
+ # May cause a local vulnerability if not called with keyword argument `secure:
1273
+ # true`; see [Avoiding the TOCTTOU
1274
+ # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1275
+ #
1276
+ # If `src` is the path to a single file or directory and `dest` does not exist,
1277
+ # moves `src` to `dest`:
1278
+ #
1279
+ # tree('src0')
1280
+ # # => src0
1281
+ # # |-- src0.txt
1282
+ # # `-- src1.txt
1283
+ # File.exist?('dest0') # => false
1284
+ # FileUtils.mv('src0', 'dest0')
1285
+ # File.exist?('src0') # => false
1286
+ # tree('dest0')
1287
+ # # => dest0
1288
+ # # |-- src0.txt
1289
+ # # `-- src1.txt
1290
+ #
1291
+ # If `src` is an array of paths to files and directories and `dest` is the path
1292
+ # to a directory, copies from each path in the array to `dest`:
1293
+ #
1294
+ # File.file?('src1.txt') # => true
1295
+ # tree('src1')
1296
+ # # => src1
1297
+ # # |-- src.dat
1298
+ # # `-- src.txt
1299
+ # Dir.empty?('dest1') # => true
1300
+ # FileUtils.mv(['src1.txt', 'src1'], 'dest1')
1301
+ # tree('dest1')
1302
+ # # => dest1
1303
+ # # |-- src1
1304
+ # # | |-- src.dat
1305
+ # # | `-- src.txt
1306
+ # # `-- src1.txt
1307
+ #
1308
+ # Keyword arguments:
1309
+ #
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
1315
+ # FileUtils.remove_entry_secure.
1316
+ # * `verbose: true` - prints an equivalent command:
1317
+ #
1318
+ # FileUtils.mv('src0', 'dest0', noop: true, verbose: true)
1319
+ # FileUtils.mv(['src1.txt', 'src1'], 'dest1', noop: true, verbose: true)
1320
+ #
1321
+ # Output:
1322
+ #
1323
+ # mv src0 dest0
1324
+ # mv src1.txt src1 dest1
1325
+ #
1326
+ def self?.mv: (pathlist src, path dest, ?force: boolish, ?noop: boolish, ?verbose: boolish, ?secure: boolish) -> void
1327
+
1328
+ # <!--
1329
+ # rdoc-file=lib/fileutils.rb
1330
+ # - move(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
1331
+ # -->
1332
+ #
1333
+ alias self.move self.mv
1334
+
1335
+ # <!--
1336
+ # rdoc-file=lib/fileutils.rb
1337
+ # - move(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
1338
+ # -->
1339
+ #
1340
+ alias move mv
1341
+
1342
+ # <!--
1343
+ # rdoc-file=lib/fileutils.rb
1344
+ # - options()
1345
+ # -->
1346
+ # Returns an array of the string keyword names:
1347
+ #
1348
+ # FileUtils.options.take(3) # => ["noop", "verbose", "force"]
1349
+ #
1350
+ def self.options: () -> Array[String]
1351
+
1352
+ # <!--
1353
+ # rdoc-file=lib/fileutils.rb
1354
+ # - options_of(mid)
1355
+ # -->
1356
+ # Returns an array of the string keyword name for method `mid`; the argument may
1357
+ # be a string or a symbol:
1358
+ #
1359
+ # FileUtils.options_of(:rm) # => ["force", "noop", "verbose"]
1360
+ # FileUtils.options_of('mv') # => ["force", "noop", "verbose", "secure"]
1361
+ #
1362
+ def self.options_of: (Symbol mid) -> Array[String]
1363
+
1364
+ # <!--
1365
+ # rdoc-file=lib/fileutils.rb
1366
+ # - pwd()
1367
+ # -->
1368
+ # Returns a string containing the path to the current directory:
1369
+ #
1370
+ # FileUtils.pwd # => "/rdoc/fileutils"
1371
+ #
1372
+ # Related: FileUtils.cd.
1373
+ #
1374
+ def self?.pwd: () -> String
1375
+
1376
+ # <!--
1377
+ # rdoc-file=lib/fileutils.rb
1378
+ # - getwd()
1379
+ # -->
1380
+ #
1381
+ alias self.getwd self.pwd
1382
+
1383
+ # <!--
1384
+ # rdoc-file=lib/fileutils.rb
1385
+ # - getwd()
1386
+ # -->
1387
+ #
1388
+ alias getwd pwd
1389
+
1390
+ # <!--
1391
+ # rdoc-file=lib/fileutils.rb
1392
+ # - remove_dir(path, force = false)
1393
+ # -->
1394
+ # Recursively removes the directory entry given by `path`, which should be the
1395
+ # entry for a regular file, a symbolic link, or a directory.
1396
+ #
1397
+ # Argument `path` should be [interpretable as a
1398
+ # path](rdoc-ref:FileUtils@Path+Arguments).
1399
+ #
1400
+ # Optional argument `force` specifies whether to ignore raised exceptions of
1401
+ # StandardError and its descendants.
1402
+ #
1403
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1404
+ #
1405
+ def self?.remove_dir: (path path, ?boolish force) -> void
1406
+
1407
+ # <!--
1408
+ # rdoc-file=lib/fileutils.rb
1409
+ # - remove_entry(path, force = false)
1410
+ # -->
1411
+ # Removes the entry given by `path`, which should be the entry for a regular
1412
+ # file, a symbolic link, or a directory.
1413
+ #
1414
+ # Argument `path` should be [interpretable as a
1415
+ # path](rdoc-ref:FileUtils@Path+Arguments).
1416
+ #
1417
+ # Optional argument `force` specifies whether to ignore raised exceptions of
1418
+ # StandardError and its descendants.
1419
+ #
1420
+ # Related: FileUtils.remove_entry_secure.
1421
+ #
1422
+ def self?.remove_entry: (path path, ?boolish force) -> void
1423
+
1424
+ # <!--
1425
+ # rdoc-file=lib/fileutils.rb
1426
+ # - remove_entry_secure(path, force = false)
1427
+ # -->
1428
+ # Securely removes the entry given by `path`, which should be the entry for a
1429
+ # regular file, a symbolic link, or a directory.
1430
+ #
1431
+ # Argument `path` should be [interpretable as a
1432
+ # path](rdoc-ref:FileUtils@Path+Arguments).
1433
+ #
1434
+ # Avoids a local vulnerability that can exist in certain circumstances; see
1435
+ # [Avoiding the TOCTTOU
1436
+ # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1437
+ #
1438
+ # Optional argument `force` specifies whether to ignore raised exceptions of
1439
+ # StandardError and its descendants.
1440
+ #
1441
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1442
+ #
1443
+ def self?.remove_entry_secure: (path path, ?boolish force) -> void
1444
+
1445
+ # <!--
1446
+ # rdoc-file=lib/fileutils.rb
1447
+ # - remove_file(path, force = false)
1448
+ # -->
1449
+ # Removes the file entry given by `path`, which should be the entry for a
1450
+ # regular file or a symbolic link.
1451
+ #
1452
+ # Argument `path` should be [interpretable as a
1453
+ # path](rdoc-ref:FileUtils@Path+Arguments).
1454
+ #
1455
+ # Optional argument `force` specifies whether to ignore raised exceptions of
1456
+ # StandardError and its descendants.
1457
+ #
1458
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1459
+ #
1460
+ def self?.remove_file: (path path, ?boolish force) -> void
1461
+
1462
+ # <!--
1463
+ # rdoc-file=lib/fileutils.rb
1464
+ # - rm(list, force: nil, noop: nil, verbose: nil)
1465
+ # -->
1466
+ # 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.
1468
+ #
1469
+ # Argument `list` or its elements should be [interpretable as
1470
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1471
+ #
1472
+ # With no keyword arguments, removes files at the paths given in `list`:
1473
+ #
1474
+ # FileUtils.touch(['src0.txt', 'src0.dat'])
1475
+ # FileUtils.rm(['src0.dat', 'src0.txt']) # => ["src0.dat", "src0.txt"]
1476
+ #
1477
+ # Keyword arguments:
1478
+ #
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:
1483
+ #
1484
+ # FileUtils.rm(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1485
+ #
1486
+ # Output:
1487
+ #
1488
+ # rm src0.dat src0.txt
1489
+ #
1490
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1491
+ #
1492
+ def self?.rm: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish) -> void
1493
+
1494
+ # <!--
1495
+ # rdoc-file=lib/fileutils.rb
1496
+ # - remove(list, force: nil, noop: nil, verbose: nil)
1497
+ # -->
1498
+ #
1499
+ alias self.remove self.rm
1500
+
1501
+ # <!--
1502
+ # rdoc-file=lib/fileutils.rb
1503
+ # - remove(list, force: nil, noop: nil, verbose: nil)
1504
+ # -->
1505
+ #
1506
+ alias remove rm
1507
+
1508
+ # <!--
1509
+ # rdoc-file=lib/fileutils.rb
1510
+ # - rm_f(list, noop: nil, verbose: nil)
1511
+ # -->
1512
+ # Equivalent to:
1513
+ #
1514
+ # FileUtils.rm(list, force: true, **kwargs)
1515
+ #
1516
+ # Argument `list` (a single path or an array of paths) should be [interpretable
1517
+ # as paths](rdoc-ref:FileUtils@Path+Arguments).
1518
+ #
1519
+ # See FileUtils.rm for keyword arguments.
1520
+ #
1521
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1522
+ #
1523
+ def self?.rm_f: (pathlist list, ?noop: boolish, ?verbose: boolish) -> void
1524
+
1525
+ # <!--
1526
+ # rdoc-file=lib/fileutils.rb
1527
+ # - safe_unlink(list, noop: nil, verbose: nil)
1528
+ # -->
1529
+ #
1530
+ alias self.safe_unlink self.rm_f
1531
+
1532
+ # <!--
1533
+ # rdoc-file=lib/fileutils.rb
1534
+ # - safe_unlink(list, noop: nil, verbose: nil)
1535
+ # -->
1536
+ #
1537
+ alias safe_unlink rm_f
1538
+
1539
+ # <!--
1540
+ # rdoc-file=lib/fileutils.rb
1541
+ # - rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
1542
+ # -->
1543
+ # 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.
1545
+ #
1546
+ # Argument `list` or its elements should be [interpretable as
1547
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1548
+ #
1549
+ # May cause a local vulnerability if not called with keyword argument `secure:
1550
+ # true`; see [Avoiding the TOCTTOU
1551
+ # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1552
+ #
1553
+ # For each file path, removes the file at that path:
1554
+ #
1555
+ # FileUtils.touch(['src0.txt', 'src0.dat'])
1556
+ # FileUtils.rm_r(['src0.dat', 'src0.txt'])
1557
+ # File.exist?('src0.txt') # => false
1558
+ # File.exist?('src0.dat') # => false
1559
+ #
1560
+ # For each directory path, recursively removes files and directories:
1561
+ #
1562
+ # tree('src1')
1563
+ # # => src1
1564
+ # # |-- dir0
1565
+ # # | |-- src0.txt
1566
+ # # | `-- src1.txt
1567
+ # # `-- dir1
1568
+ # # |-- src2.txt
1569
+ # # `-- src3.txt
1570
+ # FileUtils.rm_r('src1')
1571
+ # File.exist?('src1') # => false
1572
+ #
1573
+ # Keyword arguments:
1574
+ #
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
1579
+ # FileUtils.remove_entry_secure.
1580
+ # * `verbose: true` - prints an equivalent command:
1581
+ #
1582
+ # FileUtils.rm_r(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1583
+ # FileUtils.rm_r('src1', noop: true, verbose: true)
1584
+ #
1585
+ # Output:
1586
+ #
1587
+ # rm -r src0.dat src0.txt
1588
+ # rm -r src1
1589
+ #
1590
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1591
+ #
1592
+ def self?.rm_r: (pathlist list, ?force: boolish, ?noop: boolish, ?verbose: boolish, ?secure: boolish) -> void
1593
+
1594
+ # <!--
1595
+ # rdoc-file=lib/fileutils.rb
1596
+ # - rm_rf(list, noop: nil, verbose: nil, secure: nil)
1597
+ # -->
1598
+ # Equivalent to:
1599
+ #
1600
+ # FileUtils.rm_r(list, force: true, **kwargs)
1601
+ #
1602
+ # Argument `list` or its elements should be [interpretable as
1603
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1604
+ #
1605
+ # May cause a local vulnerability if not called with keyword argument `secure:
1606
+ # true`; see [Avoiding the TOCTTOU
1607
+ # Vulnerability](rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability).
1608
+ #
1609
+ # See FileUtils.rm_r for keyword arguments.
1610
+ #
1611
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1612
+ #
1613
+ def self?.rm_rf: (pathlist list, ?noop: boolish, ?verbose: boolish, ?secure: boolish) -> void
1614
+
1615
+ # <!--
1616
+ # rdoc-file=lib/fileutils.rb
1617
+ # - rmtree(list, noop: nil, verbose: nil, secure: nil)
1618
+ # -->
1619
+ #
1620
+ alias self.rmtree self.rm_rf
1621
+
1622
+ # <!--
1623
+ # rdoc-file=lib/fileutils.rb
1624
+ # - rmtree(list, noop: nil, verbose: nil, secure: nil)
1625
+ # -->
1626
+ #
1627
+ alias rmtree rm_rf
1628
+
1629
+ # <!--
1630
+ # rdoc-file=lib/fileutils.rb
1631
+ # - rmdir(list, parents: nil, noop: nil, verbose: nil)
1632
+ # -->
1633
+ # 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.
1635
+ #
1636
+ # Argument `list` or its elements should be [interpretable as
1637
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1638
+ #
1639
+ # 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):
1641
+ #
1642
+ # FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
1643
+ # FileUtils.rmdir('tmp4/tmp5') # => ["tmp4/tmp5"]
1644
+ #
1645
+ # Keyword arguments:
1646
+ #
1647
+ # * `parents: true` - removes successive ancestor directories if empty.
1648
+ # * `noop: true` - does not remove directories.
1649
+ # * `verbose: true` - prints an equivalent command:
1650
+ #
1651
+ # FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3], parents: true, verbose: true)
1652
+ # FileUtils.rmdir('tmp4/tmp5', parents: true, verbose: true)
1653
+ #
1654
+ # Output:
1655
+ #
1656
+ # rmdir -p tmp0/tmp1 tmp2/tmp3
1657
+ # rmdir -p tmp4/tmp5
1658
+ #
1659
+ # Raises an exception if a directory does not exist or if for any reason a
1660
+ # directory cannot be removed.
1661
+ #
1662
+ # Related: [methods for deleting](rdoc-ref:FileUtils@Deleting).
1663
+ #
1664
+ def self?.rmdir: (pathlist list, ?parents: boolish, ?noop: boolish, ?verbose: boolish) -> void
1665
+
1666
+ # <!--
1667
+ # rdoc-file=lib/fileutils.rb
1668
+ # - touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
1669
+ # -->
1670
+ # Updates modification times (mtime) and access times (atime) of the entries
1671
+ # given by the paths in `list` (a single path or an array of paths); returns
1672
+ # `list` if it is an array, `[list]` otherwise.
1673
+ #
1674
+ # By default, creates an empty file for any path to a non-existent entry; use
1675
+ # keyword argument `nocreate` to raise an exception instead.
1676
+ #
1677
+ # Argument `list` or its elements should be [interpretable as
1678
+ # paths](rdoc-ref:FileUtils@Path+Arguments).
1679
+ #
1680
+ # Examples:
1681
+ #
1682
+ # # Single path.
1683
+ # f = File.new('src0.txt') # Existing file.
1684
+ # f.atime # => 2022-06-10 11:11:21.200277 -0700
1685
+ # f.mtime # => 2022-06-10 11:11:21.200277 -0700
1686
+ # FileUtils.touch('src0.txt')
1687
+ # f = File.new('src0.txt')
1688
+ # f.atime # => 2022-06-11 08:28:09.8185343 -0700
1689
+ # f.mtime # => 2022-06-11 08:28:09.8185343 -0700
1690
+ #
1691
+ # # Array of paths.
1692
+ # FileUtils.touch(['src0.txt', 'src0.dat'])
1693
+ #
1694
+ # Keyword arguments:
1695
+ #
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:
1701
+ #
1702
+ # FileUtils.touch('src0.txt', noop: true, verbose: true)
1703
+ # FileUtils.touch(['src0.txt', 'src0.dat'], noop: true, verbose: true)
1704
+ # FileUtils.touch(path, noop: true, verbose: true)
1705
+ #
1706
+ # Output:
1707
+ #
1708
+ # touch src0.txt
1709
+ # touch src0.txt src0.dat
1710
+ # touch src0.txt
1711
+ #
1712
+ # Related: FileUtils.uptodate?.
1713
+ #
1714
+ def self?.touch: (pathlist list, ?noop: boolish, ?verbose: boolish, ?mtime: (Time | Numeric)?, ?nocreate: boolish) -> void
1715
+
1716
+ # <!--
1717
+ # rdoc-file=lib/fileutils.rb
1718
+ # - uptodate?(new, old_list)
1719
+ # -->
1720
+ # Returns `true` if the file at path `new` is newer than all the files at paths
1721
+ # in array `old_list`; `false` otherwise.
1722
+ #
1723
+ # Argument `new` and the elements of `old_list` should be [interpretable as
1724
+ # paths](rdoc-ref:FileUtils@Path+Arguments):
1725
+ #
1726
+ # FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
1727
+ # FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false
1728
+ #
1729
+ # A non-existent file is considered to be infinitely old.
1730
+ #
1731
+ # Related: FileUtils.touch.
1732
+ #
1733
+ def self?.uptodate?: (path new, _Each[path] old_list) -> bool
1734
+ end