rbs 3.0.0.dev.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +2 -1
  3. data/.github/workflows/ruby.yml +4 -0
  4. data/CHANGELOG.md +67 -0
  5. data/Gemfile.lock +11 -11
  6. data/Rakefile +2 -2
  7. data/Steepfile +1 -0
  8. data/core/array.rbs +573 -423
  9. data/core/basic_object.rbs +11 -39
  10. data/core/binding.rbs +1 -1
  11. data/core/builtin.rbs +8 -0
  12. data/core/class.rbs +37 -0
  13. data/core/comparable.rbs +7 -18
  14. data/core/complex.rbs +2 -2
  15. data/core/data.rbs +419 -0
  16. data/core/dir.rbs +52 -104
  17. data/core/encoding.rbs +22 -181
  18. data/core/enumerable.rbs +212 -175
  19. data/core/enumerator/product.rbs +94 -0
  20. data/core/enumerator.rbs +57 -8
  21. data/core/errors.rbs +8 -2
  22. data/core/exception.rbs +41 -0
  23. data/core/fiber.rbs +95 -12
  24. data/core/file.rbs +840 -275
  25. data/core/file_test.rbs +34 -19
  26. data/core/float.rbs +40 -96
  27. data/core/gc.rbs +15 -3
  28. data/core/hash.rbs +113 -175
  29. data/core/integer.rbs +85 -145
  30. data/core/io/buffer.rbs +187 -60
  31. data/core/io/wait.rbs +28 -16
  32. data/core/io.rbs +1859 -1389
  33. data/core/kernel.rbs +525 -961
  34. data/core/match_data.rbs +306 -142
  35. data/core/math.rbs +506 -234
  36. data/core/method.rbs +0 -24
  37. data/core/module.rbs +110 -17
  38. data/core/nil_class.rbs +2 -0
  39. data/core/numeric.rbs +76 -144
  40. data/core/object.rbs +88 -212
  41. data/core/proc.rbs +17 -5
  42. data/core/process.rbs +22 -5
  43. data/core/ractor.rbs +1 -1
  44. data/core/random.rbs +20 -3
  45. data/core/range.rbs +91 -89
  46. data/core/rational.rbs +2 -3
  47. data/core/rbs/unnamed/argf.rbs +177 -120
  48. data/core/rbs/unnamed/env_class.rbs +89 -163
  49. data/core/rbs/unnamed/random.rbs +36 -12
  50. data/core/refinement.rbs +8 -0
  51. data/core/regexp.rbs +462 -272
  52. data/core/ruby_vm.rbs +210 -0
  53. data/{stdlib/set/0 → core}/set.rbs +43 -47
  54. data/core/string.rbs +1403 -1332
  55. data/core/string_io.rbs +191 -107
  56. data/core/struct.rbs +67 -63
  57. data/core/symbol.rbs +187 -201
  58. data/core/thread.rbs +40 -35
  59. data/core/time.rbs +902 -826
  60. data/core/trace_point.rbs +55 -6
  61. data/core/unbound_method.rbs +48 -24
  62. data/docs/collection.md +4 -0
  63. data/docs/syntax.md +55 -0
  64. data/ext/rbs_extension/parser.c +5 -6
  65. data/lib/rbs/cli.rb +11 -1
  66. data/lib/rbs/collection/cleaner.rb +8 -1
  67. data/lib/rbs/collection/config/lockfile.rb +3 -1
  68. data/lib/rbs/collection/config/lockfile_generator.rb +16 -14
  69. data/lib/rbs/collection/config.rb +1 -1
  70. data/lib/rbs/collection/sources/git.rb +9 -2
  71. data/lib/rbs/collection/sources/local.rb +79 -0
  72. data/lib/rbs/collection/sources.rb +8 -1
  73. data/lib/rbs/environment.rb +11 -27
  74. data/lib/rbs/environment_loader.rb +3 -2
  75. data/lib/rbs/errors.rb +18 -0
  76. data/lib/rbs/locator.rb +26 -7
  77. data/lib/rbs/sorter.rb +2 -2
  78. data/lib/rbs/version.rb +1 -1
  79. data/sig/collection/sources.rbs +32 -3
  80. data/sig/environment.rbs +5 -8
  81. data/sig/locator.rbs +14 -2
  82. data/sig/shims/{abstract_syntax_tree.rbs → _abstract_syntax_tree.rbs} +0 -0
  83. data/stdlib/bigdecimal/0/big_decimal.rbs +16 -13
  84. data/stdlib/cgi/0/core.rbs +16 -0
  85. data/stdlib/coverage/0/coverage.rbs +50 -8
  86. data/stdlib/csv/0/csv.rbs +1 -1
  87. data/stdlib/date/0/date.rbs +856 -726
  88. data/stdlib/date/0/date_time.rbs +83 -210
  89. data/stdlib/erb/0/erb.rbs +13 -36
  90. data/stdlib/etc/0/etc.rbs +127 -20
  91. data/stdlib/fileutils/0/fileutils.rbs +1290 -381
  92. data/stdlib/logger/0/logger.rbs +466 -316
  93. data/stdlib/net-http/0/net-http.rbs +2211 -534
  94. data/stdlib/nkf/0/nkf.rbs +5 -5
  95. data/stdlib/objspace/0/objspace.rbs +31 -14
  96. data/stdlib/openssl/0/openssl.rbs +11 -7
  97. data/stdlib/optparse/0/optparse.rbs +20 -17
  98. data/stdlib/pathname/0/pathname.rbs +21 -4
  99. data/stdlib/pstore/0/pstore.rbs +378 -154
  100. data/stdlib/pty/0/pty.rbs +24 -8
  101. data/stdlib/ripper/0/ripper.rbs +1650 -0
  102. data/stdlib/socket/0/addrinfo.rbs +9 -15
  103. data/stdlib/socket/0/socket.rbs +36 -3
  104. data/stdlib/strscan/0/string_scanner.rbs +7 -5
  105. data/stdlib/tempfile/0/tempfile.rbs +104 -44
  106. data/stdlib/time/0/time.rbs +2 -2
  107. data/stdlib/uri/0/file.rbs +5 -0
  108. data/stdlib/uri/0/generic.rbs +2 -2
  109. data/stdlib/yaml/0/yaml.rbs +2 -2
  110. data/stdlib/zlib/0/zlib.rbs +1 -1
  111. metadata +10 -8
  112. data/core/deprecated.rbs +0 -9
  113. data/sig/shims/ripper.rbs +0 -8
