rbs 3.2.0.pre.1 → 3.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c7d64866444cfce09f503377b3f8f13d183a37c4e90622789f15cd99d38cdae
4
- data.tar.gz: c853c73b32d6135c4b06e6bc8593dbe4d5e44b5a4768def8b7c6de68536578a7
3
+ metadata.gz: 3785c4b5642259ae2d30d7fc88b188283a43367053a2cf958238f800a1aef7dc
4
+ data.tar.gz: a15b431352b349d6d0d3eb034b0a892bc85502ddd5c1158bd41980baee01760a
5
5
  SHA512:
6
- metadata.gz: 87316a9512b8de5f073f5aab93f9ff99e5bcca464e1e418c6b12146c69fb04d4c450bb51543343527378dd6194e1b311db88d5cf24eb2e94da7ceaa4f751c1ed
7
- data.tar.gz: 1065a9b77880aceb0b3595d0a7e4b99bf60f5061675b63686cac716cd8badf5477eecfe04f7e2d9f8cadd85eac9e1d06c6d4b7c89910414e37edca598c33f5b9
6
+ metadata.gz: fec87dba1128481d962646c4a2cc0d8243cc18971584633c1565d70fc2d8d09c94823b60990c4c6ad9ad3167e8c60421c60bfb5f194c1bcbd5079bff7a454ee5
7
+ data.tar.gz: f5f0ead8e4db8c05b11f9d6bbad2be09f0f3951701c58bbf5ffbe62ec2e5ce149dfe53a82b9f7f3cded1871fb80b78177e19fbce5775368f0907bf5b686c8e74
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 3.2.0 (2023-08-22)
6
+
7
+ ### Signature updates
8
+
9
+ * `Binding` ([#1451](https://github.com/ruby/rbs/pull/1451))
10
+ * `Kernel` ([#1445](https://github.com/ruby/rbs/pull/1445), [#1444](https://github.com/ruby/rbs/pull/1444), [#1443](https://github.com/ruby/rbs/pull/1443), [#1441](https://github.com/ruby/rbs/pull/1441), [#1440](https://github.com/ruby/rbs/pull/1440))
11
+ * `Errno` ([#1450](https://github.com/ruby/rbs/pull/1450))
12
+
13
+ ### Library changes
14
+
15
+ #### rbs collection
16
+
17
+ * Fix LockfileGenerator crashes if failed to get deps for locked source ([#1413](https://github.com/ruby/rbs/pull/1413))
18
+
5
19
  ## 3.2.0.pre.1 (2023-08-18)
6
20
 
7
21
  ### Signature updates
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.2.0.pre.1)
4
+ rbs (3.2.0)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
data/Rakefile CHANGED
@@ -82,7 +82,7 @@ FileList["test/stdlib/**/*_test.rb"].each do |test|
82
82
  end
83
83
  end
84
84
 
85
- task :stdlib_test do
85
+ task :stdlib_test => :compile do
86
86
  test_files = FileList["test/stdlib/**/*_test.rb"].reject do |path|
87
87
  path =~ %r{Ractor}
88
88
  end
@@ -314,7 +314,7 @@ end
314
314
 
315
315
  desc "Generate changelog template from GH pull requests"
316
316
  task :changelog do
317
- major, minor, patch, pre = RBS::VERSION.split(".", 4)
317
+ major, minor, patch, _pre = RBS::VERSION.split(".", 4)
318
318
  major = major.to_i
319
319
  minor = minor.to_i
320
320
  patch = patch.to_i
data/core/binding.rbs CHANGED
@@ -30,10 +30,10 @@
30
30
  # Binding objects have no class-specific methods.
31
31
  #
32
32
  class Binding
33
- public
34
-
35
33
  def clone: () -> self
36
34
 
35
+ def dup: () -> self
36
+
37
37
  # <!--
38
38
  # rdoc-file=proc.c
39
39
  # - binding.eval(string [, filename [,lineno]]) -> obj
@@ -48,69 +48,7 @@ class Binding
48
48
  # b = get_binding("hello")
49
49
  # b.eval("param") #=> "hello"
50
50
  #
51
- def eval: (String arg0, ?String filename, ?Integer lineno) -> untyped
52
-
53
- # <!--
54
- # rdoc-file=lib/irb.rb
55
- # - irb(show_code: true)
56
- # -->
57
- # Opens an IRB session where `binding.irb` is called which allows for
58
- # interactive debugging. You can call any methods or variables available in the
59
- # current scope, and mutate state if you need to.
60
- #
61
- # Given a Ruby file called `potato.rb` containing the following code:
62
- #
63
- # class Potato
64
- # def initialize
65
- # @cooked = false
66
- # binding.irb
67
- # puts "Cooked potato: #{@cooked}"
68
- # end
69
- # end
70
- #
71
- # Potato.new
72
- #
73
- # Running `ruby potato.rb` will open an IRB session where `binding.irb` is
74
- # called, and you will see the following:
75
- #
76
- # $ ruby potato.rb
77
- #
78
- # From: potato.rb @ line 4 :
79
- #
80
- # 1: class Potato
81
- # 2: def initialize
82
- # 3: @cooked = false
83
- # => 4: binding.irb
84
- # 5: puts "Cooked potato: #{@cooked}"
85
- # 6: end
86
- # 7: end
87
- # 8:
88
- # 9: Potato.new
89
- #
90
- # irb(#<Potato:0x00007feea1916670>):001:0>
91
- #
92
- # You can type any valid Ruby code and it will be evaluated in the current
93
- # context. This allows you to debug without having to run your code repeatedly:
94
- #
95
- # irb(#<Potato:0x00007feea1916670>):001:0> @cooked
96
- # => false
97
- # irb(#<Potato:0x00007feea1916670>):002:0> self.class
98
- # => Potato
99
- # irb(#<Potato:0x00007feea1916670>):003:0> caller.first
100
- # => ".../2.5.1/lib/ruby/2.5.0/irb/workspace.rb:85:in `eval'"
101
- # irb(#<Potato:0x00007feea1916670>):004:0> @cooked = true
102
- # => true
103
- #
104
- # You can exit the IRB session with the `exit` command. Note that exiting will
105
- # resume execution where `binding.irb` had paused it, as you can see from the
106
- # output printed to standard output in this example:
107
- #
108
- # irb(#<Potato:0x00007feea1916670>):005:0> exit
109
- # Cooked potato: true
110
- #
111
- # See IRB@IRB+Usage for more information.
112
- #
113
- def irb: () -> void
51
+ def eval: (string src, ?string filename, ?int lineno) -> untyped
114
52
 
115
53
  # <!--
116
54
  # rdoc-file=proc.c
@@ -128,7 +66,7 @@ class Binding
128
66
  #
129
67
  # binding.eval("defined?(#{symbol}) == 'local-variable'")
130
68
  #
131
- def local_variable_defined?: (String | Symbol symbol) -> bool
69
+ def local_variable_defined?: (Symbol | string varname) -> bool
132
70
 
133
71
  # <!--
134
72
  # rdoc-file=proc.c
@@ -146,7 +84,7 @@ class Binding
146
84
  #
147
85
  # binding.eval("#{symbol}")
148
86
  #
149
- def local_variable_get: (String | Symbol symbol) -> untyped
87
+ def local_variable_get: (Symbol | string varname) -> untyped
150
88
 
151
89
  # <!--
152
90
  # rdoc-file=proc.c
@@ -173,7 +111,7 @@ class Binding
173
111
  #
174
112
  # if `obj` can be dumped in Ruby code.
175
113
  #
176
- def local_variable_set: [U] (String | Symbol symbol, U obj) -> U
114
+ def local_variable_set: [U] (Symbol | string varname, U obj) -> U
177
115
 
178
116
  # <!--
179
117
  # rdoc-file=proc.c
@@ -208,5 +146,5 @@ class Binding
208
146
  # -->
209
147
  # Returns the Ruby source filename and line number of the binding object.
210
148
  #
211
- def source_location: () -> [ String, Integer ]
149
+ def source_location: () -> [String, Integer]
212
150
  end
data/core/builtin.rbs CHANGED
@@ -54,6 +54,10 @@ interface _ToPath
54
54
  def to_path: () -> String
55
55
  end
56
56
 
57
+ interface _Inspect
58
+ def inspect: () -> String
59
+ end
60
+
57
61
  interface _Each[out A]
58
62
  def each: () { (A) -> void } -> void
59
63
  end
@@ -95,6 +99,7 @@ type real = Integer | Float | Rational
95
99
 
96
100
  type string = String | _ToStr
97
101
  type encoding = Encoding | string
102
+ type path = string | _ToPath
98
103
 
99
104
  type io = IO | _ToIO
100
105
 
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: (string, ?encoding: encoding | nil) -> void
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.[]: (*string patterns, ?base: string) ?{ (String path) -> void } -> Array[String]
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: (?string) -> void
153
- | [U] (?string) { (String) -> U } -> 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: (string dirname, ?encoding: string | Encoding | nil enc) -> Array[String]
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: (string) -> void
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: (string) -> void
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: (string dirname, ?encoding: string | Encoding | nil enc) -> Enumerator[String, void]
212
- | (string dirname, ?encoding: string | Encoding | nil enc) { (String filename) -> void } -> void
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?: (string path_name) -> bool
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: (string dirname, ?encoding: encoding | nil enc) -> ::Array[String]
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?: (string file) -> bool
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: (string | ::Array[string] pattern, ?Integer flags, ?base: string) -> ::Array[String]
375
- | (string | ::Array[string] pattern, ?Integer flags, ?base: string) { (String) -> void } -> void
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: (string, ?Integer permissions) -> void
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: (string, ?encoding: encoding | nil) -> Dir
415
- | [U] (string, ?encoding: encoding | nil) { (Dir) -> U } -> 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
- def self.pwd: () -> String
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: () -> void
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
- | () -> ::Enumerator[String, self]
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
- | () -> ::Enumerator[String, self]
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=: (Integer pos) -> Integer
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: (Integer) -> self
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
- def tell: () -> Integer
637
+ alias tell pos
638
638
 
639
639
  # <!-- rdoc-file=dir.c -->
640
640
  # Returns the path parameter passed to *dir*'s constructor.