rbs 2.8.4 → 3.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +12 -4
  3. data/.github/workflows/comments.yml +11 -11
  4. data/.github/workflows/dependabot.yml +30 -0
  5. data/.github/workflows/ruby.yml +40 -49
  6. data/.github/workflows/typecheck.yml +36 -0
  7. data/.github/workflows/windows.yml +28 -0
  8. data/.gitignore +1 -0
  9. data/.rubocop.yml +42 -2
  10. data/CHANGELOG.md +845 -1
  11. data/README.md +64 -4
  12. data/Rakefile +198 -18
  13. data/Steepfile +11 -11
  14. data/config.yml +311 -0
  15. data/core/array.rbs +2189 -1914
  16. data/core/basic_object.rbs +59 -84
  17. data/core/binding.rbs +7 -69
  18. data/core/builtin.rbs +210 -11
  19. data/core/class.rbs +37 -0
  20. data/core/comparable.rbs +23 -25
  21. data/core/complex.rbs +449 -227
  22. data/core/constants.rbs +29 -21
  23. data/core/data.rbs +415 -0
  24. data/core/dir.rbs +698 -415
  25. data/core/encoding.rbs +468 -843
  26. data/core/enumerable.rbs +495 -455
  27. data/core/enumerator/product.rbs +92 -0
  28. data/core/enumerator.rbs +106 -9
  29. data/core/env.rbs +1 -1
  30. data/core/errno.rbs +506 -605
  31. data/core/errors.rbs +15 -17
  32. data/core/exception.rbs +361 -145
  33. data/core/false_class.rbs +39 -26
  34. data/core/fiber.rbs +121 -14
  35. data/core/file.rbs +1262 -320
  36. data/core/file_test.rbs +62 -45
  37. data/core/float.rbs +187 -208
  38. data/core/gc.rbs +446 -196
  39. data/core/global_variables.rbs +29 -29
  40. data/core/hash.rbs +242 -349
  41. data/core/integer.rbs +246 -308
  42. data/core/io/buffer.rbs +373 -122
  43. data/core/io/wait.rbs +29 -17
  44. data/core/io.rbs +1881 -1518
  45. data/core/kernel.rbs +2116 -1538
  46. data/core/marshal.rbs +24 -14
  47. data/core/match_data.rbs +413 -166
  48. data/core/math.rbs +531 -291
  49. data/core/method.rbs +101 -32
  50. data/core/module.rbs +228 -64
  51. data/core/nil_class.rbs +106 -47
  52. data/core/numeric.rbs +206 -292
  53. data/core/object.rbs +73 -1168
  54. data/core/object_space/weak_key_map.rbs +166 -0
  55. data/core/object_space.rbs +5 -3
  56. data/core/proc.rbs +280 -39
  57. data/core/process.rbs +1318 -658
  58. data/core/ractor.rbs +200 -134
  59. data/core/random.rbs +21 -4
  60. data/core/range.rbs +309 -153
  61. data/core/rational.rbs +4 -12
  62. data/core/rb_config.rbs +64 -43
  63. data/core/rbs/unnamed/argf.rbs +411 -147
  64. data/core/rbs/unnamed/env_class.rbs +137 -253
  65. data/core/rbs/unnamed/random.rbs +49 -26
  66. data/core/refinement.rbs +16 -1
  67. data/core/regexp.rbs +1568 -862
  68. data/core/ruby_vm.rbs +719 -7
  69. data/core/rubygems/config_file.rbs +3 -0
  70. data/core/rubygems/errors.rbs +69 -6
  71. data/core/rubygems/rubygems.rbs +71 -17
  72. data/core/rubygems/version.rbs +11 -7
  73. data/{stdlib/set/0 → core}/set.rbs +80 -91
  74. data/core/signal.rbs +14 -8
  75. data/core/string.rbs +1732 -1607
  76. data/core/struct.rbs +467 -95
  77. data/core/symbol.rbs +215 -245
  78. data/core/thread.rbs +133 -89
  79. data/core/thread_group.rbs +9 -9
  80. data/core/time.rbs +1141 -841
  81. data/core/trace_point.rbs +181 -121
  82. data/core/true_class.rbs +58 -32
  83. data/core/unbound_method.rbs +103 -30
  84. data/core/warning.rbs +50 -5
  85. data/docs/CONTRIBUTING.md +1 -1
  86. data/docs/architecture.md +110 -0
  87. data/docs/collection.md +59 -5
  88. data/docs/data_and_struct.md +86 -0
  89. data/docs/gem.md +57 -0
  90. data/docs/rbs_by_example.md +16 -35
  91. data/docs/repo.md +1 -1
  92. data/docs/sigs.md +7 -7
  93. data/docs/stdlib.md +63 -5
  94. data/docs/syntax.md +255 -61
  95. data/docs/tools.md +1 -0
  96. data/ext/rbs_extension/extconf.rb +10 -0
  97. data/ext/rbs_extension/lexer.c +1741 -1548
  98. data/ext/rbs_extension/lexer.h +11 -1
  99. data/ext/rbs_extension/lexer.re +12 -6
  100. data/ext/rbs_extension/lexstate.c +26 -3
  101. data/ext/rbs_extension/location.c +119 -111
  102. data/ext/rbs_extension/location.h +32 -7
  103. data/ext/rbs_extension/main.c +3 -0
  104. data/ext/rbs_extension/parser.c +883 -481
  105. data/ext/rbs_extension/parserstate.c +65 -25
  106. data/ext/rbs_extension/parserstate.h +13 -3
  107. data/ext/rbs_extension/rbs_extension.h +1 -10
  108. data/ext/rbs_extension/unescape.c +7 -47
  109. data/goodcheck.yml +2 -2
  110. data/{ext/rbs_extension → include/rbs}/constants.h +26 -15
  111. data/include/rbs/ruby_objs.h +72 -0
  112. data/include/rbs.h +7 -0
  113. data/lib/rbs/annotate/annotations.rb +3 -3
  114. data/lib/rbs/annotate/formatter.rb +13 -3
  115. data/lib/rbs/annotate/rdoc_annotator.rb +1 -1
  116. data/lib/rbs/annotate/rdoc_source.rb +12 -3
  117. data/lib/rbs/ast/declarations.rb +85 -2
  118. data/lib/rbs/ast/directives.rb +39 -0
  119. data/lib/rbs/ast/members.rb +49 -15
  120. data/lib/rbs/ast/type_param.rb +104 -15
  121. data/lib/rbs/ast/visitor.rb +137 -0
  122. data/lib/rbs/buffer.rb +5 -0
  123. data/lib/rbs/cli/colored_io.rb +48 -0
  124. data/lib/rbs/cli/diff.rb +83 -0
  125. data/lib/rbs/cli/validate.rb +356 -0
  126. data/lib/rbs/cli.rb +253 -143
  127. data/lib/rbs/collection/cleaner.rb +8 -1
  128. data/lib/rbs/collection/config/lockfile.rb +92 -0
  129. data/lib/rbs/collection/config/lockfile_generator.rb +154 -65
  130. data/lib/rbs/collection/config.rb +19 -46
  131. data/lib/rbs/collection/installer.rb +12 -13
  132. data/lib/rbs/collection/sources/base.rb +2 -2
  133. data/lib/rbs/collection/sources/git.rb +146 -69
  134. data/lib/rbs/collection/sources/local.rb +81 -0
  135. data/lib/rbs/collection/sources/rubygems.rb +10 -12
  136. data/lib/rbs/collection/sources/stdlib.rb +14 -13
  137. data/lib/rbs/collection/sources.rb +15 -2
  138. data/lib/rbs/collection.rb +2 -1
  139. data/lib/rbs/definition.rb +13 -16
  140. data/lib/rbs/definition_builder/ancestor_builder.rb +100 -24
  141. data/lib/rbs/definition_builder/method_builder.rb +4 -4
  142. data/lib/rbs/definition_builder.rb +489 -584
  143. data/lib/rbs/diff.rb +125 -0
  144. data/lib/rbs/environment/use_map.rb +77 -0
  145. data/lib/rbs/environment.rb +406 -105
  146. data/lib/rbs/environment_loader.rb +48 -44
  147. data/lib/rbs/environment_walker.rb +1 -1
  148. data/lib/rbs/errors.rb +175 -56
  149. data/lib/rbs/file_finder.rb +28 -0
  150. data/lib/rbs/location_aux.rb +8 -7
  151. data/lib/rbs/locator.rb +37 -15
  152. data/lib/rbs/method_type.rb +23 -0
  153. data/lib/rbs/namespace.rb +1 -0
  154. data/lib/rbs/parser/lex_result.rb +15 -0
  155. data/lib/rbs/parser/token.rb +23 -0
  156. data/lib/rbs/parser_aux.rb +22 -13
  157. data/lib/rbs/prototype/helpers.rb +48 -22
  158. data/lib/rbs/prototype/node_usage.rb +99 -0
  159. data/lib/rbs/prototype/rb.rb +125 -31
  160. data/lib/rbs/prototype/rbi.rb +49 -36
  161. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  162. data/lib/rbs/prototype/runtime/reflection.rb +19 -0
  163. data/lib/rbs/prototype/runtime/value_object_generator.rb +279 -0
  164. data/lib/rbs/prototype/runtime.rb +273 -159
  165. data/lib/rbs/resolver/constant_resolver.rb +24 -8
  166. data/lib/rbs/resolver/type_name_resolver.rb +41 -7
  167. data/lib/rbs/sorter.rb +153 -123
  168. data/lib/rbs/substitution.rb +19 -0
  169. data/lib/rbs/subtractor.rb +201 -0
  170. data/lib/rbs/test/errors.rb +24 -11
  171. data/lib/rbs/test/guaranteed.rb +30 -0
  172. data/lib/rbs/test/hook.rb +45 -40
  173. data/lib/rbs/test/setup.rb +1 -1
  174. data/lib/rbs/test/tester.rb +1 -1
  175. data/lib/rbs/test/type_check.rb +120 -23
  176. data/lib/rbs/test.rb +6 -3
  177. data/lib/rbs/type_alias_dependency.rb +13 -3
  178. data/lib/rbs/type_alias_regularity.rb +21 -14
  179. data/lib/rbs/type_name.rb +18 -13
  180. data/lib/rbs/types.rb +352 -18
  181. data/lib/rbs/unit_test/convertibles.rb +176 -0
  182. data/lib/rbs/unit_test/spy.rb +136 -0
  183. data/lib/rbs/unit_test/type_assertions.rb +341 -0
  184. data/lib/rbs/unit_test/with_aliases.rb +143 -0
  185. data/lib/rbs/unit_test.rb +6 -0
  186. data/lib/rbs/validator.rb +55 -30
  187. data/lib/rbs/variance_calculator.rb +26 -23
  188. data/lib/rbs/vendorer.rb +3 -3
  189. data/lib/rbs/version.rb +1 -1
  190. data/lib/rbs/writer.rb +69 -22
  191. data/lib/rbs.rb +7 -2
  192. data/lib/rdoc/discover.rb +1 -1
  193. data/lib/rdoc_plugin/parser.rb +5 -5
  194. data/rbs.gemspec +12 -2
  195. data/schema/decls.json +1 -1
  196. data/schema/members.json +15 -10
  197. data/sig/ancestor_builder.rbs +4 -0
  198. data/sig/ancestor_graph.rbs +22 -2
  199. data/sig/annotate/formatter.rbs +2 -2
  200. data/sig/annotate/rdoc_annotater.rbs +1 -1
  201. data/sig/cli/colored_io.rbs +15 -0
  202. data/sig/cli/diff.rbs +21 -0
  203. data/sig/cli/validate.rbs +43 -0
  204. data/sig/cli.rbs +4 -0
  205. data/sig/collection/config/lockfile.rbs +74 -0
  206. data/sig/collection/config/lockfile_generator.rbs +66 -0
  207. data/sig/collection/config.rbs +5 -48
  208. data/sig/collection/installer.rbs +1 -1
  209. data/sig/collection/sources.rbs +105 -33
  210. data/sig/constant.rbs +1 -1
  211. data/sig/declarations.rbs +42 -3
  212. data/sig/definition.rbs +26 -10
  213. data/sig/definition_builder.rbs +103 -81
  214. data/sig/diff.rbs +28 -0
  215. data/sig/directives.rbs +61 -0
  216. data/sig/environment.rbs +175 -29
  217. data/sig/environment_loader.rbs +20 -18
  218. data/sig/errors.rbs +123 -2
  219. data/sig/file_finder.rbs +28 -0
  220. data/sig/location.rbs +0 -3
  221. data/sig/locator.rbs +14 -2
  222. data/sig/manifest.yaml +0 -1
  223. data/sig/members.rbs +32 -9
  224. data/sig/method_types.rbs +10 -4
  225. data/sig/namespace.rbs +2 -3
  226. data/sig/parser.rbs +55 -16
  227. data/sig/prototype/helpers.rbs +4 -0
  228. data/sig/prototype/node_usage.rbs +20 -0
  229. data/sig/prototype/rb.rbs +10 -2
  230. data/sig/prototype/rbi.rbs +2 -0
  231. data/sig/prototype/runtime.rbs +182 -0
  232. data/sig/rbs.rbs +1 -1
  233. data/sig/rdoc/rbs.rbs +4 -0
  234. data/sig/repository.rbs +7 -5
  235. data/sig/resolver/constant_resolver.rbs +3 -4
  236. data/sig/resolver/context.rbs +1 -1
  237. data/sig/resolver/type_name_resolver.rbs +5 -1
  238. data/sig/shims/bundler.rbs +38 -0
  239. data/sig/shims/rubygems.rbs +19 -0
  240. data/sig/sorter.rbs +23 -5
  241. data/sig/substitution.rbs +6 -0
  242. data/sig/subtractor.rbs +37 -0
  243. data/sig/test/errors.rbs +52 -0
  244. data/sig/test/guranteed.rbs +9 -0
  245. data/sig/test/type_check.rbs +19 -0
  246. data/sig/test.rbs +82 -0
  247. data/sig/type_alias_dependency.rbs +31 -0
  248. data/sig/type_alias_regularity.rbs +12 -6
  249. data/sig/type_param.rbs +45 -9
  250. data/sig/typename.rbs +8 -5
  251. data/sig/types.rbs +119 -12
  252. data/sig/unit_test/convertibles.rbs +154 -0
  253. data/sig/unit_test/spy.rbs +28 -0
  254. data/sig/unit_test/type_assertions.rbs +194 -0
  255. data/sig/unit_test/with_aliases.rbs +136 -0
  256. data/sig/use_map.rbs +35 -0
  257. data/sig/validator.rbs +12 -5
  258. data/sig/variance_calculator.rbs +3 -1
  259. data/sig/vendorer.rbs +1 -1
  260. data/sig/visitor.rbs +47 -0
  261. data/sig/writer.rbs +6 -2
  262. data/src/constants.c +153 -0
  263. data/src/ruby_objs.c +793 -0
  264. data/stdlib/base64/0/base64.rbs +298 -45
  265. data/stdlib/benchmark/0/benchmark.rbs +12 -3
  266. data/stdlib/bigdecimal/0/big_decimal.rbs +62 -198
  267. data/stdlib/cgi/0/core.rbs +68 -15
  268. data/stdlib/cgi/0/manifest.yaml +1 -0
  269. data/stdlib/coverage/0/coverage.rbs +50 -11
  270. data/stdlib/csv/0/csv.rbs +90 -119
  271. data/stdlib/csv/0/manifest.yaml +1 -0
  272. data/stdlib/date/0/date.rbs +806 -735
  273. data/stdlib/date/0/date_time.rbs +70 -211
  274. data/stdlib/dbm/0/dbm.rbs +0 -2
  275. data/stdlib/delegate/0/delegator.rbs +184 -0
  276. data/stdlib/delegate/0/kernel.rbs +47 -0
  277. data/stdlib/delegate/0/simple_delegator.rbs +96 -0
  278. data/stdlib/did_you_mean/0/did_you_mean.rbs +3 -8
  279. data/stdlib/digest/0/digest.rbs +48 -35
  280. data/stdlib/erb/0/erb.rbs +15 -39
  281. data/stdlib/etc/0/etc.rbs +174 -54
  282. data/stdlib/fileutils/0/fileutils.rbs +1234 -385
  283. data/stdlib/forwardable/0/forwardable.rbs +4 -4
  284. data/stdlib/io-console/0/io-console.rbs +82 -17
  285. data/stdlib/ipaddr/0/ipaddr.rbs +11 -6
  286. data/stdlib/json/0/json.rbs +434 -151
  287. data/stdlib/kconv/0/kconv.rbs +166 -0
  288. data/stdlib/logger/0/formatter.rbs +0 -2
  289. data/stdlib/logger/0/log_device.rbs +1 -3
  290. data/stdlib/logger/0/logger.rbs +465 -328
  291. data/stdlib/minitest/0/kernel.rbs +2 -2
  292. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +4 -1
  293. data/stdlib/minitest/0/minitest/assertion.rbs +1 -0
  294. data/stdlib/minitest/0/minitest/assertions.rbs +58 -13
  295. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +7 -0
  296. data/stdlib/minitest/0/minitest/bench_spec.rbs +8 -8
  297. data/stdlib/minitest/0/minitest/benchmark.rbs +17 -16
  298. data/stdlib/minitest/0/minitest/compress.rbs +13 -0
  299. data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
  300. data/stdlib/minitest/0/minitest/mock.rbs +9 -5
  301. data/stdlib/minitest/0/minitest/parallel/executor.rbs +4 -0
  302. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +0 -1
  303. data/stdlib/minitest/0/minitest/pride_io.rbs +8 -0
  304. data/stdlib/minitest/0/minitest/pride_lol.rbs +2 -0
  305. data/stdlib/minitest/0/minitest/progress_reporter.rbs +1 -1
  306. data/stdlib/minitest/0/minitest/reportable.rbs +2 -0
  307. data/stdlib/minitest/0/minitest/runnable.rbs +33 -1
  308. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +1 -1
  309. data/stdlib/minitest/0/minitest/spec/dsl.rbs +10 -6
  310. data/stdlib/minitest/0/minitest/spec.rbs +1 -1
  311. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +5 -0
  312. data/stdlib/minitest/0/minitest/summary_reporter.rbs +0 -7
  313. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +7 -7
  314. data/stdlib/minitest/0/minitest/test.rbs +7 -14
  315. data/stdlib/minitest/0/minitest/unexpected_error.rbs +2 -0
  316. data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
  317. data/stdlib/minitest/0/minitest/unit.rbs +1 -2
  318. data/stdlib/minitest/0/minitest.rbs +41 -892
  319. data/stdlib/monitor/0/monitor.rbs +91 -10
  320. data/stdlib/mutex_m/0/mutex_m.rbs +0 -2
  321. data/stdlib/net-http/0/manifest.yaml +1 -1
  322. data/stdlib/net-http/0/net-http.rbs +3858 -964
  323. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  324. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  325. data/stdlib/net-smtp/0/manifest.yaml +2 -0
  326. data/stdlib/net-smtp/0/net-smtp.rbs +55 -0
  327. data/stdlib/nkf/0/nkf.rbs +35 -5
  328. data/stdlib/objspace/0/objspace.rbs +40 -18
  329. data/stdlib/observable/0/observable.rbs +217 -0
  330. data/stdlib/open-uri/0/manifest.yaml +4 -0
  331. data/stdlib/open-uri/0/open-uri.rbs +393 -0
  332. data/stdlib/open3/0/open3.rbs +147 -0
  333. data/stdlib/openssl/0/manifest.yaml +1 -0
  334. data/stdlib/openssl/0/openssl.rbs +681 -316
  335. data/stdlib/optparse/0/optparse.rbs +100 -65
  336. data/stdlib/pathname/0/pathname.rbs +24 -15
  337. data/stdlib/pp/0/manifest.yaml +2 -0
  338. data/stdlib/pp/0/pp.rbs +300 -0
  339. data/stdlib/prettyprint/0/prettyprint.rbs +2 -6
  340. data/stdlib/pstore/0/pstore.rbs +370 -156
  341. data/stdlib/psych/0/core_ext.rbs +12 -0
  342. data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
  343. data/stdlib/psych/0/manifest.yaml +3 -0
  344. data/stdlib/psych/0/psych.rbs +402 -0
  345. data/stdlib/{yaml → psych}/0/store.rbs +2 -2
  346. data/stdlib/pty/0/pty.rbs +63 -11
  347. data/stdlib/rdoc/0/code_object.rbs +51 -0
  348. data/stdlib/rdoc/0/comment.rbs +59 -0
  349. data/stdlib/rdoc/0/context.rbs +153 -0
  350. data/stdlib/rdoc/0/markup.rbs +117 -0
  351. data/stdlib/rdoc/0/parser.rbs +56 -0
  352. data/stdlib/rdoc/0/rdoc.rbs +13 -380
  353. data/stdlib/rdoc/0/ri.rbs +17 -0
  354. data/stdlib/rdoc/0/store.rbs +48 -0
  355. data/stdlib/rdoc/0/top_level.rbs +97 -0
  356. data/stdlib/resolv/0/resolv.rbs +16 -79
  357. data/stdlib/ripper/0/ripper.rbs +1648 -0
  358. data/stdlib/securerandom/0/securerandom.rbs +7 -2
  359. data/stdlib/shellwords/0/shellwords.rbs +11 -12
  360. data/stdlib/singleton/0/singleton.rbs +0 -3
  361. data/stdlib/socket/0/addrinfo.rbs +13 -18
  362. data/stdlib/socket/0/basic_socket.rbs +5 -10
  363. data/stdlib/socket/0/ip_socket.rbs +0 -2
  364. data/stdlib/socket/0/socket.rbs +77 -46
  365. data/stdlib/socket/0/tcp_server.rbs +0 -5
  366. data/stdlib/socket/0/tcp_socket.rbs +36 -3
  367. data/stdlib/socket/0/udp_socket.rbs +4 -5
  368. data/stdlib/socket/0/unix_server.rbs +0 -5
  369. data/stdlib/socket/0/unix_socket.rbs +2 -4
  370. data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +188 -107
  371. data/stdlib/strscan/0/string_scanner.rbs +1269 -425
  372. data/stdlib/tempfile/0/tempfile.rbs +224 -61
  373. data/stdlib/time/0/time.rbs +48 -35
  374. data/stdlib/timeout/0/timeout.rbs +17 -8
  375. data/stdlib/tmpdir/0/tmpdir.rbs +10 -3
  376. data/stdlib/tsort/0/tsort.rbs +0 -4
  377. data/stdlib/uri/0/common.rbs +271 -144
  378. data/stdlib/uri/0/file.rbs +5 -0
  379. data/stdlib/uri/0/ftp.rbs +1 -1
  380. data/stdlib/uri/0/generic.rbs +26 -22
  381. data/stdlib/uri/0/http.rbs +4 -4
  382. data/stdlib/uri/0/ldap.rbs +1 -1
  383. data/stdlib/uri/0/mailto.rbs +84 -0
  384. data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
  385. data/stdlib/yaml/0/manifest.yaml +1 -2
  386. data/stdlib/yaml/0/yaml.rbs +1 -199
  387. data/stdlib/zlib/0/buf_error.rbs +10 -0
  388. data/stdlib/zlib/0/data_error.rbs +10 -0
  389. data/stdlib/zlib/0/deflate.rbs +210 -0
  390. data/stdlib/zlib/0/error.rbs +20 -0
  391. data/stdlib/zlib/0/gzip_file/crc_error.rbs +12 -0
  392. data/stdlib/zlib/0/gzip_file/error.rbs +23 -0
  393. data/stdlib/zlib/0/gzip_file/length_error.rbs +12 -0
  394. data/stdlib/zlib/0/gzip_file/no_footer.rbs +11 -0
  395. data/stdlib/zlib/0/gzip_file.rbs +156 -0
  396. data/stdlib/zlib/0/gzip_reader.rbs +293 -0
  397. data/stdlib/zlib/0/gzip_writer.rbs +166 -0
  398. data/stdlib/zlib/0/inflate.rbs +180 -0
  399. data/stdlib/zlib/0/mem_error.rbs +10 -0
  400. data/stdlib/zlib/0/need_dict.rbs +13 -0
  401. data/stdlib/zlib/0/stream_end.rbs +11 -0
  402. data/stdlib/zlib/0/stream_error.rbs +11 -0
  403. data/stdlib/zlib/0/version_error.rbs +11 -0
  404. data/stdlib/zlib/0/zlib.rbs +1 -3
  405. data/stdlib/zlib/0/zstream.rbs +200 -0
  406. data/templates/include/rbs/constants.h.erb +20 -0
  407. data/templates/include/rbs/ruby_objs.h.erb +10 -0
  408. data/templates/src/constants.c.erb +36 -0
  409. data/templates/src/ruby_objs.c.erb +27 -0
  410. data/templates/template.rb +122 -0
  411. metadata +136 -36
  412. data/Gemfile +0 -33
  413. data/Gemfile.lock +0 -118
  414. data/core/deprecated.rbs +0 -9
  415. data/ext/rbs_extension/constants.c +0 -135
  416. data/ext/rbs_extension/ruby_objs.c +0 -525
  417. data/ext/rbs_extension/ruby_objs.h +0 -43
  418. data/lib/rbs/constant_table.rb +0 -167
  419. data/lib/rbs/parser_compat/lexer_error.rb +0 -6
  420. data/lib/rbs/parser_compat/located_value.rb +0 -7
  421. data/lib/rbs/parser_compat/semantics_error.rb +0 -6
  422. data/lib/rbs/parser_compat/syntax_error.rb +0 -6
  423. data/lib/rbs/test/spy.rb +0 -6
  424. data/lib/rbs/type_name_resolver.rb +0 -67
  425. data/sig/constant_table.rbs +0 -30
  426. data/sig/shims/abstract_syntax_tree.rbs +0 -25
  427. data/sig/shims/pp.rbs +0 -3
  428. data/sig/shims/ripper.rbs +0 -8
  429. data/sig/shims.rbs +0 -69
  430. data/sig/type_name_resolver.rbs +0 -26
  431. data/stdlib/minitest/0/manifest.yaml +0 -2
  432. data/stdlib/prime/0/integer-extension.rbs +0 -41
  433. data/stdlib/prime/0/manifest.yaml +0 -2
  434. data/stdlib/prime/0/prime.rbs +0 -372
