rbs 4.1.0-java

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 (569) hide show
  1. checksums.yaml +7 -0
  2. data/.clang-format +75 -0
  3. data/.clangd +2 -0
  4. data/.dockerignore +37 -0
  5. data/.github/dependabot.yml +24 -0
  6. data/.github/workflows/bundle-update.yml +63 -0
  7. data/.github/workflows/c-check.yml +66 -0
  8. data/.github/workflows/comments.yml +37 -0
  9. data/.github/workflows/dependabot.yml +30 -0
  10. data/.github/workflows/jruby.yml +79 -0
  11. data/.github/workflows/milestone.yml +91 -0
  12. data/.github/workflows/ruby.yml +158 -0
  13. data/.github/workflows/rust.yml +186 -0
  14. data/.github/workflows/truffleruby.yml +54 -0
  15. data/.github/workflows/typecheck.yml +39 -0
  16. data/.github/workflows/wasm.yml +55 -0
  17. data/.github/workflows/windows.yml +49 -0
  18. data/.gitignore +39 -0
  19. data/.rubocop.yml +72 -0
  20. data/BSDL +22 -0
  21. data/CHANGELOG.md +2380 -0
  22. data/COPYING +56 -0
  23. data/Dockerfile.jruby +53 -0
  24. data/README.md +240 -0
  25. data/Rakefile +856 -0
  26. data/Steepfile +55 -0
  27. data/config.yml +913 -0
  28. data/core/array.rbs +4205 -0
  29. data/core/basic_object.rbs +376 -0
  30. data/core/binding.rbs +148 -0
  31. data/core/builtin.rbs +278 -0
  32. data/core/class.rbs +223 -0
  33. data/core/comparable.rbs +192 -0
  34. data/core/complex.rbs +812 -0
  35. data/core/constants.rbs +96 -0
  36. data/core/data.rbs +415 -0
  37. data/core/dir.rbs +993 -0
  38. data/core/encoding.rbs +1368 -0
  39. data/core/enumerable.rbs +2506 -0
  40. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  41. data/core/enumerator/product.rbs +92 -0
  42. data/core/enumerator.rbs +705 -0
  43. data/core/env.rbs +6 -0
  44. data/core/errno.rbs +682 -0
  45. data/core/errors.rbs +789 -0
  46. data/core/exception.rbs +485 -0
  47. data/core/false_class.rbs +82 -0
  48. data/core/fiber.rbs +570 -0
  49. data/core/fiber_error.rbs +11 -0
  50. data/core/file.rbs +2045 -0
  51. data/core/file_constants.rbs +463 -0
  52. data/core/file_stat.rbs +534 -0
  53. data/core/file_test.rbs +331 -0
  54. data/core/float.rbs +1292 -0
  55. data/core/gc.rbs +788 -0
  56. data/core/global_variables.rbs +184 -0
  57. data/core/hash.rbs +2183 -0
  58. data/core/integer.rbs +1374 -0
  59. data/core/io/buffer.rbs +995 -0
  60. data/core/io/wait.rbs +48 -0
  61. data/core/io.rbs +3472 -0
  62. data/core/kernel.rbs +3172 -0
  63. data/core/marshal.rbs +207 -0
  64. data/core/match_data.rbs +637 -0
  65. data/core/math.rbs +770 -0
  66. data/core/method.rbs +422 -0
  67. data/core/module.rbs +1856 -0
  68. data/core/nil_class.rbs +210 -0
  69. data/core/numeric.rbs +832 -0
  70. data/core/object.rbs +108 -0
  71. data/core/object_space/weak_key_map.rbs +166 -0
  72. data/core/object_space.rbs +197 -0
  73. data/core/pathname.rbs +1312 -0
  74. data/core/proc.rbs +905 -0
  75. data/core/process.rbs +2316 -0
  76. data/core/ractor.rbs +914 -0
  77. data/core/random.rbs +255 -0
  78. data/core/range.rbs +1209 -0
  79. data/core/rational.rbs +502 -0
  80. data/core/rb_config.rbs +88 -0
  81. data/core/rbs/ops.rbs +154 -0
  82. data/core/rbs/unnamed/argf.rbs +1236 -0
  83. data/core/rbs/unnamed/env_class.rbs +1214 -0
  84. data/core/rbs/unnamed/main_class.rbs +123 -0
  85. data/core/rbs/unnamed/random.rbs +186 -0
  86. data/core/refinement.rbs +59 -0
  87. data/core/regexp.rbs +1974 -0
  88. data/core/ruby.rbs +53 -0
  89. data/core/ruby_vm.rbs +809 -0
  90. data/core/rubygems/basic_specification.rbs +6 -0
  91. data/core/rubygems/config_file.rbs +38 -0
  92. data/core/rubygems/dependency_installer.rbs +6 -0
  93. data/core/rubygems/errors.rbs +112 -0
  94. data/core/rubygems/installer.rbs +15 -0
  95. data/core/rubygems/path_support.rbs +6 -0
  96. data/core/rubygems/platform.rbs +7 -0
  97. data/core/rubygems/request_set.rbs +49 -0
  98. data/core/rubygems/requirement.rbs +138 -0
  99. data/core/rubygems/rubygems.rbs +1108 -0
  100. data/core/rubygems/source_list.rbs +15 -0
  101. data/core/rubygems/specification.rbs +31 -0
  102. data/core/rubygems/stream_ui.rbs +5 -0
  103. data/core/rubygems/uninstaller.rbs +10 -0
  104. data/core/rubygems/version.rbs +133 -0
  105. data/core/set.rbs +751 -0
  106. data/core/signal.rbs +110 -0
  107. data/core/string.rbs +5532 -0
  108. data/core/struct.rbs +668 -0
  109. data/core/symbol.rbs +482 -0
  110. data/core/thread.rbs +1821 -0
  111. data/core/thread_group.rbs +79 -0
  112. data/core/time.rbs +1793 -0
  113. data/core/trace_point.rbs +483 -0
  114. data/core/true_class.rbs +98 -0
  115. data/core/unbound_method.rbs +337 -0
  116. data/core/warning.rbs +87 -0
  117. data/docs/CONTRIBUTING.md +107 -0
  118. data/docs/aliases.md +79 -0
  119. data/docs/architecture.md +110 -0
  120. data/docs/collection.md +192 -0
  121. data/docs/config.md +171 -0
  122. data/docs/data_and_struct.md +86 -0
  123. data/docs/encoding.md +56 -0
  124. data/docs/gem.md +56 -0
  125. data/docs/inline.md +634 -0
  126. data/docs/rbs_by_example.md +309 -0
  127. data/docs/release.md +69 -0
  128. data/docs/repo.md +125 -0
  129. data/docs/rust.md +96 -0
  130. data/docs/sigs.md +167 -0
  131. data/docs/stdlib.md +147 -0
  132. data/docs/syntax.md +940 -0
  133. data/docs/tools.md +17 -0
  134. data/docs/type_fingerprint.md +21 -0
  135. data/docs/wasm_serialization.md +80 -0
  136. data/exe/rbs +7 -0
  137. data/ext/rbs_extension/ast_translation.c +1855 -0
  138. data/ext/rbs_extension/ast_translation.h +41 -0
  139. data/ext/rbs_extension/class_constants.c +187 -0
  140. data/ext/rbs_extension/class_constants.h +104 -0
  141. data/ext/rbs_extension/compat.h +10 -0
  142. data/ext/rbs_extension/extconf.rb +40 -0
  143. data/ext/rbs_extension/legacy_location.c +299 -0
  144. data/ext/rbs_extension/legacy_location.h +82 -0
  145. data/ext/rbs_extension/main.c +613 -0
  146. data/ext/rbs_extension/rbs_extension.h +16 -0
  147. data/ext/rbs_extension/rbs_string_bridging.c +9 -0
  148. data/ext/rbs_extension/rbs_string_bridging.h +24 -0
  149. data/goodcheck.yml +91 -0
  150. data/include/rbs/ast.h +1047 -0
  151. data/include/rbs/defines.h +99 -0
  152. data/include/rbs/lexer.h +207 -0
  153. data/include/rbs/location.h +40 -0
  154. data/include/rbs/parser.h +153 -0
  155. data/include/rbs/serialize.h +39 -0
  156. data/include/rbs/string.h +47 -0
  157. data/include/rbs/util/rbs_allocator.h +59 -0
  158. data/include/rbs/util/rbs_assert.h +20 -0
  159. data/include/rbs/util/rbs_buffer.h +83 -0
  160. data/include/rbs/util/rbs_constant_pool.h +155 -0
  161. data/include/rbs/util/rbs_encoding.h +282 -0
  162. data/include/rbs/util/rbs_unescape.h +24 -0
  163. data/include/rbs.h +14 -0
  164. data/lib/rbs/ancestor_graph.rb +92 -0
  165. data/lib/rbs/annotate/annotations.rb +199 -0
  166. data/lib/rbs/annotate/formatter.rb +82 -0
  167. data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
  168. data/lib/rbs/annotate/rdoc_source.rb +131 -0
  169. data/lib/rbs/annotate.rb +8 -0
  170. data/lib/rbs/ast/annotation.rb +29 -0
  171. data/lib/rbs/ast/comment.rb +29 -0
  172. data/lib/rbs/ast/declarations.rb +472 -0
  173. data/lib/rbs/ast/directives.rb +49 -0
  174. data/lib/rbs/ast/members.rb +451 -0
  175. data/lib/rbs/ast/ruby/annotations.rb +451 -0
  176. data/lib/rbs/ast/ruby/comment_block.rb +247 -0
  177. data/lib/rbs/ast/ruby/declarations.rb +291 -0
  178. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
  179. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  180. data/lib/rbs/ast/ruby/members.rb +762 -0
  181. data/lib/rbs/ast/type_param.rb +235 -0
  182. data/lib/rbs/ast/visitor.rb +137 -0
  183. data/lib/rbs/buffer.rb +189 -0
  184. data/lib/rbs/builtin_names.rb +58 -0
  185. data/lib/rbs/cli/colored_io.rb +48 -0
  186. data/lib/rbs/cli/diff.rb +84 -0
  187. data/lib/rbs/cli/validate.rb +294 -0
  188. data/lib/rbs/cli.rb +1253 -0
  189. data/lib/rbs/collection/cleaner.rb +38 -0
  190. data/lib/rbs/collection/config/lockfile.rb +92 -0
  191. data/lib/rbs/collection/config/lockfile_generator.rb +269 -0
  192. data/lib/rbs/collection/config.rb +81 -0
  193. data/lib/rbs/collection/installer.rb +32 -0
  194. data/lib/rbs/collection/sources/base.rb +14 -0
  195. data/lib/rbs/collection/sources/git.rb +265 -0
  196. data/lib/rbs/collection/sources/local.rb +81 -0
  197. data/lib/rbs/collection/sources/rubygems.rb +48 -0
  198. data/lib/rbs/collection/sources/stdlib.rb +50 -0
  199. data/lib/rbs/collection/sources.rb +38 -0
  200. data/lib/rbs/collection.rb +16 -0
  201. data/lib/rbs/constant.rb +28 -0
  202. data/lib/rbs/definition.rb +415 -0
  203. data/lib/rbs/definition_builder/ancestor_builder.rb +678 -0
  204. data/lib/rbs/definition_builder/method_builder.rb +295 -0
  205. data/lib/rbs/definition_builder.rb +1054 -0
  206. data/lib/rbs/diff.rb +131 -0
  207. data/lib/rbs/environment/class_entry.rb +69 -0
  208. data/lib/rbs/environment/module_entry.rb +66 -0
  209. data/lib/rbs/environment/use_map.rb +77 -0
  210. data/lib/rbs/environment.rb +1028 -0
  211. data/lib/rbs/environment_loader.rb +167 -0
  212. data/lib/rbs/environment_walker.rb +155 -0
  213. data/lib/rbs/errors.rb +634 -0
  214. data/lib/rbs/factory.rb +18 -0
  215. data/lib/rbs/file_finder.rb +28 -0
  216. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  217. data/lib/rbs/inline_parser.rb +568 -0
  218. data/lib/rbs/location_aux.rb +170 -0
  219. data/lib/rbs/locator.rb +247 -0
  220. data/lib/rbs/method_type.rb +145 -0
  221. data/lib/rbs/namespace.rb +154 -0
  222. data/lib/rbs/parser/lex_result.rb +15 -0
  223. data/lib/rbs/parser/token.rb +23 -0
  224. data/lib/rbs/parser_aux.rb +144 -0
  225. data/lib/rbs/prototype/helpers.rb +197 -0
  226. data/lib/rbs/prototype/node_usage.rb +99 -0
  227. data/lib/rbs/prototype/rb.rb +816 -0
  228. data/lib/rbs/prototype/rbi.rb +793 -0
  229. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  230. data/lib/rbs/prototype/runtime/reflection.rb +19 -0
  231. data/lib/rbs/prototype/runtime/value_object_generator.rb +279 -0
  232. data/lib/rbs/prototype/runtime.rb +680 -0
  233. data/lib/rbs/repository.rb +127 -0
  234. data/lib/rbs/resolver/constant_resolver.rb +219 -0
  235. data/lib/rbs/resolver/type_name_resolver.rb +167 -0
  236. data/lib/rbs/rewriter.rb +70 -0
  237. data/lib/rbs/sorter.rb +198 -0
  238. data/lib/rbs/source.rb +99 -0
  239. data/lib/rbs/substitution.rb +83 -0
  240. data/lib/rbs/subtractor.rb +204 -0
  241. data/lib/rbs/test/errors.rb +80 -0
  242. data/lib/rbs/test/guaranteed.rb +30 -0
  243. data/lib/rbs/test/hook.rb +212 -0
  244. data/lib/rbs/test/observer.rb +19 -0
  245. data/lib/rbs/test/setup.rb +84 -0
  246. data/lib/rbs/test/setup_helper.rb +50 -0
  247. data/lib/rbs/test/tester.rb +167 -0
  248. data/lib/rbs/test/type_check.rb +457 -0
  249. data/lib/rbs/test.rb +112 -0
  250. data/lib/rbs/type_alias_dependency.rb +100 -0
  251. data/lib/rbs/type_alias_regularity.rb +126 -0
  252. data/lib/rbs/type_name.rb +122 -0
  253. data/lib/rbs/types.rb +1604 -0
  254. data/lib/rbs/unit_test/convertibles.rb +177 -0
  255. data/lib/rbs/unit_test/spy.rb +138 -0
  256. data/lib/rbs/unit_test/type_assertions.rb +383 -0
  257. data/lib/rbs/unit_test/with_aliases.rb +145 -0
  258. data/lib/rbs/unit_test.rb +6 -0
  259. data/lib/rbs/validator.rb +186 -0
  260. data/lib/rbs/variance_calculator.rb +189 -0
  261. data/lib/rbs/vendorer.rb +71 -0
  262. data/lib/rbs/version.rb +5 -0
  263. data/lib/rbs/wasm/deserializer.rb +213 -0
  264. data/lib/rbs/wasm/location.rb +61 -0
  265. data/lib/rbs/wasm/parser.rb +137 -0
  266. data/lib/rbs/wasm/rbs_parser.wasm +0 -0
  267. data/lib/rbs/wasm/runtime.rb +196 -0
  268. data/lib/rbs/wasm/serialization_schema.rb +110 -0
  269. data/lib/rbs/writer.rb +424 -0
  270. data/lib/rbs.rb +117 -0
  271. data/lib/rbs_jars.rb +39 -0
  272. data/lib/rdoc/discover.rb +20 -0
  273. data/lib/rdoc_plugin/parser.rb +168 -0
  274. data/rbs.gemspec +81 -0
  275. data/schema/annotation.json +14 -0
  276. data/schema/comment.json +26 -0
  277. data/schema/decls.json +326 -0
  278. data/schema/function.json +87 -0
  279. data/schema/location.json +56 -0
  280. data/schema/members.json +266 -0
  281. data/schema/methodType.json +50 -0
  282. data/schema/typeParam.json +52 -0
  283. data/schema/types.json +317 -0
  284. data/sig/ancestor_builder.rbs +163 -0
  285. data/sig/ancestor_graph.rbs +60 -0
  286. data/sig/annotate/annotations.rbs +102 -0
  287. data/sig/annotate/formatter.rbs +24 -0
  288. data/sig/annotate/rdoc_annotater.rbs +85 -0
  289. data/sig/annotate/rdoc_source.rbs +32 -0
  290. data/sig/annotation.rbs +27 -0
  291. data/sig/ast/ruby/annotations.rbs +470 -0
  292. data/sig/ast/ruby/comment_block.rbs +127 -0
  293. data/sig/ast/ruby/declarations.rbs +158 -0
  294. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  295. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  296. data/sig/ast/ruby/members.rbs +198 -0
  297. data/sig/buffer.rbs +108 -0
  298. data/sig/builtin_names.rbs +44 -0
  299. data/sig/cli/colored_io.rbs +15 -0
  300. data/sig/cli/diff.rbs +15 -0
  301. data/sig/cli/validate.rbs +47 -0
  302. data/sig/cli.rbs +89 -0
  303. data/sig/collection/cleaner.rbs +13 -0
  304. data/sig/collection/config/lockfile.rbs +74 -0
  305. data/sig/collection/config/lockfile_generator.rbs +68 -0
  306. data/sig/collection/config.rbs +46 -0
  307. data/sig/collection/installer.rbs +17 -0
  308. data/sig/collection/sources.rbs +214 -0
  309. data/sig/collection.rbs +4 -0
  310. data/sig/comment.rbs +26 -0
  311. data/sig/constant.rbs +21 -0
  312. data/sig/declarations.rbs +274 -0
  313. data/sig/definition.rbs +232 -0
  314. data/sig/definition_builder.rbs +181 -0
  315. data/sig/diff.rbs +28 -0
  316. data/sig/directives.rbs +77 -0
  317. data/sig/environment/class_entry.rbs +50 -0
  318. data/sig/environment/module_entry.rbs +50 -0
  319. data/sig/environment.rbs +286 -0
  320. data/sig/environment_loader.rbs +111 -0
  321. data/sig/environment_walker.rbs +65 -0
  322. data/sig/errors.rbs +408 -0
  323. data/sig/factory.rbs +5 -0
  324. data/sig/file_finder.rbs +28 -0
  325. data/sig/inline_parser/comment_association.rbs +71 -0
  326. data/sig/inline_parser.rbs +126 -0
  327. data/sig/location.rbs +135 -0
  328. data/sig/locator.rbs +56 -0
  329. data/sig/manifest.yaml +5 -0
  330. data/sig/members.rbs +258 -0
  331. data/sig/method_builder.rbs +89 -0
  332. data/sig/method_types.rbs +58 -0
  333. data/sig/namespace.rbs +161 -0
  334. data/sig/parser.rbs +164 -0
  335. data/sig/prototype/helpers.rbs +29 -0
  336. data/sig/prototype/node_usage.rbs +20 -0
  337. data/sig/prototype/rb.rbs +96 -0
  338. data/sig/prototype/rbi.rbs +104 -0
  339. data/sig/prototype/runtime.rbs +182 -0
  340. data/sig/rbs.rbs +21 -0
  341. data/sig/rdoc/rbs.rbs +67 -0
  342. data/sig/repository.rbs +85 -0
  343. data/sig/resolver/constant_resolver.rbs +92 -0
  344. data/sig/resolver/context.rbs +34 -0
  345. data/sig/resolver/type_name_resolver.rbs +61 -0
  346. data/sig/rewriter.rbs +45 -0
  347. data/sig/shims/bundler.rbs +38 -0
  348. data/sig/shims/enumerable.rbs +5 -0
  349. data/sig/shims/rubygems.rbs +19 -0
  350. data/sig/sorter.rbs +41 -0
  351. data/sig/source.rbs +48 -0
  352. data/sig/substitution.rbs +48 -0
  353. data/sig/subtractor.rbs +37 -0
  354. data/sig/test/errors.rbs +52 -0
  355. data/sig/test/guranteed.rbs +9 -0
  356. data/sig/test/type_check.rbs +19 -0
  357. data/sig/test.rbs +82 -0
  358. data/sig/type_alias_dependency.rbs +53 -0
  359. data/sig/type_alias_regularity.rbs +98 -0
  360. data/sig/type_param.rbs +115 -0
  361. data/sig/typename.rbs +89 -0
  362. data/sig/types.rbs +578 -0
  363. data/sig/unit_test/convertibles.rbs +154 -0
  364. data/sig/unit_test/spy.rbs +22 -0
  365. data/sig/unit_test/type_assertions.rbs +211 -0
  366. data/sig/unit_test/with_aliases.rbs +136 -0
  367. data/sig/use_map.rbs +35 -0
  368. data/sig/util.rbs +9 -0
  369. data/sig/validator.rbs +63 -0
  370. data/sig/variance_calculator.rbs +87 -0
  371. data/sig/vendorer.rbs +51 -0
  372. data/sig/version.rbs +3 -0
  373. data/sig/visitor.rbs +47 -0
  374. data/sig/wasm/deserializer.rbs +66 -0
  375. data/sig/wasm/serialization_schema.rbs +13 -0
  376. data/sig/writer.rbs +127 -0
  377. data/src/ast.c +1628 -0
  378. data/src/lexer.c +3221 -0
  379. data/src/lexer.re +155 -0
  380. data/src/lexstate.c +221 -0
  381. data/src/location.c +31 -0
  382. data/src/parser.c +4255 -0
  383. data/src/serialize.c +958 -0
  384. data/src/string.c +41 -0
  385. data/src/util/rbs_allocator.c +171 -0
  386. data/src/util/rbs_assert.c +19 -0
  387. data/src/util/rbs_buffer.c +54 -0
  388. data/src/util/rbs_constant_pool.c +268 -0
  389. data/src/util/rbs_encoding.c +21308 -0
  390. data/src/util/rbs_unescape.c +167 -0
  391. data/stdlib/abbrev/0/abbrev.rbs +66 -0
  392. data/stdlib/abbrev/0/array.rbs +26 -0
  393. data/stdlib/base64/0/base64.rbs +355 -0
  394. data/stdlib/benchmark/0/benchmark.rbs +452 -0
  395. data/stdlib/bigdecimal/0/big_decimal.rbs +1647 -0
  396. data/stdlib/bigdecimal-math/0/big_math.rbs +280 -0
  397. data/stdlib/bigdecimal-math/0/manifest.yaml +2 -0
  398. data/stdlib/cgi/0/core.rbs +911 -0
  399. data/stdlib/cgi/0/manifest.yaml +4 -0
  400. data/stdlib/cgi-escape/0/escape.rbs +171 -0
  401. data/stdlib/coverage/0/coverage.rbs +266 -0
  402. data/stdlib/csv/0/csv.rbs +3776 -0
  403. data/stdlib/csv/0/manifest.yaml +3 -0
  404. data/stdlib/date/0/date.rbs +1598 -0
  405. data/stdlib/date/0/date_time.rbs +617 -0
  406. data/stdlib/date/0/time.rbs +26 -0
  407. data/stdlib/dbm/0/dbm.rbs +421 -0
  408. data/stdlib/delegate/0/delegator.rbs +188 -0
  409. data/stdlib/delegate/0/kernel.rbs +47 -0
  410. data/stdlib/delegate/0/simple_delegator.rbs +96 -0
  411. data/stdlib/did_you_mean/0/did_you_mean.rbs +344 -0
  412. data/stdlib/digest/0/digest.rbs +693 -0
  413. data/stdlib/erb/0/erb.rbs +933 -0
  414. data/stdlib/etc/0/etc.rbs +884 -0
  415. data/stdlib/fileutils/0/fileutils.rbs +1753 -0
  416. data/stdlib/find/0/find.rbs +49 -0
  417. data/stdlib/forwardable/0/forwardable.rbs +271 -0
  418. data/stdlib/io-console/0/io-console.rbs +414 -0
  419. data/stdlib/ipaddr/0/ipaddr.rbs +431 -0
  420. data/stdlib/json/0/json.rbs +1963 -0
  421. data/stdlib/kconv/0/kconv.rbs +166 -0
  422. data/stdlib/logger/0/formatter.rbs +45 -0
  423. data/stdlib/logger/0/log_device.rbs +100 -0
  424. data/stdlib/logger/0/logger.rbs +796 -0
  425. data/stdlib/logger/0/manifest.yaml +2 -0
  426. data/stdlib/logger/0/period.rbs +17 -0
  427. data/stdlib/logger/0/severity.rbs +34 -0
  428. data/stdlib/minitest/0/kernel.rbs +42 -0
  429. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +52 -0
  430. data/stdlib/minitest/0/minitest/assertion.rbs +17 -0
  431. data/stdlib/minitest/0/minitest/assertions.rbs +590 -0
  432. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +23 -0
  433. data/stdlib/minitest/0/minitest/bench_spec.rbs +102 -0
  434. data/stdlib/minitest/0/minitest/benchmark.rbs +259 -0
  435. data/stdlib/minitest/0/minitest/composite_reporter.rbs +25 -0
  436. data/stdlib/minitest/0/minitest/compress.rbs +13 -0
  437. data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
  438. data/stdlib/minitest/0/minitest/expectation.rbs +2 -0
  439. data/stdlib/minitest/0/minitest/expectations.rbs +21 -0
  440. data/stdlib/minitest/0/minitest/guard.rbs +64 -0
  441. data/stdlib/minitest/0/minitest/mock.rbs +64 -0
  442. data/stdlib/minitest/0/minitest/parallel/executor.rbs +46 -0
  443. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +5 -0
  444. data/stdlib/minitest/0/minitest/parallel/test.rbs +3 -0
  445. data/stdlib/minitest/0/minitest/parallel.rbs +2 -0
  446. data/stdlib/minitest/0/minitest/pride_io.rbs +62 -0
  447. data/stdlib/minitest/0/minitest/pride_lol.rbs +19 -0
  448. data/stdlib/minitest/0/minitest/progress_reporter.rbs +11 -0
  449. data/stdlib/minitest/0/minitest/reportable.rbs +53 -0
  450. data/stdlib/minitest/0/minitest/reporter.rbs +5 -0
  451. data/stdlib/minitest/0/minitest/result.rbs +28 -0
  452. data/stdlib/minitest/0/minitest/runnable.rbs +163 -0
  453. data/stdlib/minitest/0/minitest/skip.rbs +6 -0
  454. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +48 -0
  455. data/stdlib/minitest/0/minitest/spec/dsl.rbs +129 -0
  456. data/stdlib/minitest/0/minitest/spec.rbs +11 -0
  457. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +81 -0
  458. data/stdlib/minitest/0/minitest/summary_reporter.rbs +18 -0
  459. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +92 -0
  460. data/stdlib/minitest/0/minitest/test.rbs +69 -0
  461. data/stdlib/minitest/0/minitest/unexpected_error.rbs +12 -0
  462. data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
  463. data/stdlib/minitest/0/minitest/unit/test_case.rbs +3 -0
  464. data/stdlib/minitest/0/minitest/unit.rbs +4 -0
  465. data/stdlib/minitest/0/minitest.rbs +115 -0
  466. data/stdlib/monitor/0/monitor.rbs +363 -0
  467. data/stdlib/mutex_m/0/mutex_m.rbs +104 -0
  468. data/stdlib/net-http/0/manifest.yaml +3 -0
  469. data/stdlib/net-http/0/net-http.rbs +5580 -0
  470. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  471. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  472. data/stdlib/net-smtp/0/manifest.yaml +2 -0
  473. data/stdlib/net-smtp/0/net-smtp.rbs +55 -0
  474. data/stdlib/nkf/0/nkf.rbs +402 -0
  475. data/stdlib/objspace/0/objspace.rbs +470 -0
  476. data/stdlib/observable/0/observable.rbs +217 -0
  477. data/stdlib/open-uri/0/manifest.yaml +4 -0
  478. data/stdlib/open-uri/0/open-uri.rbs +433 -0
  479. data/stdlib/open3/0/open3.rbs +606 -0
  480. data/stdlib/openssl/0/manifest.yaml +3 -0
  481. data/stdlib/openssl/0/openssl.rbs +12237 -0
  482. data/stdlib/optparse/0/optparse.rbs +1734 -0
  483. data/stdlib/pathname/0/pathname.rbs +36 -0
  484. data/stdlib/pp/0/manifest.yaml +2 -0
  485. data/stdlib/pp/0/pp.rbs +301 -0
  486. data/stdlib/prettyprint/0/prettyprint.rbs +383 -0
  487. data/stdlib/pstore/0/pstore.rbs +608 -0
  488. data/stdlib/psych/0/core_ext.rbs +12 -0
  489. data/stdlib/psych/0/dbm.rbs +237 -0
  490. data/stdlib/psych/0/manifest.yaml +3 -0
  491. data/stdlib/psych/0/psych.rbs +455 -0
  492. data/stdlib/psych/0/store.rbs +57 -0
  493. data/stdlib/pty/0/pty.rbs +240 -0
  494. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  495. data/stdlib/rdoc/0/code_object.rbs +52 -0
  496. data/stdlib/rdoc/0/comment.rbs +61 -0
  497. data/stdlib/rdoc/0/context.rbs +153 -0
  498. data/stdlib/rdoc/0/markup.rbs +117 -0
  499. data/stdlib/rdoc/0/options.rbs +76 -0
  500. data/stdlib/rdoc/0/parser.rbs +56 -0
  501. data/stdlib/rdoc/0/rdoc.rbs +393 -0
  502. data/stdlib/rdoc/0/ri.rbs +17 -0
  503. data/stdlib/rdoc/0/store.rbs +48 -0
  504. data/stdlib/rdoc/0/top_level.rbs +97 -0
  505. data/stdlib/resolv/0/manifest.yaml +3 -0
  506. data/stdlib/resolv/0/resolv.rbs +1787 -0
  507. data/stdlib/ripper/0/ripper.rbs +1654 -0
  508. data/stdlib/securerandom/0/manifest.yaml +2 -0
  509. data/stdlib/securerandom/0/securerandom.rbs +49 -0
  510. data/stdlib/shellwords/0/shellwords.rbs +229 -0
  511. data/stdlib/singleton/0/singleton.rbs +134 -0
  512. data/stdlib/socket/0/addrinfo.rbs +666 -0
  513. data/stdlib/socket/0/basic_socket.rbs +590 -0
  514. data/stdlib/socket/0/constants.rbs +2295 -0
  515. data/stdlib/socket/0/ip_socket.rbs +94 -0
  516. data/stdlib/socket/0/socket.rbs +4170 -0
  517. data/stdlib/socket/0/socket_error.rbs +5 -0
  518. data/stdlib/socket/0/tcp_server.rbs +192 -0
  519. data/stdlib/socket/0/tcp_socket.rbs +87 -0
  520. data/stdlib/socket/0/udp_socket.rbs +133 -0
  521. data/stdlib/socket/0/unix_server.rbs +169 -0
  522. data/stdlib/socket/0/unix_socket.rbs +172 -0
  523. data/stdlib/stringio/0/stringio.rbs +1681 -0
  524. data/stdlib/strscan/0/string_scanner.rbs +1648 -0
  525. data/stdlib/tempfile/0/manifest.yaml +3 -0
  526. data/stdlib/tempfile/0/tempfile.rbs +483 -0
  527. data/stdlib/time/0/time.rbs +434 -0
  528. data/stdlib/timeout/0/timeout.rbs +132 -0
  529. data/stdlib/tmpdir/0/tmpdir.rbs +69 -0
  530. data/stdlib/tsort/0/cyclic.rbs +8 -0
  531. data/stdlib/tsort/0/interfaces.rbs +20 -0
  532. data/stdlib/tsort/0/tsort.rbs +410 -0
  533. data/stdlib/uri/0/common.rbs +621 -0
  534. data/stdlib/uri/0/file.rbs +118 -0
  535. data/stdlib/uri/0/ftp.rbs +13 -0
  536. data/stdlib/uri/0/generic.rbs +1111 -0
  537. data/stdlib/uri/0/http.rbs +104 -0
  538. data/stdlib/uri/0/https.rbs +14 -0
  539. data/stdlib/uri/0/ldap.rbs +230 -0
  540. data/stdlib/uri/0/ldaps.rbs +14 -0
  541. data/stdlib/uri/0/mailto.rbs +92 -0
  542. data/stdlib/uri/0/rfc2396_parser.rbs +189 -0
  543. data/stdlib/uri/0/rfc3986_parser.rbs +2 -0
  544. data/stdlib/uri/0/ws.rbs +13 -0
  545. data/stdlib/uri/0/wss.rbs +9 -0
  546. data/stdlib/yaml/0/manifest.yaml +2 -0
  547. data/stdlib/yaml/0/yaml.rbs +1 -0
  548. data/stdlib/zlib/0/buf_error.rbs +10 -0
  549. data/stdlib/zlib/0/data_error.rbs +10 -0
  550. data/stdlib/zlib/0/deflate.rbs +211 -0
  551. data/stdlib/zlib/0/error.rbs +20 -0
  552. data/stdlib/zlib/0/gzip_file/crc_error.rbs +12 -0
  553. data/stdlib/zlib/0/gzip_file/error.rbs +23 -0
  554. data/stdlib/zlib/0/gzip_file/length_error.rbs +12 -0
  555. data/stdlib/zlib/0/gzip_file/no_footer.rbs +11 -0
  556. data/stdlib/zlib/0/gzip_file.rbs +156 -0
  557. data/stdlib/zlib/0/gzip_reader.rbs +293 -0
  558. data/stdlib/zlib/0/gzip_writer.rbs +168 -0
  559. data/stdlib/zlib/0/inflate.rbs +180 -0
  560. data/stdlib/zlib/0/mem_error.rbs +10 -0
  561. data/stdlib/zlib/0/need_dict.rbs +13 -0
  562. data/stdlib/zlib/0/stream_end.rbs +11 -0
  563. data/stdlib/zlib/0/stream_error.rbs +11 -0
  564. data/stdlib/zlib/0/version_error.rbs +11 -0
  565. data/stdlib/zlib/0/zlib.rbs +449 -0
  566. data/stdlib/zlib/0/zstream.rbs +200 -0
  567. data/wasm/README.md +60 -0
  568. data/wasm/rbs_wasm.c +423 -0
  569. metadata +671 -0