data/stdlib/pty/0/pty.rbs CHANGED
@@ -76,10 +76,10 @@ module PTY
76
76
 
77
77
  # <!--
78
78
  # rdoc-file=ext/pty/pty.c
79
- # - PTY.spawn(command_line) { |r, w, pid| ... }
80
- # - PTY.spawn(command_line) => [r, w, pid]
81
- # - PTY.spawn(command, arguments, ...) { |r, w, pid| ... }
82
- # - PTY.spawn(command, arguments, ...) => [r, w, pid]
79
+ # - PTY.spawn([env,] command_line) { |r, w, pid| ... }
80
+ # - PTY.spawn([env,] command_line) => [r, w, pid]
81
+ # - PTY.spawn([env,] command, arguments, ...) { |r, w, pid| ... }
82
+ # - PTY.spawn([env,] command, arguments, ...) => [r, w, pid]
83
83
  # -->
84
84
  # Spawns the specified command on a newly allocated pty. You can also use the
85
85
  # alias ::getpty.
@@ -87,6 +87,14 @@ module PTY
87
87
  # The command's controlling tty is set to the slave device of the pty and its
88
88
  # standard input/output/error is redirected to the slave device.
89
89
  #
90
+ # `env` is an optional hash that provides additional environment variables to
91
+ # the spawned pty.
92
+ #
93
+ # # sets FOO to "bar"
94
+ # PTY.spawn({"FOO"=>"bar"}, "printenv", "FOO") { |r,w,pid| p r.read } #=> "bar\r\n"
95
+ # # unsets FOO
96
+ # PTY.spawn({"FOO"=>nil}, "printenv", "FOO") { |r,w,pid| p r.read } #=> ""
97
+ #
90
98
  # `command` and `command_line` are the full commands to run, given a String. Any
91
99
  # additional `arguments` will be passed to the command.
92
100
  #
@@ -152,10 +160,10 @@ module PTY
152
160
 
153
161
  # <!--
154
162
  # rdoc-file=ext/pty/pty.c
155
- # - PTY.spawn(command_line) { |r, w, pid| ... }
156
- # - PTY.spawn(command_line) => [r, w, pid]
157
- # - PTY.spawn(command, arguments, ...) { |r, w, pid| ... }
158
- # - PTY.spawn(command, arguments, ...) => [r, w, pid]
163
+ # - PTY.spawn([env,] command_line) { |r, w, pid| ... }
164
+ # - PTY.spawn([env,] command_line) => [r, w, pid]
165
+ # - PTY.spawn([env,] command, arguments, ...) { |r, w, pid| ... }
166
+ # - PTY.spawn([env,] command, arguments, ...) => [r, w, pid]
159
167
  # -->
160
168
  # Spawns the specified command on a newly allocated pty. You can also use the
161
169
  # alias ::getpty.
@@ -163,6 +171,14 @@ module PTY
163
171
  # The command's controlling tty is set to the slave device of the pty and its
164
172
  # standard input/output/error is redirected to the slave device.
165
173
  #
174
+ # `env` is an optional hash that provides additional environment variables to
175
+ # the spawned pty.
176
+ #
177
+ # # sets FOO to "bar"
178
+ # PTY.spawn({"FOO"=>"bar"}, "printenv", "FOO") { |r,w,pid| p r.read } #=> "bar\r\n"
179
+ # # unsets FOO
180
+ # PTY.spawn({"FOO"=>nil}, "printenv", "FOO") { |r,w,pid| p r.read } #=> ""
181
+ #
166
182
  # `command` and `command_line` are the full commands to run, given a String. Any
167
183
  # additional `arguments` will be passed to the command.
168
184
  #