@@ -1,7 +1,7 @@
1
1
  # <!-- rdoc-file=lib/optparse.rb -->
2
2
  # ## OptionParser
3
3
  #
4
- # ### New to OptionParser?
4
+ # ### New to `OptionParser`?
5
5
  #
6
6
  # See the [Tutorial](optparse/tutorial.rdoc).
7
7
  #
@@ -21,7 +21,6 @@
21
21
  # 4. Arguments can be automatically converted to a specified class.
22
22
  # 5. Arguments can be restricted to a certain set.
23
23
  #
24
- #
25
24
  # All of these features are demonstrated in the examples below. See
26
25
  # #make_switch for full documentation.
27
26
  #
@@ -106,13 +105,17 @@
106
105
  # OptionParser supports the ability to coerce command line arguments into
107
106
  # objects for us.
108
107
  #
109
- # OptionParser comes with a few ready-to-use kinds of type coercion. They are:
110
- #
111
- # * Date -- Anything accepted by `Date.parse`
112
- # * DateTime -- Anything accepted by `DateTime.parse`
113
- # * Time -- Anything accepted by `Time.httpdate` or `Time.parse`
114
- # * URI -- Anything accepted by `URI.parse`
115
- # * Shellwords -- Anything accepted by `Shellwords.shellwords`
108
+ # OptionParser comes with a few ready-to-use kinds of type coercion. They are:
109
+ #
110
+ # * Date -- Anything accepted by `Date.parse` (need to require
111
+ # `optparse/date`)
112
+ # * DateTime -- Anything accepted by `DateTime.parse` (need to require
113
+ # `optparse/date`)
114
+ # * Time -- Anything accepted by `Time.httpdate` or `Time.parse` (need to
115
+ # require `optparse/time`)
116
+ # * URI -- Anything accepted by `URI.parse` (need to require `optparse/uri`)
117
+ # * Shellwords -- Anything accepted by `Shellwords.shellwords` (need to
118
+ # require `optparse/shellwords`)
116
119
  # * String -- Any non-empty string