data/core/pathname.rbs ADDED
@@ -0,0 +1,1312 @@
1
+ # <!-- rdoc-file=lib/pathname.rb -->
2
+ # # pathname.rb
3
+ #
4
+ # Object-Oriented Pathname Class
5
+ #
6
+ # Author
7
+ # : Tanaka Akira <akr@m17n.org>
8
+ #
9
+ # Documentation
10
+ # : Author and Gavin Sinclair
11
+ #
12
+ #
13
+ # For documentation, see class Pathname.
14
+ #
15
+ # <!-- rdoc-file=pathname_builtin.rb -->
16
+ # Pathname represents the name of a file or directory on the filesystem, but not
17
+ # the file itself.
18
+ #
19
+ # The pathname depends on the Operating System: Unix, Windows, etc. This library
20
+ # works with pathnames of local OS, however non-Unix pathnames are supported
21
+ # experimentally.
22
+ #
23
+ # A Pathname can be relative or absolute. It's not until you try to reference
24
+ # the file that it even matters whether the file exists or not.
25
+ #
26
+ # Pathname is immutable. It has no method for destructive update.
27
+ #
28
+ # The goal of this class is to manipulate file path information in a neater way
29
+ # than standard Ruby provides. The examples below demonstrate the difference.
30
+ #
31
+ # **All** functionality from File, FileTest, and some from Dir and FileUtils is
32
+ # included, in an unsurprising way. It is essentially a facade for all of
33
+ # these, and more.
34
+ #
35
+ # ## Examples
36
+ #
37
+ # ### Example 1: Using Pathname
38
+ #
39
+ # require 'pathname'
40
+ # pn = Pathname.new("/usr/bin/ruby")
41
+ # size = pn.size # 27662
42
+ # isdir = pn.directory? # false
43
+ # dir = pn.dirname # Pathname:/usr/bin
44
+ # base = pn.basename # Pathname:ruby
45
+ # dir, base = pn.split # [Pathname:/usr/bin, Pathname:ruby]
46
+ # data = pn.read
47
+ # pn.open { |f| _ }
48
+ # pn.each_line { |line| _ }
49
+ #
50
+ # ### Example 2: Using standard Ruby
51
+ #
52
+ # pn = "/usr/bin/ruby"
53
+ # size = File.size(pn) # 27662
54
+ # isdir = File.directory?(pn) # false
55
+ # dir = File.dirname(pn) # "/usr/bin"
56
+ # base = File.basename(pn) # "ruby"
57
+ # dir, base = File.split(pn) # ["/usr/bin", "ruby"]
58
+ # data = File.read(pn)
59
+ # File.open(pn) { |f| _ }
60
+ # File.foreach(pn) { |line| _ }
61
+ #
62
+ # ### Example 3: Special features
63
+ #
64
+ # p1 = Pathname.new("/usr/lib") # Pathname:/usr/lib
65
+ # p2 = p1 + "ruby/1.8" # Pathname:/usr/lib/ruby/1.8
66
+ # p3 = p1.parent # Pathname:/usr
67
+ # p4 = p2.relative_path_from(p3) # Pathname:lib/ruby/1.8
68
+ # pwd = Pathname.pwd # Pathname:/home/gavin
69
+ # pwd.absolute? # true
70
+ # p5 = Pathname.new "." # Pathname:.
71
+ # p5 = p5 + "music/../articles" # Pathname:music/../articles
72
+ # p5.cleanpath # Pathname:articles
73
+ # p5.realpath # Pathname:/home/gavin/articles
74
+ # p5.children # [Pathname:/home/gavin/articles/linux, ...]
75
+ #
76
+ # ## Breakdown of functionality
77
+ #
78
+ # ### Core methods
79
+ #
80
+ # These methods are effectively manipulating a String, because that's all a path
81
+ # is. None of these access the file system except for #mountpoint?, #children,
82
+ # #each_child, #realdirpath and #realpath.
83
+ #
84
+ # * +
85
+ # * #join
86
+ # * #parent
87
+ # * #root?
88
+ # * #absolute?
89
+ # * #relative?
90
+ # * #relative_path_from
91
+ # * #each_filename
92
+ # * #cleanpath
93
+ # * #realpath
94
+ # * #realdirpath
95
+ # * #children
96
+ # * #each_child
97
+ # * #mountpoint?
98
+ #
99
+ # ### File status predicate methods
100
+ #
101
+ # These methods are a facade for FileTest:
102
+ # * #blockdev?
103
+ # * #chardev?
104
+ # * #directory?
105
+ # * #executable?
106
+ # * #executable_real?
107
+ # * #exist?
108
+ # * #file?
109
+ # * #grpowned?
110
+ # * #owned?
111
+ # * #pipe?
112
+ # * #readable?
113
+ # * #world_readable?
114
+ # * #readable_real?
115
+ # * #setgid?
116
+ # * #setuid?
117
+ # * #size
118
+ # * #size?
119
+ # * #socket?
120
+ # * #sticky?
121
+ # * #symlink?
122
+ # * #writable?
123
+ # * #world_writable?
124
+ # * #writable_real?
125
+ # * #zero?
126
+ #
127
+ # ### File property and manipulation methods
128
+ #
129
+ # These methods are a facade for File:
130
+ # * #each_line(*args, &block)
131
+ # * #read(*args)
132
+ # * #binread(*args)
133
+ # * #readlines(*args)
134
+ # * #sysopen(*args)
135
+ # * #write(*args)
136
+ # * #binwrite(*args)
137
+ # * #atime
138
+ # * #birthtime
139
+ # * #ctime
140
+ # * #mtime
141
+ # * #chmod(mode)
142
+ # * #lchmod(mode)
143
+ # * #chown(owner, group)
144
+ # * #lchown(owner, group)
145
+ # * #fnmatch(pattern, *args)
146
+ # * #fnmatch?(pattern, *args)
147
+ # * #ftype
148
+ # * #make_link(old)
149
+ # * #open(*args, &block)
150
+ # * #readlink
151
+ # * #rename(to)
152
+ # * #stat
153
+ # * #lstat
154
+ # * #make_symlink(old)
155
+ # * #truncate(length)
156
+ # * #utime(atime, mtime)
157
+ # * #lutime(atime, mtime)
158
+ # * #basename(*args)
159
+ # * #dirname
160
+ # * #extname
161
+ # * #expand_path(*args)
162
+ # * #split
163
+ #
164
+ # ### Directory methods
165
+ #
166
+ # These methods are a facade for Dir:
167
+ # * Pathname.glob(*args)
168
+ # * Pathname.getwd / Pathname.pwd
169
+ # * #rmdir
170
+ # * #entries
171
+ # * #each_entry(&block)
172
+ # * #mkdir(*args)
173
+ # * #opendir(*args)
174
+ #
175
+ # ### Utilities
176
+ #
177
+ # These methods are a mixture of Find, FileUtils, and others:
178
+ # * #find(&block)
179
+ # * #mkpath
180
+ # * #rmtree
181
+ # * #unlink / #delete
182
+ #
183
+ # ## Method documentation
184
+ #
185
+ # As the above section shows, most of the methods in Pathname are facades. The
186
+ # documentation for these methods generally just says, for instance, "See
187
+ # FileTest.writable?", as you should be familiar with the original method
188
+ # anyway, and its documentation (e.g. through `ri`) will contain more
189
+ # information. In some cases, a brief description will follow.
190
+ #
191
+ class Pathname
192
+ # <!--
193
+ # rdoc-file=pathname_builtin.rb
194
+ # - getwd()
195
+ # -->
196
+ # See <code>Dir.getwd</code>. Returns the current working directory as a
197
+ # Pathname.
198
+ #
199
+ def self.getwd: () -> Pathname
200
+
201
+ # <!--
202
+ # rdoc-file=pathname_builtin.rb
203
+ # - glob(*args, **kwargs) { |pathname| ... }
204
+ # -->
205
+ # See <code>Dir.glob</code>. Returns or yields Pathname objects.
206
+ #
207
+ def self.glob: (String | Array[String] pattern, ?Integer flags) -> Array[Pathname]
208
+ | (String | Array[String] pattern, ?Integer flags) { (Pathname) -> untyped } -> nil
209
+
210
+ # <!--
211
+ # rdoc-file=pathname_builtin.rb
212
+ # - pwd()
213
+ # -->
214
+ #
215
+ def self.pwd: () -> Pathname
216
+
217
+ # <!--
218
+ # rdoc-file=pathname_builtin.rb
219
+ # - +(other)
220
+ # -->
221
+ # Appends a pathname fragment to `self` to produce a new Pathname object. Since
222
+ # `other` is considered as a path relative to `self`, if `other` is an absolute
223
+ # path, the new Pathname object is created from just `other`.
224
+ #
225
+ # p1 = Pathname.new("/usr") # Pathname:/usr
226
+ # p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby
227
+ # p3 = p1 + "/etc/passwd" # Pathname:/etc/passwd
228
+ #
229
+ # # / is aliased to +.
230
+ # p4 = p1 / "bin/ruby" # Pathname:/usr/bin/ruby
231
+ # p5 = p1 / "/etc/passwd" # Pathname:/etc/passwd
232
+ #
233
+ # This method doesn't access the file system; it is pure string manipulation.
234
+ #
235
+ def +: (Pathname | String | _ToStr other) -> Pathname
236
+
237
+ alias / +
238
+
239
+ # <!--
240
+ # rdoc-file=pathname.c
241
+ # - <=>(p1)
242
+ # -->
243
+ # Provides a case-sensitive comparison operator for pathnames.
244
+ #
245
+ # Pathname.new('/usr') <=> Pathname.new('/usr/bin')
246
+ # #=> -1
247
+ # Pathname.new('/usr/bin') <=> Pathname.new('/usr/bin')
248
+ # #=> 0
249
+ # Pathname.new('/usr/bin') <=> Pathname.new('/USR/BIN')
250
+ # #=> 1
251
+ #
252
+ # It will return <code>-1</code>, `0` or `1` depending on the value of the left
253
+ # argument relative to the right argument. Or it will return `nil` if the
254
+ # arguments are not comparable.
255
+ #
256
+ def <=>: (Pathname other) -> Integer
257
+ | (untyped other) -> nil
258
+
259
+ # <!--
260
+ # rdoc-file=pathname_builtin.rb
261
+ # - ==(other)
262
+ # -->
263
+ # Compare this pathname with `other`. The comparison is string-based. Be aware
264
+ # that two different paths (<code>foo.txt</code> and <code>./foo.txt</code>) can
265
+ # refer to the same file.
266
+ #
267
+ def ==: (untyped) -> bool
268
+
269
+ def ===: (untyped) -> bool
270
+
271
+ # <!--
272
+ # rdoc-file=pathname_builtin.rb
273
+ # - absolute?()
274
+ # -->
275
+ # Predicate method for testing whether a path is absolute.
276
+ #
277
+ # It returns `true` if the pathname begins with a slash.
278
+ #
279
+ # p = Pathname.new('/im/sure')
280
+ # p.absolute?
281
+ # #=> true
282
+ #
283
+ # p = Pathname.new('not/so/sure')
284
+ # p.absolute?
285
+ # #=> false
286
+ #
287
+ def absolute?: () -> bool
288
+
289
+ # <!--
290
+ # rdoc-file=pathname_builtin.rb
291
+ # - ascend() { |self| ... }
292
+ # -->
293
+ # Iterates over and yields a new Pathname object for each element in the given
294
+ # path in ascending order.
295
+ #
296
+ # Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
297
+ # #<Pathname:/path/to/some/file.rb>
298
+ # #<Pathname:/path/to/some>
299
+ # #<Pathname:/path/to>
300
+ # #<Pathname:/path>
301
+ # #<Pathname:/>
302
+ #
303
+ # Pathname.new('path/to/some/file.rb').ascend {|v| p v}
304
+ # #<Pathname:path/to/some/file.rb>
305
+ # #<Pathname:path/to/some>
306
+ # #<Pathname:path/to>
307
+ # #<Pathname:path>
308
+ #
309
+ # Returns an Enumerator if no block was given.
310
+ #
311
+ # enum = Pathname.new("/usr/bin/ruby").ascend
312
+ # # ... do stuff ...
313
+ # enum.each { |e| ... }
314
+ # # yields Pathnames /usr/bin/ruby, /usr/bin, /usr, and /.
315
+ #
316
+ # It doesn't access the filesystem.
317
+ #
318
+ def ascend: () { (Pathname) -> untyped } -> nil
319
+ | () -> Enumerator[Pathname, nil]
320
+
321
+ # <!--
322
+ # rdoc-file=pathname_builtin.rb
323
+ # - atime()
324
+ # -->
325
+ # See <code>File.atime</code>. Returns last access time.
326
+ #
327
+ def atime: () -> Time
328
+
329
+ # <!--
330
+ # rdoc-file=pathname_builtin.rb
331
+ # - basename(...)
332
+ # -->
333
+ # See <code>File.basename</code>. Returns the last component of the path.
334
+ #
335
+ def basename: (?String | _ToStr suffix) -> Pathname
336
+
337
+ # <!--
338
+ # rdoc-file=pathname_builtin.rb
339
+ # - binread(...)
340
+ # -->
341
+ # See <code>File.binread</code>. Returns all the bytes from the file, or the
342
+ # first `N` if specified.
343
+ #
344
+ def binread: (?Integer length, ?Integer offset) -> String
345
+
346
+ # <!--
347
+ # rdoc-file=pathname_builtin.rb
348
+ # - binwrite(...)
349
+ # -->
350
+ # Writes `contents` to the file, opening it in binary mode.
351
+ #
352
+ # See File.binwrite.
353
+ #
354
+ def binwrite: (String, ?Integer offset, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?invalid: :replace ?, ?undef: :replace ?, ?replace: String, ?fallback: Hash[String, String] | Proc | Method, ?xml: :text | :attr, ?universal_newline: true, ?cr_newline: true, ?crlf_newline: true) -> Integer
355
+
356
+ # <!--
357
+ # rdoc-file=pathname_builtin.rb
358
+ # - birthtime()
359
+ # -->
360
+ # Returns the birth time for the file. If the platform doesn't have birthtime,
361
+ # raises NotImplementedError.
362
+ #
363
+ # See File.birthtime.
364
+ #
365
+ def birthtime: () -> Time
366
+
367
+ # <!--
368
+ # rdoc-file=pathname_builtin.rb
369
+ # - blockdev?()
370
+ # -->
371
+ # See <code>FileTest.blockdev?</code>.
372
+ #
373
+ def blockdev?: () -> bool
374
+
375
+ # <!--
376
+ # rdoc-file=pathname_builtin.rb
377
+ # - chardev?()
378
+ # -->
379
+ # See <code>FileTest.chardev?</code>.
380
+ #
381
+ def chardev?: () -> bool
382
+
383
+ # <!--
384
+ # rdoc-file=pathname_builtin.rb
385
+ # - children(with_directory=true)
386
+ # -->
387
+ # Returns the children of the directory (files and subdirectories, not
388
+ # recursive) as an array of Pathname objects.
389
+ #
390
+ # By default, the returned pathnames will have enough information to access the
391
+ # files. If you set `with_directory` to `false`, then the returned pathnames
392
+ # will contain the filename only.
393
+ #
394
+ # For example:
395
+ # pn = Pathname("/usr/lib/ruby/1.8")
396
+ # pn.children
397
+ # # -> [ Pathname:/usr/lib/ruby/1.8/English.rb,
398
+ # Pathname:/usr/lib/ruby/1.8/Env.rb,
399
+ # Pathname:/usr/lib/ruby/1.8/abbrev.rb, ... ]
400
+ # pn.children(false)
401
+ # # -> [ Pathname:English.rb, Pathname:Env.rb, Pathname:abbrev.rb, ... ]
402
+ #
403
+ # Note that the results never contain the entries <code>.</code> and
404
+ # <code>..</code> in the directory because they are not children.
405
+ #
406
+ def children: (?boolish with_directory) -> Array[Pathname]
407
+
408
+ # <!--
409
+ # rdoc-file=pathname_builtin.rb
410
+ # - chmod(mode)
411
+ # -->
412
+ # See <code>File.chmod</code>. Changes permissions.
413
+ #
414
+ def chmod: (Integer mode_int) -> Integer
415
+
416
+ # <!--
417
+ # rdoc-file=pathname_builtin.rb
418
+ # - chown(owner, group)
419
+ # -->
420
+ # See <code>File.chown</code>. Change owner and group of file.
421
+ #
422
+ def chown: (Integer owner, Integer group) -> Integer
423
+
424
+ # <!--
425
+ # rdoc-file=pathname_builtin.rb
426
+ # - cleanpath(consider_symlink=false)
427
+ # -->
428
+ # Returns clean pathname of `self` with consecutive slashes and useless dots
429
+ # removed. The filesystem is not accessed.
430
+ #
431
+ # If `consider_symlink` is `true`, then a more conservative algorithm is used to
432
+ # avoid breaking symbolic linkages. This may retain more <code>..</code>
433
+ # entries than absolutely necessary, but without accessing the filesystem, this
434
+ # can't be avoided.
435
+ #
436
+ # See Pathname#realpath.
437
+ #
438
+ def cleanpath: (?boolish consider_symlink) -> Pathname
439
+
440
+ # <!--
441
+ # rdoc-file=pathname_builtin.rb
442
+ # - ctime()
443
+ # -->
444
+ # See <code>File.ctime</code>. Returns last (directory entry, not file) change
445
+ # time.
446
+ #
447
+ def ctime: () -> Time
448
+
449
+ # <!--
450
+ # rdoc-file=pathname_builtin.rb
451
+ # - delete()
452
+ # -->
453
+ #
454
+ def delete: () -> Integer
455
+
456
+ # <!--
457
+ # rdoc-file=pathname_builtin.rb
458
+ # - descend() { |v| ... }
459
+ # -->
460
+ # Iterates over and yields a new Pathname object for each element in the given
461
+ # path in descending order.
462
+ #
463
+ # Pathname.new('/path/to/some/file.rb').descend {|v| p v}
464
+ # #<Pathname:/>
465
+ # #<Pathname:/path>
466
+ # #<Pathname:/path/to>
467
+ # #<Pathname:/path/to/some>
468
+ # #<Pathname:/path/to/some/file.rb>
469
+ #
470
+ # Pathname.new('path/to/some/file.rb').descend {|v| p v}
471
+ # #<Pathname:path>
472
+ # #<Pathname:path/to>
473
+ # #<Pathname:path/to/some>
474
+ # #<Pathname:path/to/some/file.rb>
475
+ #
476
+ # Returns an Enumerator if no block was given.
477
+ #
478
+ # enum = Pathname.new("/usr/bin/ruby").descend
479
+ # # ... do stuff ...
480
+ # enum.each { |e| ... }
481
+ # # yields Pathnames /, /usr, /usr/bin, and /usr/bin/ruby.
482
+ #
483
+ # It doesn't access the filesystem.
484
+ #
485
+ def descend: () { (Pathname) -> untyped } -> nil
486
+ | () -> Enumerator[Pathname, nil]
487
+
488
+ # <!--
489
+ # rdoc-file=pathname_builtin.rb
490
+ # - directory?()
491
+ # -->
492
+ # See <code>FileTest.directory?</code>.
493
+ #
494
+ def directory?: () -> bool
495
+
496
+ # <!--
497
+ # rdoc-file=pathname_builtin.rb
498
+ # - dirname()
499
+ # -->
500
+ # See <code>File.dirname</code>. Returns all but the last component of the
501
+ # path.
502
+ #
503
+ def dirname: () -> Pathname
504
+
505
+ # <!--
506
+ # rdoc-file=pathname_builtin.rb
507
+ # - each_child(with_directory=true, &b)
508
+ # -->
509
+ # Iterates over the children of the directory (files and subdirectories, not
510
+ # recursive).
511
+ #
512
+ # It yields Pathname object for each child.
513
+ #
514
+ # By default, the yielded pathnames will have enough information to access the
515
+ # files.
516
+ #
517
+ # If you set `with_directory` to `false`, then the returned pathnames will
518
+ # contain the filename only.
519
+ #
520
+ # Pathname("/usr/local").each_child {|f| p f }
521
+ # #=> #<Pathname:/usr/local/share>
522
+ # # #<Pathname:/usr/local/bin>
523
+ # # #<Pathname:/usr/local/games>
524
+ # # #<Pathname:/usr/local/lib>
525
+ # # #<Pathname:/usr/local/include>
526
+ # # #<Pathname:/usr/local/sbin>
527
+ # # #<Pathname:/usr/local/src>
528
+ # # #<Pathname:/usr/local/man>
529
+ #
530
+ # Pathname("/usr/local").each_child(false) {|f| p f }
531
+ # #=> #<Pathname:share>
532
+ # # #<Pathname:bin>
533
+ # # #<Pathname:games>
534
+ # # #<Pathname:lib>
535
+ # # #<Pathname:include>
536
+ # # #<Pathname:sbin>
537
+ # # #<Pathname:src>
538
+ # # #<Pathname:man>
539
+ #
540
+ # Note that the results never contain the entries <code>.</code> and
541
+ # <code>..</code> in the directory because they are not children.
542
+ #
543
+ # See Pathname#children
544
+ #
545
+ def each_child: (?boolish with_directory) { (Pathname) -> void } -> Array[Pathname]
546
+ | (?boolish with_directory) -> Enumerator[Pathname, Array[Pathname]]
547
+
548
+ # <!--
549
+ # rdoc-file=pathname_builtin.rb
550
+ # - each_entry() { |pathname| ... }
551
+ # -->
552
+ # Iterates over the entries (files and subdirectories) in the directory. It
553
+ # yields a Pathname object for each entry.
554
+ #
555
+ # This method has existed since 1.8.1.
556
+ #
557
+ def each_entry: () { (Pathname) -> untyped } -> nil
558
+
559
+ # <!--
560
+ # rdoc-file=pathname_builtin.rb
561
+ # - each_filename() { |filename| ... }
562
+ # -->
563
+ # Iterates over each component of the path.
564
+ #
565
+ # Pathname.new("/usr/bin/ruby").each_filename {|filename| ... }
566
+ # # yields "usr", "bin", and "ruby".
567
+ #
568
+ # Returns an Enumerator if no block was given.
569
+ #
570
+ # enum = Pathname.new("/usr/bin/ruby").each_filename
571
+ # # ... do stuff ...
572
+ # enum.each { |e| ... }
573
+ # # yields "usr", "bin", and "ruby".
574
+ #
575
+ def each_filename: () { (String) -> untyped } -> nil
576
+ | () -> Enumerator[String, nil]
577
+
578
+ # <!--
579
+ # rdoc-file=pathname_builtin.rb
580
+ # - each_line(...) { |line| ... }
581
+ # -->
582
+ # #each_line iterates over the line in the file. It yields a String object for
583
+ # each line.
584
+ #
585
+ # This method has existed since 1.8.1.
586
+ #
587
+ def each_line: (?String sep, ?Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) { (String) -> untyped } -> nil
588
+ | (Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) { (String) -> untyped } -> nil
589
+ | (?String sep, ?Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) -> Enumerator[String, nil]
590
+ | (Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) -> Enumerator[String, nil]
591
+
592
+ # <!--
593
+ # rdoc-file=pathname_builtin.rb
594
+ # - empty?()
595
+ # -->
596
+ # Tests the file is empty.
597
+ #
598
+ # See Dir#empty? and FileTest.empty?.
599
+ #
600
+ def empty?: () -> bool
601
+
602
+ # <!--
603
+ # rdoc-file=pathname_builtin.rb
604
+ # - entries()
605
+ # -->
606
+ # Return the entries (files and subdirectories) in the directory, each as a
607
+ # Pathname object.
608
+ #
609
+ def entries: () -> Array[Pathname]
610
+
611
+ # <!--
612
+ # rdoc-file=pathname_builtin.rb
613
+ # - eql?(other)
614
+ # -->
615
+ #
616
+ def eql?: (untyped) -> bool
617
+
618
+ # <!--
619
+ # rdoc-file=pathname_builtin.rb
620
+ # - executable?()
621
+ # -->
622
+ # See <code>FileTest.executable?</code>.
623
+ #
624
+ def executable?: () -> bool
625
+
626
+ # <!--
627
+ # rdoc-file=pathname_builtin.rb
628
+ # - executable_real?()
629
+ # -->
630
+ # See <code>FileTest.executable_real?</code>.
631
+ #
632
+ def executable_real?: () -> bool
633
+
634
+ # <!--
635
+ # rdoc-file=pathname_builtin.rb
636
+ # - exist?()
637
+ # -->
638
+ # See <code>FileTest.exist?</code>.
639
+ #
640
+ def exist?: () -> bool
641
+
642
+ # <!--
643
+ # rdoc-file=pathname_builtin.rb
644
+ # - expand_path(...)
645
+ # -->
646
+ # See <code>File.expand_path</code>.
647
+ #
648
+ def expand_path: (?String dir) -> Pathname
649
+
650
+ # <!--
651
+ # rdoc-file=pathname_builtin.rb
652
+ # - extname()
653
+ # -->
654
+ # See <code>File.extname</code>. Returns the file's extension.
655
+ #
656
+ def extname: () -> String
657
+
658
+ # <!--
659
+ # rdoc-file=pathname_builtin.rb
660
+ # - file?()
661
+ # -->
662
+ # See <code>FileTest.file?</code>.
663
+ #
664
+ def file?: () -> bool
665
+
666
+ # <!--
667
+ # rdoc-file=pathname_builtin.rb
668
+ # - fnmatch(pattern, ...)
669
+ # -->
670
+ # See <code>File.fnmatch</code>. Return `true` if the receiver matches the
671
+ # given pattern.
672
+ #
673
+ def fnmatch: (String pattern, ?Integer flags) -> bool
674
+
675
+ # <!--
676
+ # rdoc-file=pathname_builtin.rb
677
+ # - fnmatch?(pattern, ...)
678
+ # -->
679
+ # See <code>File.fnmatch?</code> (same as #fnmatch).
680
+ #
681
+ alias fnmatch? fnmatch
682
+
683
+ # <!--
684
+ # rdoc-file=pathname_builtin.rb
685
+ # - freeze()
686
+ # -->
687
+ # Freze self.
688
+ #
689
+ def freeze: () -> Pathname
690
+
691
+ # <!--
692
+ # rdoc-file=pathname_builtin.rb
693
+ # - ftype()
694
+ # -->
695
+ # See <code>File.ftype</code>. Returns "type" of file ("file", "directory",
696
+ # etc).
697
+ #
698
+ def ftype: () -> String
699
+
700
+ # <!--
701
+ # rdoc-file=pathname_builtin.rb
702
+ # - glob(*args, **kwargs) { |pathname| ... }
703
+ # -->
704
+ # Returns or yields Pathname objects.
705
+ #
706
+ # Pathname("ruby-2.4.2").glob("R*.md")
707
+ # #=> [#<Pathname:ruby-2.4.2/README.md>, #<Pathname:ruby-2.4.2/README.ja.md>]
708
+ #
709
+ # See Dir.glob. This method uses the `base` keyword argument of Dir.glob.
710
+ #
711
+ def glob: (String | Array[String] pattern, ?Integer flags) -> Array[Pathname]
712
+ | (String | Array[String] pattern, ?Integer flags) { (Pathname) -> untyped } -> nil
713
+
714
+ # <!--
715
+ # rdoc-file=pathname_builtin.rb
716
+ # - grpowned?()
717
+ # -->
718
+ # See <code>FileTest.grpowned?</code>.
719
+ #
720
+ def grpowned?: () -> bool
721
+
722
+ def hash: () -> Integer
723
+
724
+ def inspect: () -> String
725
+
726
+ # <!--
727
+ # rdoc-file=pathname_builtin.rb
728
+ # - join(*args)
729
+ # -->
730
+ # Joins the given pathnames onto `self` to create a new Pathname object. This is
731
+ # effectively the same as using Pathname#+ to append `self` and all arguments
732
+ # sequentially.
733
+ #
734
+ # path0 = Pathname.new("/usr") # Pathname:/usr
735
+ # path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
736
+ # # is the same as
737
+ # path1 = Pathname.new("/usr") + "bin/ruby" # Pathname:/usr/bin/ruby
738
+ # path0 == path1
739
+ # #=> true
740
+ #
741
+ def join: (*String | _ToStr | Pathname args) -> Pathname
742
+
743
+ # <!--
744
+ # rdoc-file=pathname_builtin.rb
745
+ # - lchmod(mode)
746
+ # -->
747
+ # See <code>File.lchmod</code>.
748
+ #
749
+ def lchmod: (Integer mode) -> Integer
750
+
751
+ # <!--
752
+ # rdoc-file=pathname_builtin.rb
753
+ # - lchown(owner, group)
754
+ # -->
755
+ # See <code>File.lchown</code>.
756
+ #
757
+ def lchown: (Integer owner, Integer group) -> Integer
758
+
759
+ # <!--
760
+ # rdoc-file=pathname_builtin.rb
761
+ # - lstat()
762
+ # -->
763
+ # See <code>File.lstat</code>.
764
+ #
765
+ def lstat: () -> ::File::Stat
766
+
767
+ # <!--
768
+ # rdoc-file=pathname_builtin.rb
769
+ # - lutime(atime, mtime)
770
+ # -->
771
+ # Update the access and modification times of the file.
772
+ #
773
+ # Same as Pathname#utime, but does not follow symbolic links.
774
+ #
775
+ # See File.lutime.
776
+ #
777
+ def lutime: (Time | Numeric atime, Time | Numeric mtime) -> Integer
778
+
779
+ # <!--
780
+ # rdoc-file=pathname_builtin.rb
781
+ # - make_link(old)
782
+ # -->
783
+ # See <code>File.link</code>. Creates a hard link.
784
+ #
785
+ def make_link: (String | Pathname | _ToStr old) -> Integer
786
+
787
+ # <!--
788
+ # rdoc-file=pathname_builtin.rb
789
+ # - make_symlink(old)
790
+ # -->
791
+ # See <code>File.symlink</code>. Creates a symbolic link.
792
+ #
793
+ def make_symlink: (String | Pathname | _ToStr old) -> Integer
794
+
795
+ # <!--
796
+ # rdoc-file=pathname_builtin.rb
797
+ # - mkdir(...)
798
+ # -->
799
+ # See <code>Dir.mkdir</code>. Create the referenced directory.
800
+ #
801
+ def mkdir: (?Integer perm) -> Integer
802
+
803
+ # <!--
804
+ # rdoc-file=pathname_builtin.rb
805
+ # - mkpath(mode: nil)
806
+ # -->
807
+ # Creates a full path, including any intermediate directories that don't yet
808
+ # exist.
809
+ #
810
+ # See FileUtils.mkpath and FileUtils.mkdir_p
811
+ #
812
+ def mkpath: () -> self
813
+
814
+ # <!--
815
+ # rdoc-file=pathname_builtin.rb
816
+ # - mountpoint?()
817
+ # -->
818
+ # Returns `true` if `self` points to a mountpoint.
819
+ #
820
+ def mountpoint?: () -> bool
821
+
822
+ # <!--
823
+ # rdoc-file=pathname_builtin.rb
824
+ # - mtime()
825
+ # -->
826
+ # See <code>File.mtime</code>. Returns last modification time.
827
+ #
828
+ def mtime: () -> Time
829
+
830
+ # <!--
831
+ # rdoc-file=pathname_builtin.rb
832
+ # - open(...) { |file| ... }
833
+ # -->
834
+ # See <code>File.open</code>. Opens the file for reading or writing.
835
+ #
836
+ def open: (
837
+ ?string | int mode,
838
+ ?int perm,
839
+ # open options
840
+ ?flags: Integer,
841
+ ?external_encoding: encoding,
842
+ ?internal_encoding: encoding,
843
+ ?encoding: encoding,
844
+ ?textmode: boolish,
845
+ ?binmode: boolish,
846
+ ?autoclose: boolish,
847
+ ?path: path,
848
+ # encoding options
849
+ ?invalid: :replace | nil,
850
+ ?undef: :replace | nil,
851
+ ?replace: String | nil,
852
+ ?fallback: Hash[string, string] | ^(String) -> string | Method | nil,
853
+ ?xml: :text | :attr | nil,
854
+ ?cr_newline: bool,
855
+ ?crlf_newline: bool,
856
+ ?universal_newline: bool
857
+ ) -> File
858
+ | [T] (
859
+ ?string | int mode,
860
+ ?int perm,
861
+ # open options
862
+ ?mode: Integer | String,
863
+ ?flags: Integer,
864
+ ?external_encoding: encoding,
865
+ ?internal_encoding: encoding,
866
+ ?encoding: encoding,
867
+ ?textmode: boolish,
868
+ ?binmode: boolish,
869
+ ?autoclose: boolish,
870
+ ?path: path,
871
+ # encoding options
872
+ ?invalid: :replace | nil,
873
+ ?undef: :replace | nil,
874
+ ?replace: String | nil,
875
+ ?fallback: Hash[string, string] | ^(String) -> string | Method | nil,
876
+ ?xml: :text | :attr | nil,
877
+ ?cr_newline: bool,
878
+ ?crlf_newline: bool,
879
+ ?universal_newline: bool
880
+ ) { (File) -> T } -> T
881
+
882
+ # <!--
883
+ # rdoc-file=pathname_builtin.rb
884
+ # - opendir() { |dir| ... }
885
+ # -->
886
+ # See <code>Dir.open</code>.
887
+ #
888
+ def opendir: () -> Dir
889
+ | [U] () { (Dir) -> U } -> U
890
+
891
+ # <!--
892
+ # rdoc-file=pathname_builtin.rb
893
+ # - owned?()
894
+ # -->
895
+ # See <code>FileTest.owned?</code>.
896
+ #
897
+ def owned?: () -> bool
898
+
899
+ # <!--
900
+ # rdoc-file=pathname_builtin.rb
901
+ # - parent()
902
+ # -->
903
+ # Returns the parent directory.
904
+ #
905
+ # This is same as <code>self + '..'</code>.
906
+ #
907
+ def parent: () -> Pathname
908
+
909
+ # <!--
910
+ # rdoc-file=pathname_builtin.rb
911
+ # - pipe?()
912
+ # -->
913
+ # See <code>FileTest.pipe?</code>.
914
+ #
915
+ def pipe?: () -> bool
916
+
917
+ # <!--
918
+ # rdoc-file=pathname_builtin.rb
919
+ # - read(...)
920
+ # -->
921
+ # See <code>File.read</code>. Returns all data from the file, or the first `N`
922
+ # bytes if specified.
923
+ #
924
+ def read: (?Integer length, ?Integer offset, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish) -> String
925
+
926
+ # <!--
927
+ # rdoc-file=pathname_builtin.rb
928
+ # - readable?()
929
+ # -->
930
+ # See <code>FileTest.readable?</code>.
931
+ #
932
+ def readable?: () -> bool
933
+
934
+ # <!--
935
+ # rdoc-file=pathname_builtin.rb
936
+ # - readable_real?()
937
+ # -->
938
+ # See <code>FileTest.readable_real?</code>.
939
+ #
940
+ def readable_real?: () -> bool
941
+
942
+ # <!--
943
+ # rdoc-file=pathname_builtin.rb
944
+ # - readlines(...)
945
+ # -->
946
+ # See <code>File.readlines</code>. Returns all the lines from the file.
947
+ #
948
+ def readlines: (?String sep, ?Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) -> Array[String]
949
+ | (Integer limit, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?chomp: boolish) -> Array[String]
950
+
951
+ # <!--
952
+ # rdoc-file=pathname_builtin.rb
953
+ # - readlink()
954
+ # -->
955
+ # See <code>File.readlink</code>. Read symbolic link.
956
+ #
957
+ def readlink: () -> untyped
958
+
959
+ # <!--
960
+ # rdoc-file=pathname_builtin.rb
961
+ # - realdirpath(...)
962
+ # -->
963
+ # Returns the real (absolute) pathname of `self` in the actual filesystem.
964
+ #
965
+ # Does not contain symlinks or useless dots, <code>..</code> and <code>.</code>.
966
+ #
967
+ # The last component of the real pathname can be nonexistent.
968
+ #
969
+ def realdirpath: (?string | Pathname base_dir) -> Pathname
970
+
971
+ # <!--
972
+ # rdoc-file=pathname_builtin.rb
973
+ # - realpath(...)
974
+ # -->
975
+ # Returns the real (absolute) pathname for `self` in the actual filesystem.
976
+ #
977
+ # Does not contain symlinks or useless dots, <code>..</code> and <code>.</code>.
978
+ #
979
+ # All components of the pathname must exist when this method is called.
980
+ #
981
+ def realpath: (?string | Pathname base_dir) -> Pathname
982
+
983
+ # <!--
984
+ # rdoc-file=pathname_builtin.rb
985
+ # - relative?()
986
+ # -->
987
+ # The opposite of Pathname#absolute?
988
+ #
989
+ # It returns `false` if the pathname begins with a slash.
990
+ #
991
+ # p = Pathname.new('/im/sure')
992
+ # p.relative?
993
+ # #=> false
994
+ #
995
+ # p = Pathname.new('not/so/sure')
996
+ # p.relative?
997
+ # #=> true
998
+ #
999
+ def relative?: () -> bool
1000
+
1001
+ # <!--
1002
+ # rdoc-file=pathname_builtin.rb
1003
+ # - relative_path_from(base_directory)
1004
+ # -->
1005
+ # Returns a relative path from the given `base_directory` to the receiver.
1006
+ #
1007
+ # If `self` is absolute, then `base_directory` must be absolute too.
1008
+ #
1009
+ # If `self` is relative, then `base_directory` must be relative too.
1010
+ #
1011
+ # This method doesn't access the filesystem. It assumes no symlinks.
1012
+ #
1013
+ # ArgumentError is raised when it cannot find a relative path.
1014
+ #
1015
+ # Note that this method does not handle situations where the case sensitivity of
1016
+ # the filesystem in use differs from the operating system default.
1017
+ #
1018
+ def relative_path_from: (Pathname | string base_directory) -> Pathname
1019
+
1020
+ # <!--
1021
+ # rdoc-file=pathname_builtin.rb
1022
+ # - rename(to)
1023
+ # -->
1024
+ # See <code>File.rename</code>. Rename the file.
1025
+ #
1026
+ def rename: (Pathname | string new_name) -> 0
1027
+
1028
+ # <!--
1029
+ # rdoc-file=pathname_builtin.rb
1030
+ # - rmdir()
1031
+ # -->
1032
+ # See <code>Dir.rmdir</code>. Remove the referenced directory.
1033
+ #
1034
+ def rmdir: () -> 0
1035
+
1036
+ # <!--
1037
+ # rdoc-file=pathname_builtin.rb
1038
+ # - root?()
1039
+ # -->
1040
+ # Predicate method for root directories. Returns `true` if the pathname
1041
+ # consists of consecutive slashes.
1042
+ #
1043
+ # It doesn't access the filesystem. So it may return `false` for some pathnames
1044
+ # which points to roots such as <code>/usr/..</code>.
1045
+ #
1046
+ def root?: () -> bool
1047
+
1048
+ # <!--
1049
+ # rdoc-file=pathname_builtin.rb
1050
+ # - setgid?()
1051
+ # -->
1052
+ # See <code>FileTest.setgid?</code>.
1053
+ #
1054
+ def setgid?: () -> bool
1055
+
1056
+ # <!--
1057
+ # rdoc-file=pathname_builtin.rb
1058
+ # - setuid?()
1059
+ # -->
1060
+ # See <code>FileTest.setuid?</code>.
1061
+ #
1062
+ def setuid?: () -> bool
1063
+
1064
+ # <!--
1065
+ # rdoc-file=pathname_builtin.rb
1066
+ # - size()
1067
+ # -->
1068
+ # See <code>FileTest.size</code>.
1069
+ #
1070
+ def size: () -> Integer
1071
+
1072
+ # <!--
1073
+ # rdoc-file=pathname_builtin.rb
1074
+ # - size?()
1075
+ # -->
1076
+ # See <code>FileTest.size?</code>.
1077
+ #
1078
+ def size?: () -> Integer?
1079
+
1080
+ # <!--
1081
+ # rdoc-file=pathname_builtin.rb
1082
+ # - socket?()
1083
+ # -->
1084
+ # See <code>FileTest.socket?</code>.
1085
+ #
1086
+ def socket?: () -> untyped
1087
+
1088
+ # <!--
1089
+ # rdoc-file=pathname_builtin.rb
1090
+ # - split()
1091
+ # -->
1092
+ # See <code>File.split</code>. Returns the #dirname and the #basename in an
1093
+ # Array.
1094
+ #
1095
+ def split: () -> [ Pathname, Pathname ]
1096
+
1097
+ # <!--
1098
+ # rdoc-file=pathname_builtin.rb
1099
+ # - stat()
1100
+ # -->
1101
+ # See <code>File.stat</code>. Returns a <code>File::Stat</code> object.
1102
+ #
1103
+ def stat: () -> File::Stat
1104
+
1105
+ # <!--
1106
+ # rdoc-file=pathname_builtin.rb
1107
+ # - sticky?()
1108
+ # -->
1109
+ # See <code>FileTest.sticky?</code>.
1110
+ #
1111
+ def sticky?: () -> untyped
1112
+
1113
+ # <!--
1114
+ # rdoc-file=pathname.c
1115
+ # - sub(*args)
1116
+ # -->
1117
+ # Return a pathname which is substituted by String#sub.
1118
+ #
1119
+ # path1 = Pathname.new('/usr/bin/perl')
1120
+ # path1.sub('perl', 'ruby')
1121
+ # #=> #<Pathname:/usr/bin/ruby>
1122
+ #
1123
+ def sub: (Regexp | string pattern, string | Hash[String, String] replacement) -> Pathname
1124
+ | (Regexp | string pattern) { (String match) -> string } -> Pathname
1125
+
1126
+ # <!--
1127
+ # rdoc-file=pathname_builtin.rb
1128
+ # - sub_ext(repl)
1129
+ # -->
1130
+ # Return a pathname with `repl` added as a suffix to the basename.
1131
+ #
1132
+ # If self has no extension part, `repl` is appended.
1133
+ #
1134
+ # Pathname.new('/usr/bin/shutdown').sub_ext('.rb')
1135
+ # #=> #<Pathname:/usr/bin/shutdown.rb>
1136
+ #
1137
+ def sub_ext: (string replacement) -> Pathname
1138
+
1139
+ # <!--
1140
+ # rdoc-file=pathname_builtin.rb
1141
+ # - symlink?()
1142
+ # -->
1143
+ # See <code>FileTest.symlink?</code>.
1144
+ #
1145
+ def symlink?: () -> untyped
1146
+
1147
+ # <!--
1148
+ # rdoc-file=pathname_builtin.rb
1149
+ # - sysopen(...)
1150
+ # -->
1151
+ # See <code>File.sysopen</code>.
1152
+ #
1153
+ def sysopen: (?String mode, ?Integer perm) -> Integer
1154
+
1155
+ # <!--
1156
+ # rdoc-file=ext/pathname/pathname.c
1157
+ # - pathname.taint -> obj
1158
+ # -->
1159
+ # Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
1160
+ #
1161
+ def taint: () -> Pathname
1162
+
1163
+ # <!-- rdoc-file=pathname_builtin.rb -->
1164
+ # to_path is implemented so Pathname objects are usable with File.open, etc.
1165
+ #
1166
+ def to_path: () -> String
1167
+
1168
+ # <!--
1169
+ # rdoc-file=pathname_builtin.rb
1170
+ # - to_s()
1171
+ # -->
1172
+ # Return the path as a String.
1173
+ #
1174
+ alias to_s to_path
1175
+
1176
+ # <!--
1177
+ # rdoc-file=pathname_builtin.rb
1178
+ # - truncate(length)
1179
+ # -->
1180
+ # See <code>File.truncate</code>. Truncate the file to `length` bytes.
1181
+ #
1182
+ def truncate: (Integer length) -> 0
1183
+
1184
+ # <!--
1185
+ # rdoc-file=pathname_builtin.rb
1186
+ # - unlink()
1187
+ # -->
1188
+ # Removes a file or directory, using <code>File.unlink</code> or
1189
+ # <code>Dir.unlink</code> as necessary.
1190
+ #
1191
+ def unlink: () -> Integer
1192
+
1193
+ # <!--
1194
+ # rdoc-file=ext/pathname/pathname.c
1195
+ # - pathname.untaint -> obj
1196
+ # -->
1197
+ # Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
1198
+ #
1199
+ def untaint: () -> Pathname
1200
+
1201
+ # <!--
1202
+ # rdoc-file=pathname_builtin.rb
1203
+ # - utime(atime, mtime)
1204
+ # -->
1205
+ # See <code>File.utime</code>. Update the access and modification times.
1206
+ #
1207
+ def utime: (Integer | Time atime, Integer | Time mtime) -> Integer
1208
+
1209
+ # <!--
1210
+ # rdoc-file=pathname_builtin.rb
1211
+ # - world_readable?()
1212
+ # -->
1213
+ # See <code>FileTest.world_readable?</code>.
1214
+ #
1215
+ def world_readable?: () -> (Integer | nil)
1216
+
1217
+ # <!--
1218
+ # rdoc-file=pathname_builtin.rb
1219
+ # - world_writable?()
1220
+ # -->
1221
+ # See <code>FileTest.world_writable?</code>.
1222
+ #
1223
+ def world_writable?: () -> (Integer | nil)
1224
+
1225
+ # <!--
1226
+ # rdoc-file=pathname_builtin.rb
1227
+ # - writable?()
1228
+ # -->
1229
+ # See <code>FileTest.writable?</code>.
1230
+ #
1231
+ def writable?: () -> bool
1232
+
1233
+ # <!--
1234
+ # rdoc-file=pathname_builtin.rb
1235
+ # - writable_real?()
1236
+ # -->
1237
+ # See <code>FileTest.writable_real?</code>.
1238
+ #
1239
+ def writable_real?: () -> bool
1240
+
1241
+ # <!--
1242
+ # rdoc-file=pathname_builtin.rb
1243
+ # - write(...)
1244
+ # -->
1245
+ # Writes `contents` to the file. See <code>File.write</code>.
1246
+ #
1247
+ def write: (String content, ?Integer offset, ?mode: Integer | String, ?flags: Integer, ?external_encoding: encoding, ?internal_encoding: encoding, ?encoding: encoding, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish) -> Integer
1248
+
1249
+ # <!--
1250
+ # rdoc-file=pathname_builtin.rb
1251
+ # - zero?()
1252
+ # -->
1253
+ # See <code>FileTest.zero?</code>.
1254
+ #
1255
+ def zero?: () -> bool
1256
+
1257
+ private
1258
+
1259
+ def add_trailing_separator: (untyped path) -> untyped
1260
+
1261
+ def chop_basename: (untyped path) -> untyped
1262
+
1263
+ def cleanpath_aggressive: () -> untyped
1264
+
1265
+ def cleanpath_conservative: () -> untyped
1266
+
1267
+ def del_trailing_separator: (untyped path) -> untyped
1268
+
1269
+ def has_trailing_separator?: (untyped path) -> untyped
1270
+
1271
+ # <!--
1272
+ # rdoc-file=pathname_builtin.rb
1273
+ # - new(path)
1274
+ # -->
1275
+ # Create a Pathname object from the given String (or String-like object). If
1276
+ # `path` contains a NUL character (<code>\0</code>), an ArgumentError is raised.
1277
+ #
1278
+ def initialize: (string | Pathname) -> void
1279
+
1280
+ def plus: (untyped path1, untyped path2) -> untyped
1281
+
1282
+ def prepend_prefix: (untyped prefix, untyped relpath) -> untyped
1283
+
1284
+ def split_names: (untyped path) -> untyped
1285
+
1286
+ SAME_PATHS: Proc
1287
+
1288
+ # <!-- rdoc-file=pathname_builtin.rb -->
1289
+ # Separator list string.
1290
+ #
1291
+ SEPARATOR_LIST: String
1292
+
1293
+ # <!-- rdoc-file=pathname_builtin.rb -->
1294
+ # Regexp that matches a separator.
1295
+ #
1296
+ SEPARATOR_PAT: Regexp
1297
+
1298
+ TO_PATH: Symbol
1299
+ end
1300
+
1301
+ %a{annotate:rdoc:skip}
1302
+ module Kernel
1303
+ private
1304
+
1305
+ # <!--
1306
+ # rdoc-file=pathname_builtin.rb
1307
+ # - Pathname(path)
1308
+ # -->
1309
+ # Creates a Pathname object.
1310
+ #
1311
+ def self?.Pathname: (string | Pathname) -> Pathname
1312
+ end