rbs 3.1.3 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +0 -6
- data/CHANGELOG.md +82 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +12 -21
- data/README.md +1 -1
- data/Rakefile +45 -1
- data/Steepfile +3 -3
- data/core/array.rbs +0 -8
- data/core/binding.rbs +7 -69
- data/core/builtin.rbs +33 -8
- data/core/constants.rbs +13 -5
- data/core/dir.rbs +25 -25
- data/core/errno.rbs +474 -590
- data/core/exception.rbs +1 -1
- data/core/global_variables.rbs +27 -27
- data/core/io.rbs +163 -172
- data/core/kernel.rbs +58 -38
- data/core/module.rbs +34 -32
- data/core/object.rbs +3 -7
- data/core/string_io.rbs +9 -0
- data/core/thread.rbs +25 -1
- data/core/time.rbs +3 -3
- data/core/warning.rbs +3 -1
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/rbs_by_example.md +16 -35
- data/docs/repo.md +1 -1
- data/docs/sigs.md +7 -7
- data/docs/stdlib.md +2 -3
- data/docs/syntax.md +40 -40
- data/lib/rbs/cli.rb +15 -4
- data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
- data/lib/rbs/collection/installer.rb +5 -2
- data/lib/rbs/collection/sources/stdlib.rb +5 -1
- data/lib/rbs/errors.rb +8 -1
- data/lib/rbs/file_finder.rb +1 -1
- data/lib/rbs/prototype/rb.rb +64 -6
- data/lib/rbs/prototype/rbi.rb +2 -6
- data/lib/rbs/prototype/runtime.rb +29 -8
- data/lib/rbs/subtractor.rb +17 -0
- data/lib/rbs/type_name.rb +4 -4
- data/lib/rbs/version.rb +1 -1
- data/rbs.gemspec +1 -1
- data/schema/decls.json +1 -1
- data/sig/errors.rbs +54 -0
- data/sig/parser.rbs +2 -2
- data/sig/prototype/rb.rbs +9 -1
- data/sig/subtractor.rbs +4 -0
- data/stdlib/logger/0/logger.rbs +1 -1
- data/stdlib/observable/0/observable.rbs +219 -0
- data/stdlib/uri/0/common.rbs +24 -0
- data/stdlib/zlib/0/buf_error.rbs +79 -0
- data/stdlib/zlib/0/data_error.rbs +79 -0
- data/stdlib/zlib/0/deflate.rbs +276 -0
- data/stdlib/zlib/0/error.rbs +89 -0
- data/stdlib/zlib/0/gzip_file/crc_error.rbs +115 -0
- data/stdlib/zlib/0/gzip_file/error.rbs +128 -0
- data/stdlib/zlib/0/gzip_file/length_error.rbs +115 -0
- data/stdlib/zlib/0/gzip_file/no_footer.rbs +114 -0
- data/stdlib/zlib/0/gzip_file.rbs +228 -0
- data/stdlib/zlib/0/gzip_reader.rbs +362 -0
- data/stdlib/zlib/0/gzip_writer.rbs +237 -0
- data/stdlib/zlib/0/inflate.rbs +249 -0
- data/stdlib/zlib/0/mem_error.rbs +79 -0
- data/stdlib/zlib/0/need_dict.rbs +82 -0
- data/stdlib/zlib/0/stream_end.rbs +80 -0
- data/stdlib/zlib/0/stream_error.rbs +80 -0
- data/stdlib/zlib/0/version_error.rbs +80 -0
- data/stdlib/zlib/0/zstream.rbs +270 -0
- metadata +22 -6
- data/stdlib/prime/0/integer-extension.rbs +0 -41
- data/stdlib/prime/0/manifest.yaml +0 -2
- data/stdlib/prime/0/prime.rbs +0 -372
data/core/dir.rbs
CHANGED
@@ -102,7 +102,7 @@ class Dir
|
|
102
102
|
# The optional *encoding* keyword argument specifies the encoding of the
|
103
103
|
# directory. If not specified, the filesystem encoding is used.
|
104
104
|
#
|
105
|
-
def initialize: (
|
105
|
+
def initialize: (path dir, ?encoding: encoding?) -> self
|
106
106
|
|
107
107
|
# <!--
|
108
108
|
# rdoc-file=dir.rb
|
@@ -110,7 +110,7 @@ class Dir
|
|
110
110
|
# -->
|
111
111
|
# Equivalent to calling `Dir.glob([`*string,...*`], 0)`.
|
112
112
|
#
|
113
|
-
def self.[]: (*
|
113
|
+
def self.[]: (*path patterns, ?base: path?, ?sort: bool) -> Array[String]
|
114
114
|
|
115
115
|
# <!--
|
116
116
|
# rdoc-file=dir.c
|
@@ -149,8 +149,8 @@ class Dir
|
|
149
149
|
# /tmp
|
150
150
|
# /var/spool/mail
|
151
151
|
#
|
152
|
-
def self.chdir: (?
|
153
|
-
| [U] (?
|
152
|
+
def self.chdir: (?path dir) -> 0
|
153
|
+
| [U] (?path dir) { (String dir) -> U } -> U
|
154
154
|
|
155
155
|
# <!--
|
156
156
|
# rdoc-file=dir.c
|
@@ -166,7 +166,7 @@ class Dir
|
|
166
166
|
#
|
167
167
|
# Dir.children("testdir") #=> ["config.h", "main.rb"]
|
168
168
|
#
|
169
|
-
def self.children: (
|
169
|
+
def self.children: (path dirname, ?encoding: encoding?) -> Array[String]
|
170
170
|
|
171
171
|
# <!--
|
172
172
|
# rdoc-file=dir.c
|
@@ -176,7 +176,7 @@ class Dir
|
|
176
176
|
# may make this call. Not available on all platforms. On Unix systems, see
|
177
177
|
# `chroot(2)` for more information.
|
178
178
|
#
|
179
|
-
def self.chroot: (
|
179
|
+
def self.chroot: (path root) -> 0
|
180
180
|
|
181
181
|
# <!--
|
182
182
|
# rdoc-file=dir.c
|
@@ -187,7 +187,7 @@ class Dir
|
|
187
187
|
# Deletes the named directory. Raises a subclass of SystemCallError if the
|
188
188
|
# directory isn't empty.
|
189
189
|
#
|
190
|
-
def self.delete: (
|
190
|
+
def self.delete: (path dirname) -> 0
|
191
191
|
|
192
192
|
# <!--
|
193
193
|
# rdoc-file=dir.c
|
@@ -208,8 +208,8 @@ class Dir
|
|
208
208
|
# Got config.h
|
209
209
|
# Got main.rb
|
210
210
|
#
|
211
|
-
def self.each_child: (
|
212
|
-
| (
|
211
|
+
def self.each_child: (path dirname, ?encoding: encoding?) -> Enumerator[String, nil]
|
212
|
+
| (path dirname, ?encoding: encoding?) { (String filename) -> void } -> nil
|
213
213
|
|
214
214
|
# <!--
|
215
215
|
# rdoc-file=dir.c
|
@@ -218,7 +218,7 @@ class Dir
|
|
218
218
|
# Returns `true` if the named file is an empty directory, `false` if it is not a
|
219
219
|
# directory or non-empty.
|
220
220
|
#
|
221
|
-
def self.empty?: (
|
221
|
+
def self.empty?: (path path_name) -> bool
|
222
222
|
|
223
223
|
# <!--
|
224
224
|
# rdoc-file=dir.c
|
@@ -233,7 +233,7 @@ class Dir
|
|
233
233
|
#
|
234
234
|
# Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"]
|
235
235
|
#
|
236
|
-
def self.entries: (
|
236
|
+
def self.entries: (path dirname, ?encoding: encoding?) -> Array[String]
|
237
237
|
|
238
238
|
# <!--
|
239
239
|
# rdoc-file=dir.c
|
@@ -241,7 +241,7 @@ class Dir
|
|
241
241
|
# -->
|
242
242
|
# Returns `true` if the named file is a directory, `false` otherwise.
|
243
243
|
#
|
244
|
-
def self.exist?: (
|
244
|
+
def self.exist?: (path | _ToIO file_name) -> bool
|
245
245
|
|
246
246
|
# <!--
|
247
247
|
# rdoc-file=dir.c
|
@@ -371,8 +371,8 @@ class Dir
|
|
371
371
|
#
|
372
372
|
# Dir.glob("**/lib/*.rb") #=> ["lib/song.rb"]
|
373
373
|
#
|
374
|
-
def self.glob: (
|
375
|
-
| (
|
374
|
+
def self.glob: (_ToAry[path] | path pattern, ?int flags, ?base: path?, ?sort: bool) -> Array[String]
|
375
|
+
| (_ToAry[path] | path pattern, ?int flags, ?base: path?, ?sort: bool) { (String pathname) -> void } -> nil
|
376
376
|
|
377
377
|
# <!--
|
378
378
|
# rdoc-file=dir.c
|
@@ -381,7 +381,7 @@ class Dir
|
|
381
381
|
# -->
|
382
382
|
# Returns the home directory of the current user or the named user if given.
|
383
383
|
#
|
384
|
-
def self.home: (?string user) -> String
|
384
|
+
def self.home: (?string? user) -> String
|
385
385
|
|
386
386
|
# <!--
|
387
387
|
# rdoc-file=dir.c
|
@@ -395,7 +395,7 @@ class Dir
|
|
395
395
|
#
|
396
396
|
# Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0
|
397
397
|
#
|
398
|
-
def self.mkdir: (
|
398
|
+
def self.mkdir: (path dirname, ?int permissions) -> 0
|
399
399
|
|
400
400
|
# <!--
|
401
401
|
# rdoc-file=dir.rb
|
@@ -411,8 +411,8 @@ class Dir
|
|
411
411
|
# passed *aDir* as a parameter. The directory is closed at the end of the block,
|
412
412
|
# and Dir::open returns the value of the block.
|
413
413
|
#
|
414
|
-
def self.open: (
|
415
|
-
| [U] (
|
414
|
+
def self.open: (path dirname, ?encoding: encoding?) -> instance
|
415
|
+
| [U] (path dirname, ?encoding: encoding?) { (instance) -> U } -> U
|
416
416
|
|
417
417
|
# <!--
|
418
418
|
# rdoc-file=dir.c
|
@@ -425,7 +425,7 @@ class Dir
|
|
425
425
|
# Dir.getwd #=> "/tmp"
|
426
426
|
# Dir.pwd #=> "/tmp"
|
427
427
|
#
|
428
|
-
|
428
|
+
alias self.pwd self.getwd
|
429
429
|
|
430
430
|
# <!--
|
431
431
|
# rdoc-file=dir.c
|
@@ -473,7 +473,7 @@ class Dir
|
|
473
473
|
# d = Dir.new("testdir")
|
474
474
|
# d.close #=> nil
|
475
475
|
#
|
476
|
-
def close: () ->
|
476
|
+
def close: () -> nil
|
477
477
|
|
478
478
|
# <!--
|
479
479
|
# rdoc-file=dir.c
|
@@ -496,7 +496,7 @@ class Dir
|
|
496
496
|
# Got main.rb
|
497
497
|
#
|
498
498
|
def each: () { (String) -> void } -> self
|
499
|
-
| () ->
|
499
|
+
| () -> Enumerator[String, self]
|
500
500
|
|
501
501
|
# <!--
|
502
502
|
# rdoc-file=dir.c
|
@@ -517,7 +517,7 @@ class Dir
|
|
517
517
|
# Got main.rb
|
518
518
|
#
|
519
519
|
def each_child: () { (String) -> void } -> self
|
520
|
-
| () ->
|
520
|
+
| () -> Enumerator[String, self]
|
521
521
|
|
522
522
|
# <!--
|
523
523
|
# rdoc-file=dir.c
|
@@ -577,7 +577,7 @@ class Dir
|
|
577
577
|
# d.pos = i #=> 12
|
578
578
|
# d.read #=> ".."
|
579
579
|
#
|
580
|
-
def pos=: (
|
580
|
+
def pos=: [U < _ToInt] (U pos) -> U
|
581
581
|
|
582
582
|
# <!--
|
583
583
|
# rdoc-file=dir.c
|
@@ -620,7 +620,7 @@ class Dir
|
|
620
620
|
# d.seek(i) #=> #<Dir:0x401b3c40>
|
621
621
|
# d.read #=> ".."
|
622
622
|
#
|
623
|
-
def seek: (
|
623
|
+
def seek: (int pos) -> self
|
624
624
|
|
625
625
|
# <!--
|
626
626
|
# rdoc-file=dir.c
|
@@ -634,7 +634,7 @@ class Dir
|
|
634
634
|
# d.read #=> "."
|
635
635
|
# d.tell #=> 12
|
636
636
|
#
|
637
|
-
|
637
|
+
alias tell pos
|
638
638
|
|
639
639
|
# <!-- rdoc-file=dir.c -->
|
640
640
|
# Returns the path parameter passed to *dir*'s constructor.
|