117
120
  # * Integer -- Any integer. Will convert octal. (e.g. 124, -3, 040)
118
121
  # * Float -- Any float. (e.g. 10, 3.14, -100E+13)
@@ -125,7 +128,6 @@
125
128
  # * Array -- Strings separated by ',' (e.g. 1,2,3)
126
129
  # * Regexp -- Regular expressions. Also includes options.
127
130
  #
128
- #
129
131
  # We can also add our own coercions, which we will cover below.
130
132
  #
131
133
  # #### Using Built-in Conversions
@@ -400,7 +402,7 @@ class OptionParser
400
402
 
401
403
  # <!--
402
404
  # rdoc-file=lib/optparse.rb
403
- # - getopts(*args)
405
+ # - getopts(*args, symbolize_names: false)
404
406
  # -->
405
407
  # See #getopts.
406
408
  #
@@ -427,6 +429,7 @@ class OptionParser
427
429
  # rdoc-file=lib/optparse.rb
428
430
  # - terminate(arg = nil)
429
431
  # -->
432
+ # See #terminate.
430
433
  #
431
434
  def self.terminate: (?String arg) -> bot
432
435
 
@@ -434,6 +437,9 @@ class OptionParser
434
437
  # rdoc-file=lib/optparse.rb
435
438
  # - top()
436
439
  # -->
440
+ # Returns the global top option list.
441
+ #
442
+ # Do not use directly.
437
443
  #
438
444
  def self.top: () -> OptionParser::List
439
445
 
@@ -450,12 +456,17 @@ class OptionParser
450
456
  #
451
457
  def self.with: (?String banner, ?Integer width, ?String indent) ?{ (instance opts) -> void } -> instance
452
458
 
453
- public
454
-
455
459
  # <!--
456
460
  # rdoc-file=lib/optparse.rb
457
461
  # - abort(mesg = $!)
458
462
  # -->
463
+ # Shows message with the program name then aborts.
464
+ #
465
+ # `mesg`
466
+ # : Message, defaulted to +$!+.
467
+ #
468
+ #
469
+ # See Kernel#abort.
459
470
  #
460
471
  def abort: (?_ToS mesg) -> bot
461
472
 
@@ -468,6 +479,7 @@ class OptionParser
468
479
  #
469
480
  # `t`
470
481
  # : Argument class specifier, any object including Class.
482
+ #
471
483
  # `pat`
472
484
  # : Pattern for argument, defaults to `t` if it responds to match.
473
485
  #
@@ -503,6 +515,7 @@ class OptionParser
503
515
  # rdoc-file=lib/optparse.rb
504
516
  # - candidate(word)
505
517
  # -->
518
+ # Return candidates for `word`.
506
519
  #
507
520
  def candidate: (String word) -> Array[untyped]
508
521
 
@@ -539,12 +552,12 @@ class OptionParser
539
552
  # - define(*params, &block)
540
553
  # -->
541
554
  # Creates an option from the given parameters `params`. See [Parameters for New
542
- # Options](./option_params.rdoc).
555
+ # Options](optparse/option_params.rdoc).
543
556
  #
544
557
  # The block, if given, is the handler for the created option. When the option is
545
558
  # encountered during command-line parsing, the block is called with the argument
546
559
  # given for the option, if any. See [Option
547
- # Handlers](./option_params.rdoc#label-Option+Handlers).
560
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
548
561
  #
549
562
  def define: (*String params) ?{ (*untyped) -> untyped } -> untyped
550
563
  | (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
@@ -556,12 +569,12 @@ class OptionParser
556
569
  # - define_head(*params, &block)
557
570
  # -->
558
571
  # Creates an option from the given parameters `params`. See [Parameters for New
559
- # Options](./option_params.rdoc).
572
+ # Options](optparse/option_params.rdoc).
560
573
  #
561
574
  # The block, if given, is the handler for the created option. When the option is
562
575
  # encountered during command-line parsing, the block is called with the argument
563
576
  # given for the option, if any. See [Option
564
- # Handlers](./option_params.rdoc#label-Option+Handlers).
577
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
565
578
  #
566
579
  def define_head: (*String params) ?{ (*untyped) -> untyped } -> untyped
567
580
  | (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
@@ -573,12 +586,12 @@ class OptionParser
573
586
  # - define_tail(*params, &block)
574
587
  # -->
575
588
  # Creates an option from the given parameters `params`. See [Parameters for New
576
- # Options](./option_params.rdoc).
589
+ # Options](optparse/option_params.rdoc).
577
590
  #
578
591
  # The block, if given, is the handler for the created option. When the option is
579
592
  # encountered during command-line parsing, the block is called with the argument
580
593
  # given for the option, if any. See [Option
581
- # Handlers](./option_params.rdoc#label-Option+Handlers).
594
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
582
595
  #
583
596
  def define_tail: (*String params) ?{ (*untyped) -> untyped } -> untyped
584
597
  | (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
@@ -587,7 +600,7 @@ class OptionParser
587
600
 
588
601
  # <!--
589
602
  # rdoc-file=lib/optparse.rb
590
- # - environment(env = File.basename($0, '.*'))
603
+ # - environment(env = File.basename($0, '.*'), **keywords)
591
604
  # -->
592
605
  # Parses environment variable `env` or its uppercase with splitting like a
593
606
  # shell.
@@ -598,7 +611,7 @@ class OptionParser
598
611
 
599
612
  # <!--
600
613
  # rdoc-file=lib/optparse.rb
601
- # - getopts(*args)
614
+ # - getopts(*args, symbolize_names: false, **keywords)
602
615
  # -->
603
616
  # Wrapper method for getopts.rb.
604
617
  #
@@ -609,6 +622,16 @@ class OptionParser
609
622
  # # params["bar"] = "x" # --bar x
610
623
  # # params["zot"] = "z" # --zot Z
611
624
  #
625
+ # Option `symbolize_names` (boolean) specifies whether returned Hash keys should
626
+ # be Symbols; defaults to `false` (use Strings).
627
+ #
628
+ # params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option", symbolize_names: true)
629
+ # # params[:a] = true # -a
630
+ # # params[:b] = "1" # -b1
631
+ # # params[:foo] = "1" # --foo
632
+ # # params[:bar] = "x" # --bar x
633
+ # # params[:zot] = "z" # --zot Z
634
+ #
612
635
  def getopts: (*String options) -> Hash[String, untyped]
613
636
  | (Array[String] args, *String options) -> Hash[String, untyped]
614
637
 
@@ -624,12 +647,13 @@ class OptionParser
624
647
  # rdoc-file=lib/optparse.rb
625
648
  # - inc(*args)
626
649
  # -->
650
+ # See self.inc
627
651
  #
628
652
  def inc: (*untyped args) -> untyped
629
653
 
630
654
  # <!--
631
655
  # rdoc-file=lib/optparse.rb
632
- # - load(filename = nil)
656
+ # - load(filename = nil, **keywords)
633
657
  # -->
634
658
  # Loads options from file names as `filename`. Does nothing when the file is not
635
659
  # present. Returns whether successfully loaded.
@@ -638,6 +662,9 @@ class OptionParser
638
662
  # ~/.options, then the basename with '.options' suffix under XDG and Haiku
639
663
  # standard places.
640
664
  #
665
+ # The optional `into` keyword argument works exactly like that accepted in
666
+ # method #parse.
667
+ #
641
668
  def load: (?String filename) -> bool
642
669
 
643
670
  # <!--
@@ -645,12 +672,12 @@ class OptionParser
645
672
  # - make_switch(params, block = nil)
646
673
  # -->
647
674
  # Creates an option from the given parameters `params`. See [Parameters for New
648
- # Options](./option_params.rdoc).
675
+ # Options](optparse/option_params.rdoc).
649
676
  #
650
677
  # The block, if given, is the handler for the created option. When the option is
651
678
  # encountered during command-line parsing, the block is called with the argument
652
679
  # given for the option, if any. See [Option
653
- # Handlers](./option_params.rdoc#label-Option+Handlers).
680
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
654
681
  #
655
682
  def make_switch: (Array[untyped] opts, ?Proc block) -> [ untyped, untyped, untyped, untyped, untyped ]
656
683
 
@@ -660,6 +687,9 @@ class OptionParser
660
687
  # -->
661
688
  # Pushes a new List.
662
689
  #
690
+ # If a block is given, yields `self` and returns the result of the block,
691
+ # otherwise returns `self`.
692
+ #
663
693
  def new: () -> self
664
694
  | [T] () { (self) -> T } -> T
665
695
 
@@ -668,12 +698,12 @@ class OptionParser
668
698
  # - on(*params, &block)
669
699
  # -->
670
700
  # Creates an option from the given parameters `params`. See [Parameters for New
671
- # Options](./option_params.rdoc).
701
+ # Options](optparse/option_params.rdoc).
672
702
  #
673
703
  # The block, if given, is the handler for the created option. When the option is
674
704
  # encountered during command-line parsing, the block is called with the argument
675
705
  # given for the option, if any. See [Option
676
- # Handlers](./option_params.rdoc#label-Option+Handlers).
706
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
677
707
  #
678
708
  def on: (*String params) ?{ (*untyped) -> untyped } -> self
679
709
  | (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
@@ -687,12 +717,12 @@ class OptionParser
687
717
  # - on_head(*params, &block)
688
718
  # -->
689
719
  # Creates an option from the given parameters `params`. See [Parameters for New
690
- # Options](./option_params.rdoc).
720
+ # Options](optparse/option_params.rdoc).
691
721
  #
692
722
  # The block, if given, is the handler for the created option. When the option is
693
723
  # encountered during command-line parsing, the block is called with the argument
694
724
  # given for the option, if any. See [Option
695
- # Handlers](./option_params.rdoc#label-Option+Handlers).
725
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
696
726
  #
697
727
  # The new option is added at the head of the summary.
698
728
  #
@@ -708,12 +738,12 @@ class OptionParser
708
738
  # - on_tail(*params, &block)
709
739
  # -->
710
740
  # Creates an option from the given parameters `params`. See [Parameters for New
711
- # Options](./option_params.rdoc).
741
+ # Options](optparse/option_params.rdoc).
712
742
  #
713
743
  # The block, if given, is the handler for the created option. When the option is
714
744
  # encountered during command-line parsing, the block is called with the argument
715
745
  # given for the option, if any. See [Option
716
- # Handlers](./option_params.rdoc#label-Option+Handlers).
746
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
717
747
  #
718
748
  # The new option is added at the tail of the summary.
719
749
  #
@@ -726,7 +756,7 @@ class OptionParser
726
756
 
727
757
  # <!--
728
758
  # rdoc-file=lib/optparse.rb
729
- # - order(*argv, into: nil, &nonopt)
759
+ # - order(*argv, **keywords, &nonopt)
730
760
  # -->
731
761
  # Parses command line arguments `argv` in order. When a block is given, each
732
762
  # non-option argument is yielded. When optional `into` keyword argument is
@@ -740,7 +770,7 @@ class OptionParser
740
770
 
741
771
  # <!--
742
772
  # rdoc-file=lib/optparse.rb
743
- # - order!(argv = default_argv, into: nil, &nonopt)
773
+ # - order!(argv = default_argv, into: nil, **keywords, &nonopt)
744
774
  # -->
745
775
  # Same as #order, but removes switches destructively. Non-option arguments
746
776
  # remain in `argv`.
@@ -749,7 +779,7 @@ class OptionParser
749
779
 
750
780
  # <!--
751
781
  # rdoc-file=lib/optparse.rb
752
- # - parse(*argv, into: nil)
782
+ # - parse(*argv, **keywords)
753
783
  # -->
754
784
  # Parses command line arguments `argv` in order when environment variable
755
785
  # POSIXLY_CORRECT is set, and in permutation mode otherwise. When optional
@@ -761,7 +791,7 @@ class OptionParser
761
791
 
762
792
  # <!--
763
793
  # rdoc-file=lib/optparse.rb
764
- # - parse!(argv = default_argv, into: nil)
794
+ # - parse!(argv = default_argv, **keywords)
765
795
  # -->
766
796
  # Same as #parse, but removes switches destructively. Non-option arguments
767
797
  # remain in `argv`.
@@ -770,7 +800,7 @@ class OptionParser
770
800
 
771
801
  # <!--
772
802
  # rdoc-file=lib/optparse.rb
773
- # - permute(*argv, into: nil)
803
+ # - permute(*argv, **keywords)
774
804
  # -->
775
805
  # Parses command line arguments `argv` in permutation mode and returns list of
776
806
  # non-option arguments. When optional `into` keyword argument is provided, the
@@ -782,7 +812,7 @@ class OptionParser
782
812
 
783
813
  # <!--
784
814
  # rdoc-file=lib/optparse.rb
785
- # - permute!(argv = default_argv, into: nil)
815
+ # - permute!(argv = default_argv, **keywords)
786
816
  # -->
787
817
  # Same as #permute, but removes switches destructively. Non-option arguments
788
818
  # remain in `argv`.
@@ -801,11 +831,11 @@ class OptionParser
801
831
  # -->
802
832
  # Directs to reject specified class argument.
803
833
  #
804
- # `t`
834
+ # `type`
805
835
  # : Argument class specifier, any object including Class.
806
836
  #
807
837
  #
808
- # reject(t)
838
+ # reject(type)
809
839
  #
810
840
  def reject: (Class t) -> void
811
841
 
@@ -869,10 +899,13 @@ class OptionParser
869
899
  #
870
900
  # `to`
871
901
  # : Output destination, which must have method <<. Defaults to [].
902
+ #
872
903
  # `width`
873
904
  # : Width of left side, defaults to @summary_width.
905
+ #
874
906
  # `max`
875
907
  # : Maximum length allowed for left side, defaults to `width` - 1.
908
+ #
876
909
  # `indent`
877
910
  # : Indentation, defaults to @summary_indent.
878
911
  #
@@ -937,6 +970,13 @@ class OptionParser
937
970
  # rdoc-file=lib/optparse.rb
938
971
  # - warn(mesg = $!)
939
972
  # -->
973
+ # Shows warning message with the program name
974
+ #
975
+ # `mesg`
976
+ # : Message, defaulted to +$!+.
977
+ #
978
+ #
979
+ # See Kernel#warn.
940
980
  #
941
981
  def warn: (?_ToS mesg) -> void
942
982
 
@@ -968,8 +1008,10 @@ class OptionParser
968
1008
  #
969
1009
  # `banner`
970
1010
  # : Banner message.
1011
+ #
971
1012
  # `width`
972
1013
  # : Summary width.
1014
+ #
973
1015
  # `indent`
974
1016
  # : Summary indent.
975
1017
  #
@@ -1049,6 +1091,9 @@ OptionParser::RequiredArgument: Array[untyped]
1049
1091
 
1050
1092
  OptionParser::SPLAT_PROC: Proc
1051
1093
 
1094
+ # <!-- rdoc-file=lib/optparse.rb -->
1095
+ # The version string
1096
+ #
1052
1097
  OptionParser::Version: String
1053
1098
 
1054
1099
  # <!-- rdoc-file=lib/optparse.rb -->
@@ -1092,11 +1137,9 @@ module OptionParser::Arguable
1092
1137
  #
1093
1138
  def self.extend_object: (untyped obj) -> untyped
1094
1139
 
1095
- public
1096
-
1097
1140
  # <!--
1098
1141
  # rdoc-file=lib/optparse.rb
1099
- # - getopts(*args)
1142
+ # - getopts(*args, symbolize_names: false, **keywords)
1100
1143
  # -->
1101
1144
  # Substitution of getopts is possible as follows. Also see OptionParser#getopts.
1102
1145
  #
@@ -1135,7 +1178,7 @@ module OptionParser::Arguable
1135
1178
 
1136
1179
  # <!--
1137
1180
  # rdoc-file=lib/optparse.rb
1138
- # - order!(&blk)
1181
+ # - order!(**keywords, &blk)
1139
1182
  # -->
1140
1183
  # Parses `self` destructively in order and returns `self` containing the rest
1141
1184
  # arguments left unparsed.
@@ -1144,7 +1187,7 @@ module OptionParser::Arguable
1144
1187
 
1145
1188
  # <!--
1146
1189
  # rdoc-file=lib/optparse.rb
1147
- # - parse!()
1190
+ # - parse!(**keywords)
1148
1191
  # -->
1149
1192
  # Parses `self` destructively and returns `self` containing the rest arguments
1150
1193
  # left unparsed.
@@ -1153,7 +1196,7 @@ module OptionParser::Arguable
1153
1196
 
1154
1197
  # <!--
1155
1198
  # rdoc-file=lib/optparse.rb
1156
- # - permute!()
1199
+ # - permute!(**keywords)
1157
1200
  # -->
1158
1201
  # Parses `self` destructively in permutation mode and returns `self` containing
1159
1202
  # the rest arguments left unparsed.
@@ -1167,8 +1210,6 @@ end
1167
1210
  class OptionParser::CompletingHash < Hash[untyped, untyped]
1168
1211
  include OptionParser::Completion
1169
1212
 
1170
- public
1171
-
1172
1213
  # <!--
1173
1214
  # rdoc-file=lib/optparse.rb
1174
1215
  # - match(key)
@@ -1197,8 +1238,6 @@ module OptionParser::Completion
1197
1238
  #
1198
1239
  def self.regexp: (untyped key, untyped icase) -> untyped
1199
1240
 
1200
- public
1201
-
1202
1241
  # <!--
1203
1242
  # rdoc-file=lib/optparse.rb
1204
1243
  # - candidate(key, icase = false, pat = nil)
@@ -1243,8 +1282,6 @@ OptionParser::InvalidOption::Reason: String
1243
1282
  # and converter pair. Also provides summary feature.
1244
1283
  #
1245
1284
  class OptionParser::List
1246
- public
1247
-
1248
1285
  # <!--
1249
1286
  # rdoc-file=lib/optparse.rb
1250
1287
  # - accept(t, pat = /.*/m, &block)
@@ -1264,10 +1301,13 @@ class OptionParser::List
1264
1301
  #
1265
1302
  # `switch`
1266
1303
  # : OptionParser::Switch instance to be inserted.
1304
+ #
1267
1305
  # `short_opts`
1268
1306
  # : List of short style options.
1307
+ #
1269
1308
  # `long_opts`
1270
1309
  # : List of long style options.
1310
+ #
1271
1311
  # `nolong_opts`
1272
1312
  # : List of long style options with "no-" prefix.
1273
1313
  #
@@ -1327,10 +1367,13 @@ class OptionParser::List
1327
1367
  #
1328
1368
  # `switch`
1329
1369
  # : OptionParser::Switch instance to be inserted.
1370
+ #
1330
1371
  # `short_opts`
1331
1372
  # : List of short style options.
1373
+ #
1332
1374
  # `long_opts`
1333
1375
  # : List of long style options.
1376
+ #
1334
1377
  # `nolong_opts`
1335
1378
  # : List of long style options with "no-" prefix.
1336
1379
  #
@@ -1433,8 +1476,6 @@ class OptionParser::ParseError < RuntimeError
1433
1476
  #
1434
1477
  def self.filter_backtrace: (untyped array) -> untyped
1435
1478
 
1436
- public
1437
-
1438
1479
  def additional: () -> untyped
1439
1480
 
1440
1481
  def additional=: (untyped) -> untyped
@@ -1536,8 +1577,6 @@ class OptionParser::Switch
1536
1577
  #
1537
1578
  def self.pattern: () -> untyped
1538
1579
 
1539
- public
1540
-
1541
1580
  def add_banner: (untyped to) -> untyped
1542
1581
 
1543
1582
  def arg: () -> untyped
@@ -1567,13 +1606,17 @@ class OptionParser::Switch
1567
1606
  #
1568
1607
  # `sdone`
1569
1608
  # : Already summarized short style options keyed hash.
1609
+ #
1570
1610
  # `ldone`
1571
1611
  # : Already summarized long style options keyed hash.
1612
+ #
1572
1613
  # `width`
1573
1614
  # : Width of left side (option part). In other words, the right side
1574
1615
  # (description part) starts after `width` columns.
1616
+ #
1575
1617
  # `max`
1576
1618
  # : Maximum width of left side -> the options are filled within `max` columns.
1619
+ #
1577
1620
  # `indent`
1578
1621
  # : Prefix string indents all summarized lines.
1579
1622
  #
@@ -1633,8 +1676,6 @@ class OptionParser::Switch::NoArgument < OptionParser::Switch
1633
1676
  #
1634
1677
  def self.pattern: () -> untyped
1635
1678
 
1636
- public
1637
-
1638
1679
  # <!--
1639
1680
  # rdoc-file=lib/optparse.rb
1640
1681
  # - parse(arg, argv) { |NeedlessArgument, arg| ... }
@@ -1648,8 +1689,6 @@ end
1648
1689
  # Switch that can omit argument.
1649
1690
  #
1650
1691
  class OptionParser::Switch::OptionalArgument < OptionParser::Switch
1651
- public
1652
-
1653
1692
  # <!--
1654
1693
  # rdoc-file=lib/optparse.rb
1655
1694
  # - parse(arg, argv, &error)
@@ -1660,16 +1699,14 @@ class OptionParser::Switch::OptionalArgument < OptionParser::Switch
1660
1699
  end
1661
1700
 
1662
1701
  # <!-- rdoc-file=lib/optparse.rb -->
1663
- # Switch that takes an argument, which does not begin with '-'.
1702
+ # Switch that takes an argument, which does not begin with '-' or is '-'.
1664
1703
  #
1665
1704
  class OptionParser::Switch::PlacedArgument < OptionParser::Switch
1666
- public
1667
-
1668
1705
  # <!--
1669
1706
  # rdoc-file=lib/optparse.rb
1670
1707
  # - parse(arg, argv, &error)
1671
1708
  # -->
1672
- # Returns nil if argument is not present or begins with '-'.
1709
+ # Returns nil if argument is not present or begins with '-' and is not '-'.
1673
1710
  #
1674
1711
  def parse: (untyped arg, untyped argv) { (*untyped) -> untyped } -> untyped
1675
1712
  end
@@ -1678,11 +1715,9 @@ end
1678
1715
  # Switch that takes an argument.
1679
1716
  #
1680
1717
  class OptionParser::Switch::RequiredArgument < OptionParser::Switch
1681
- public
1682
-
1683
1718
  # <!--
1684
1719
  # rdoc-file=lib/optparse.rb
1685
- # - parse(arg, argv)
1720
+ # - parse(arg, argv, &_)
1686
1721
  # -->
1687
1722
  # Raises an exception if argument is not present.
1688
1723
  #
@@ -82,7 +82,6 @@
82
82
  # * #each_child
83
83
  # * #mountpoint?
84
84
  #
85
- #
86
85
  # ### File status predicate methods
87
86
  #
88
87
  # These methods are a facade for FileTest:
@@ -111,7 +110,6 @@
111
110
  # * #writable_real?
112
111
  # * #zero?
113
112
  #
114
- #
115
113
  # ### File property and manipulation methods
116
114
  #
117
115
  # These methods are a facade for File:
@@ -135,13 +133,13 @@
135
133
  # * #make_symlink(old)
136
134
  # * #truncate(length)
137
135
  # * #utime(atime, mtime)
136
+ # * #lutime(atime, mtime)
138
137
  # * #basename(*args)
139
138
  # * #dirname
140
139
  # * #extname
141
140
  # * #expand_path(*args)
142
141
  # * #split
143
142
  #
144
- #
145
143
  # ### Directory methods
146
144
  #
147
145
  # These methods are a facade for Dir:
@@ -153,7 +151,6 @@
153
151
  # * #mkdir(*args)
154
152
  # * #opendir(*args)
155
153
  #
156
- #
157
154
  # ### IO
158
155
  #
159
156
  # These methods are a facade for IO:
@@ -165,7 +162,6 @@
165
162
  # * #write(*args)
166
163
  # * #binwrite(*args)
167
164
  #
168
- #
169
165
  # ### Utilities
170
166
  #
171
167
  # These methods are a mixture of Find, FileUtils, and others:
@@ -174,7 +170,6 @@
174
170
  # * #rmtree
175
171
  # * #unlink / #delete
176
172
  #
177
- #
178
173
  # ## Method documentation
179
174
  #
180
175
  # As the above section shows, most of the methods in Pathname are facades. The
@@ -224,13 +219,13 @@ class Pathname
224
219
  #
225
220
  def self.pwd: () -> Pathname
226
221
 
227
- public
228
-
229
222
  # <!--
230
223
  # rdoc-file=ext/pathname/lib/pathname.rb
231
224
  # - +(other)
232
225
  # -->
233
- # Appends a pathname fragment to `self` to produce a new Pathname object.
226
+ # Appends a pathname fragment to `self` to produce a new Pathname object. Since
227
+ # `other` is considered as a path relative to `self`, if `other` is an absolute
228
+ # path, the new Pathname object is created from just `other`.
234
229
  #
235
230
  # p1 = Pathname.new("/usr") # Pathname:/usr
236
231
  # p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby
@@ -808,7 +803,9 @@ class Pathname
808
803
  # rdoc-file=ext/pathname/lib/pathname.rb
809
804
  # - join(*args)
810
805
  # -->
811
- # Joins the given pathnames onto `self` to create a new Pathname object.
806
+ # Joins the given pathnames onto `self` to create a new Pathname object. This is
807
+ # effectively the same as using Pathname#+ to append `self` and all arguments
808
+ # sequentially.
812
809
  #
813
810
  # path0 = Pathname.new("/usr") # Pathname:/usr
814
811
  # path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
@@ -847,6 +844,18 @@ class Pathname
847
844
  #
848
845
  def lstat: () -> ::File::Stat
849
846
 
847
+ # <!--
848
+ # rdoc-file=ext/pathname/pathname.c
849
+ # - lutime(p1, p2)
850
+ # -->
851
+ # Update the access and modification times of the file.
852
+ #
853
+ # Same as Pathname#utime, but does not follow symbolic links.
854
+ #
855
+ # See File.lutime.
856
+ #
857
+ def lutime: (Time | Numeric atime, Time | Numeric mtime) -> Integer
858
+
850
859
  # <!--
851
860
  # rdoc-file=ext/pathname/pathname.c
852
861
  # - pathname.make_link(old)
@@ -886,7 +895,7 @@ class Pathname
886
895
  #
887
896
  # See FileUtils.mkpath and FileUtils.mkdir_p
888
897
  #
889
- def mkpath: () -> nil
898
+ def mkpath: () -> self
890
899
 
891
900
  # <!--
892
901
  # rdoc-file=ext/pathname/lib/pathname.rb
@@ -1091,13 +1100,13 @@ class Pathname
1091
1100
 
1092
1101
  # <!--
1093
1102
  # rdoc-file=ext/pathname/lib/pathname.rb
1094
- # - rmtree()
1103
+ # - rmtree(noop: nil, verbose: nil, secure: nil)
1095
1104
  # -->
1096
1105
  # Recursively deletes a directory, including all directories beneath it.
1097
1106
  #
1098
- # See FileUtils.rm_r
1107
+ # See FileUtils.rm_rf
1099
1108
  #
1100
- def rmtree: () -> void
1109
+ def rmtree: () -> self
1101
1110
 
1102
1111
  # <!--
1103
1112
  # rdoc-file=ext/pathname/lib/pathname.rb
@@ -1393,5 +1402,5 @@ module Kernel
1393
1402
  #
1394
1403
  # See also Pathname::new for more information.
1395
1404
  #
1396
- def self?.Pathname: (String | Pathname) -> Pathname
1405
+ def self?.Pathname: (string | Pathname) -> Pathname
1397
1406
  end
@@ -0,0 +1,2 @@
1
+ dependencies:
2
+ - name: prettyprint