rbs 3.2.2 → 3.3.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +7 -2
  4. data/CHANGELOG.md +85 -0
  5. data/Gemfile.lock +14 -14
  6. data/README.md +11 -2
  7. data/Rakefile +10 -7
  8. data/Steepfile +7 -7
  9. data/core/basic_object.rbs +7 -7
  10. data/core/binding.rbs +3 -3
  11. data/core/builtin.rbs +171 -5
  12. data/core/constants.rbs +17 -17
  13. data/core/dir.rbs +3 -3
  14. data/core/encoding.rbs +434 -628
  15. data/core/enumerator.rbs +37 -0
  16. data/core/exception.rbs +11 -11
  17. data/core/false_class.rbs +5 -11
  18. data/core/fiber.rbs +3 -3
  19. data/core/file_test.rbs +28 -26
  20. data/core/kernel.rbs +900 -21
  21. data/core/marshal.rbs +24 -14
  22. data/core/match_data.rbs +8 -8
  23. data/core/math.rbs +57 -53
  24. data/core/method.rbs +3 -1
  25. data/core/module.rbs +38 -36
  26. data/core/nil_class.rbs +7 -13
  27. data/core/object.rbs +3 -966
  28. data/core/process.rbs +3 -3
  29. data/core/ractor.rbs +2 -2
  30. data/core/rb_config.rbs +64 -43
  31. data/core/regexp.rbs +3 -3
  32. data/core/signal.rbs +10 -4
  33. data/core/struct.rbs +1 -1
  34. data/core/thread.rbs +7 -7
  35. data/core/thread_group.rbs +9 -9
  36. data/core/true_class.rbs +5 -11
  37. data/core/unbound_method.rbs +56 -7
  38. data/core/warning.rbs +33 -0
  39. data/docs/collection.md +56 -6
  40. data/docs/data_and_struct.md +57 -0
  41. data/docs/stdlib.md +61 -2
  42. data/docs/syntax.md +123 -2
  43. data/ext/rbs_extension/lexer.c +624 -569
  44. data/ext/rbs_extension/lexer.h +1 -0
  45. data/ext/rbs_extension/lexer.re +1 -0
  46. data/ext/rbs_extension/lexstate.c +1 -0
  47. data/ext/rbs_extension/parser.c +6 -0
  48. data/goodcheck.yml +2 -2
  49. data/lib/rbs/annotate/formatter.rb +13 -3
  50. data/lib/rbs/annotate/rdoc_source.rb +10 -1
  51. data/lib/rbs/cli/colored_io.rb +48 -0
  52. data/lib/rbs/cli/diff.rb +80 -0
  53. data/lib/rbs/cli.rb +151 -16
  54. data/lib/rbs/collection/config/lockfile.rb +0 -25
  55. data/lib/rbs/collection/config/lockfile_generator.rb +0 -6
  56. data/lib/rbs/collection/installer.rb +1 -1
  57. data/lib/rbs/collection/sources/git.rb +6 -4
  58. data/lib/rbs/collection/sources/local.rb +7 -5
  59. data/lib/rbs/diff.rb +104 -0
  60. data/lib/rbs/environment.rb +1 -1
  61. data/lib/rbs/method_type.rb +23 -0
  62. data/lib/rbs/prototype/rb.rb +2 -9
  63. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  64. data/lib/rbs/prototype/runtime/value_object_generator.rb +236 -0
  65. data/lib/rbs/prototype/runtime.rb +234 -150
  66. data/lib/rbs/sorter.rb +144 -117
  67. data/lib/rbs/test/guaranteed.rb +31 -0
  68. data/lib/rbs/test/type_check.rb +4 -4
  69. data/lib/rbs/test.rb +3 -0
  70. data/lib/rbs/types.rb +184 -3
  71. data/lib/rbs/version.rb +1 -1
  72. data/lib/rbs/writer.rb +4 -4
  73. data/lib/rbs.rb +1 -0
  74. data/rbs.gemspec +1 -0
  75. data/sig/annotate/formatter.rbs +2 -2
  76. data/sig/annotate/rdoc_annotater.rbs +1 -1
  77. data/sig/cli/colored_io.rbs +15 -0
  78. data/sig/cli/diff.rbs +21 -0
  79. data/sig/cli.rbs +2 -0
  80. data/sig/collection/config/lockfile.rbs +0 -6
  81. data/sig/diff.rbs +23 -0
  82. data/sig/errors.rbs +1 -5
  83. data/sig/method_types.rbs +6 -0
  84. data/sig/prototype/runtime.rbs +108 -0
  85. data/sig/rdoc/rbs.rbs +4 -0
  86. data/sig/shims/bundler.rbs +5 -0
  87. data/sig/sorter.rbs +23 -5
  88. data/sig/types.rbs +29 -0
  89. data/stdlib/benchmark/0/benchmark.rbs +1 -1
  90. data/stdlib/cgi/0/core.rbs +2 -2
  91. data/stdlib/did_you_mean/0/did_you_mean.rbs +2 -2
  92. data/stdlib/digest/0/digest.rbs +1 -1
  93. data/stdlib/fileutils/0/fileutils.rbs +1 -1
  94. data/stdlib/forwardable/0/forwardable.rbs +4 -4
  95. data/stdlib/io-console/0/io-console.rbs +1 -1
  96. data/stdlib/json/0/json.rbs +37 -0
  97. data/stdlib/logger/0/logger.rbs +2 -2
  98. data/stdlib/net-http/0/manifest.yaml +1 -1
  99. data/stdlib/net-http/0/net-http.rbs +16 -63
  100. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  101. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  102. data/stdlib/openssl/0/openssl.rbs +1 -1
  103. data/stdlib/pp/0/manifest.yaml +2 -0
  104. data/stdlib/pp/0/pp.rbs +301 -0
  105. data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
  106. data/stdlib/psych/0/manifest.yaml +3 -0
  107. data/stdlib/psych/0/psych.rbs +391 -0
  108. data/stdlib/{yaml → psych}/0/store.rbs +2 -2
  109. data/stdlib/rdoc/0/code_object.rbs +55 -0
  110. data/stdlib/rdoc/0/comment.rbs +60 -0
  111. data/stdlib/rdoc/0/context.rbs +153 -0
  112. data/stdlib/rdoc/0/markup.rbs +119 -0
  113. data/stdlib/rdoc/0/parser.rbs +56 -0
  114. data/stdlib/rdoc/0/rdoc.rbs +0 -372
  115. data/stdlib/rdoc/0/ri.rbs +17 -0
  116. data/stdlib/rdoc/0/store.rbs +48 -0
  117. data/stdlib/rdoc/0/top_level.rbs +97 -0
  118. data/stdlib/socket/0/basic_socket.rbs +1 -1
  119. data/stdlib/socket/0/socket.rbs +1 -1
  120. data/stdlib/uri/0/common.rbs +1 -1
  121. data/stdlib/yaml/0/manifest.yaml +1 -2
  122. data/stdlib/yaml/0/yaml.rbs +1 -199
  123. metadata +46 -9
  124. data/sig/shims/pp.rbs +0 -3
  125. data/sig/shims.rbs +0 -47
data/core/enumerator.rbs CHANGED
@@ -124,6 +124,43 @@
124
124
  class Enumerator[unchecked out Elem, out Return] < Object
125
125
  include Enumerable[Elem]
126
126
 
127
+ # <!--
128
+ # rdoc-file=enumerator.c
129
+ # - Enumerator.produce(initial = nil) { |prev| block } -> enumerator
130
+ # -->
131
+ # Creates an infinite enumerator from any block, just called over and over. The
132
+ # result of the previous iteration is passed to the next one. If `initial` is
133
+ # provided, it is passed to the first iteration, and becomes the first element
134
+ # of the enumerator; if it is not provided, the first iteration receives `nil`,
135
+ # and its result becomes the first element of the iterator.
136
+ #
137
+ # Raising StopIteration from the block stops an iteration.
138
+ #
139
+ # Enumerator.produce(1, &:succ) # => enumerator of 1, 2, 3, 4, ....
140
+ #
141
+ # Enumerator.produce { rand(10) } # => infinite random number sequence
142
+ #
143
+ # ancestors = Enumerator.produce(node) { |prev| node = prev.parent or raise StopIteration }
144
+ # enclosing_section = ancestors.find { |n| n.type == :section }
145
+ #
146
+ # Using ::produce together with Enumerable methods like Enumerable#detect,
147
+ # Enumerable#slice_after, Enumerable#take_while can provide Enumerator-based
148
+ # alternatives for `while` and `until` cycles:
149
+ #
150
+ # # Find next Tuesday
151
+ # require "date"
152
+ # Enumerator.produce(Date.today, &:succ).detect(&:tuesday?)
153
+ #
154
+ # # Simple lexer:
155
+ # require "strscan"
156
+ # scanner = StringScanner.new("7+38/6")
157
+ # PATTERN = %r{\d+|[-/+*]}
158
+ # Enumerator.produce { scanner.scan(PATTERN) }.slice_after { scanner.eos? }.first
159
+ # # => ["7", "+", "38", "/", "6"]
160
+ #
161
+ def self.produce: [T] () { (T? prev) -> T } -> Enumerator[T, bot]
162
+ | [T] (T initial) { (T prev) -> T } -> Enumerator[T, bot]
163
+
127
164
  # <!--
128
165
  # rdoc-file=enumerator.c
129
166
  # - Enumerator.product(*enums) -> enumerator
data/core/exception.rbs CHANGED
@@ -105,7 +105,7 @@
105
105
  # * SystemStackError
106
106
  # * fatal
107
107
  #
108
- class Exception < Object
108
+ class Exception
109
109
  # <!--
110
110
  # rdoc-file=error.c
111
111
  # - Exception.to_tty? -> true or false
@@ -122,7 +122,7 @@ class Exception < Object
122
122
  # receiver. Otherwise, create a new exception object of the same class as the
123
123
  # receiver, but with a message equal to `string.to_str`.
124
124
  #
125
- def self.exception: (?String msg) -> Exception
125
+ def self.exception: (?string | _ToS msg) -> instance
126
126
 
127
127
  # <!--
128
128
  # rdoc-file=error.c
@@ -131,7 +131,7 @@ class Exception < Object
131
131
  # Equality---If *obj* is not an Exception, returns `false`. Otherwise, returns
132
132
  # `true` if *exc* and *obj* share same class, messages, and backtrace.
133
133
  #
134
- def ==: (untyped arg0) -> bool
134
+ def ==: (untyped obj) -> bool
135
135
 
136
136
  # <!--
137
137
  # rdoc-file=error.c
@@ -167,7 +167,7 @@ class Exception < Object
167
167
  # ex.backtrace
168
168
  # #=> nil
169
169
  #
170
- def backtrace: () -> ::Array[String]?
170
+ def backtrace: () -> Array[String]?
171
171
 
172
172
  # <!--
173
173
  # rdoc-file=error.c
@@ -179,7 +179,7 @@ class Exception < Object
179
179
  #
180
180
  # This method is not affected by Exception#set_backtrace().
181
181
  #
182
- def backtrace_locations: () -> ::Array[Thread::Backtrace::Location]?
182
+ def backtrace_locations: () -> Array[Thread::Backtrace::Location]?
183
183
 
184
184
  # <!--
185
185
  # rdoc-file=error.c
@@ -230,7 +230,7 @@ class Exception < Object
230
230
  # sequences to express essential information; the message should be readable
231
231
  # even if all escape sequences are ignored.
232
232
  #
233
- def detailed_message: (?highlight: boolish, **untyped) -> String
233
+ def detailed_message: (?highlight: bool?, **untyped ignored) -> String
234
234
 
235
235
  # <!--
236
236
  # rdoc-file=error.c
@@ -240,8 +240,8 @@ class Exception < Object
240
240
  # receiver. Otherwise, create a new exception object of the same class as the
241
241
  # receiver, but with a message equal to `string.to_str`.
242
242
  #
243
- def exception: () -> self
244
- | (String arg0) -> Exception
243
+ def exception: (?self) -> self
244
+ | (string | _ToS message) -> instance
245
245
 
246
246
  # <!--
247
247
  # rdoc-file=error.c
@@ -250,7 +250,7 @@ class Exception < Object
250
250
  # -->
251
251
  # Construct a new Exception object, optionally passing in a message.
252
252
  #
253
- def initialize: (?String arg0) -> void
253
+ def initialize: (?string | _ToS message) -> self
254
254
 
255
255
  # <!--
256
256
  # rdoc-file=error.c
@@ -277,7 +277,7 @@ class Exception < Object
277
277
  # an array of String objects or a single String in the format described in
278
278
  # Exception#backtrace.
279
279
  #
280
- def set_backtrace: (String | ::Array[String] arg0) -> ::Array[String]
280
+ def set_backtrace: (String | Array[String] backtrace) -> Array[String]
281
281
  | (nil) -> nil
282
282
 
283
283
  # <!--
@@ -306,5 +306,5 @@ class Exception < Object
306
306
  # The default values of these options depend on `$stderr` and its `tty?` at the
307
307
  # timing of a call.
308
308
  #
309
- def full_message: (?highlight: bool, ?order: :top | :bottom) -> String
309
+ def full_message: (?highlight: bool?, ?order: (:top | :bottom | string)?) -> String
310
310
  end
data/core/false_class.rbs CHANGED
@@ -4,8 +4,6 @@
4
4
  # operators allowing `false` to participate correctly in logical expressions.
5
5
  #
6
6
  class FalseClass
7
- public
8
-
9
7
  def !: () -> true
10
8
 
11
9
  # <!--
@@ -27,7 +25,7 @@ class FalseClass
27
25
  # statements.
28
26
  #
29
27
  def ===: (false) -> true
30
- | (untyped obj) -> false
28
+ | (untyped obj) -> bool
31
29
 
32
30
  # <!--
33
31
  # rdoc-file=object.c
@@ -37,9 +35,8 @@ class FalseClass
37
35
  # Exclusive Or---If *obj* is `nil` or `false`, returns `false`; otherwise,
38
36
  # returns `true`.
39
37
  #
40
- def ^: (nil) -> false
41
- | (false) -> false
42
- | (untyped obj) -> true
38
+ def ^: (false | nil) -> false
39
+ | (untyped obj) -> bool
43
40
 
44
41
  # <!-- rdoc-file=object.c -->
45
42
  # The string representation of `false` is "false".
@@ -61,9 +58,6 @@ class FalseClass
61
58
  # -->
62
59
  # Or---Returns `false` if *obj* is `nil` or `false`; `true` otherwise.
63
60
  #
64
- def |: (nil) -> false
65
- | (false) -> false
66
- | (untyped obj) -> true
67
-
68
- def clone: (?freeze: true?) -> self
61
+ def |: (nil | false) -> false
62
+ | (untyped obj) -> bool
69
63
  end
data/core/fiber.rbs CHANGED
@@ -268,7 +268,7 @@ class Fiber < Object
268
268
  # Explicitly using `storage: true` is currently experimental and may change in
269
269
  # the future.
270
270
  #
271
- def initialize: (?blocking: boolish, ?storage: true | Hash[Symbol | String, untyped] | nil) { (*untyped) -> void } -> void
271
+ def initialize: (?blocking: boolish, ?storage: true | Hash[interned, untyped] | nil) { (*untyped) -> void } -> void
272
272
 
273
273
  # <!--
274
274
  # rdoc-file=cont.c
@@ -414,7 +414,7 @@ class Fiber < Object
414
414
  # Returns a copy of the storage hash for the fiber. The method can only be
415
415
  # called on the Fiber.current.
416
416
  #
417
- def storage: () -> Hash[Symbol | String, untyped]
417
+ def storage: () -> Hash[interned, untyped]
418
418
 
419
419
  # <!--
420
420
  # rdoc-file=cont.c
@@ -438,7 +438,7 @@ class Fiber < Object
438
438
  # handle_request(request)
439
439
  # end
440
440
  #
441
- def storage=: (Hash[Symbol | String, untyped]) -> Hash[Symbol | String, untyped]
441
+ def storage=: (Hash[interned, untyped]) -> Hash[interned, untyped]
442
442
 
443
443
  # <!--
444
444
  # rdoc-file=cont.c
data/core/file_test.rbs CHANGED
@@ -13,7 +13,7 @@ module FileTest
13
13
  # File.blockdev?('/dev/sda1') # => true
14
14
  # File.blockdev?(File.new('t.tmp')) # => false
15
15
  #
16
- def self?.blockdev?: (String | IO file_name) -> bool
16
+ def self?.blockdev?: (path | io file_name) -> bool
17
17
 
18
18
  # <!--
19
19
  # rdoc-file=file.c
@@ -24,7 +24,7 @@ module FileTest
24
24
  # File.chardev?($stdin) # => true
25
25
  # File.chardev?('t.txt') # => false
26
26
  #
27
- def self?.chardev?: (String | IO file_name) -> bool
27
+ def self?.chardev?: (path | io file_name) -> bool
28
28
 
29
29
  # <!--
30
30
  # rdoc-file=file.c
@@ -42,14 +42,16 @@ module FileTest
42
42
  #
43
43
  # Argument `path` can be an IO object.
44
44
  #
45
- def self?.directory?: (String | IO file_name) -> bool
45
+ def self?.directory?: (path | io file_name) -> bool
46
46
 
47
47
  # <!-- rdoc-file=file.c -->
48
48
  # Returns `true` if the named file exists and has a zero size.
49
49
  #
50
50
  # *file_name* can be an IO object.
51
51
  #
52
- def self?.empty?: (String | IO file_name) -> bool
52
+ alias empty? zero?
53
+
54
+ alias self.empty? self.zero?
53
55
 
54
56
  # <!--
55
57
  # rdoc-file=file.c
@@ -65,7 +67,7 @@ module FileTest
65
67
  # Note that some OS-level security features may cause this to return true even
66
68
  # though the file is not executable by the effective user/group.
67
69
  #
68
- def self?.executable?: (String file_name) -> bool
70
+ def self?.executable?: (path file_name) -> bool
69
71
 
70
72
  # <!--
71
73
  # rdoc-file=file.c
@@ -81,7 +83,7 @@ module FileTest
81
83
  # Note that some OS-level security features may cause this to return true even
82
84
  # though the file is not executable by the real user/group.
83
85
  #
84
- def self?.executable_real?: (String file_name) -> bool
86
+ def self?.executable_real?: (path file_name) -> bool
85
87
 
86
88
  # <!--
87
89
  # rdoc-file=file.c
@@ -93,7 +95,7 @@ module FileTest
93
95
  #
94
96
  # "file exists" means that stat() or fstat() system call is successful.
95
97
  #
96
- def self?.exist?: (String | IO file_name) -> bool
98
+ def self?.exist?: (path | io file_name) -> bool
97
99
 
98
100
  # <!--
99
101
  # rdoc-file=file.c
@@ -106,7 +108,7 @@ module FileTest
106
108
  # If the `file` argument is a symbolic link, it will resolve the symbolic link
107
109
  # and use the file referenced by the link.
108
110
  #
109
- def self?.file?: (String | IO file) -> bool
111
+ def self?.file?: (path | io file) -> bool
110
112
 
111
113
  # <!--
112
114
  # rdoc-file=file.c
@@ -117,7 +119,7 @@ module FileTest
117
119
  #
118
120
  # *file_name* can be an IO object.
119
121
  #
120
- def self?.grpowned?: (String | IO file_name) -> bool
122
+ def self?.grpowned?: (path | io file_name) -> bool
121
123
 
122
124
  # <!--
123
125
  # rdoc-file=file.c
@@ -137,7 +139,7 @@ module FileTest
137
139
  # open("d", "w") {}
138
140
  # p File.identical?("a", "d") #=> false
139
141
  #
140
- def self?.identical?: (String | IO file_1, String | IO file_2) -> bool
142
+ def self?.identical?: (path | io file_1, path | io file_2) -> bool
141
143
 
142
144
  # <!--
143
145
  # rdoc-file=file.c
@@ -148,7 +150,7 @@ module FileTest
148
150
  #
149
151
  # *file_name* can be an IO object.
150
152
  #
151
- def self?.owned?: (String | IO file_name) -> bool
153
+ def self?.owned?: (path | io file_name) -> bool
152
154
 
153
155
  # <!--
154
156
  # rdoc-file=file.c
@@ -160,7 +162,7 @@ module FileTest
160
162
  # File.pipe?('tmp/fifo') # => true
161
163
  # File.pipe?('t.txt') # => false
162
164
  #
163
- def self?.pipe?: (String | IO file_name) -> bool
165
+ def self?.pipe?: (path | io file_name) -> bool
164
166
 
165
167
  # <!--
166
168
  # rdoc-file=file.c
@@ -172,7 +174,7 @@ module FileTest
172
174
  # Note that some OS-level security features may cause this to return true even
173
175
  # though the file is not readable by the effective user/group.
174
176
  #
175
- def self?.readable?: (String file_name) -> bool
177
+ def self?.readable?: (path file_name) -> bool
176
178
 
177
179
  # <!--
178
180
  # rdoc-file=file.c
@@ -184,7 +186,7 @@ module FileTest
184
186
  # Note that some OS-level security features may cause this to return true even
185
187
  # though the file is not readable by the real user/group.
186
188
  #
187
- def self?.readable_real?: (String file_name) -> bool
189
+ def self?.readable_real?: (path file_name) -> bool
188
190
 
189
191
  # <!--
190
192
  # rdoc-file=file.c
@@ -194,7 +196,7 @@ module FileTest
194
196
  #
195
197
  # *file_name* can be an IO object.
196
198
  #
197
- def self?.setgid?: (String | IO file_name) -> bool
199
+ def self?.setgid?: (path | io file_name) -> bool
198
200
 
199
201
  # <!--
200
202
  # rdoc-file=file.c
@@ -204,7 +206,7 @@ module FileTest
204
206
  #
205
207
  # *file_name* can be an IO object.
206
208
  #
207
- def self?.setuid?: (String | IO file_name) -> bool
209
+ def self?.setuid?: (path | io file_name) -> bool
208
210
 
209
211
  # <!--
210
212
  # rdoc-file=file.c
@@ -214,7 +216,7 @@ module FileTest
214
216
  #
215
217
  # *file_name* can be an IO object.
216
218
  #
217
- def self?.size: (String | IO file_name) -> Integer
219
+ def self?.size: (path | io file_name) -> Integer
218
220
 
219
221
  # <!--
220
222
  # rdoc-file=file.c
@@ -225,7 +227,7 @@ module FileTest
225
227
  #
226
228
  # *file_name* can be an IO object.
227
229
  #
228
- def self?.size?: (String | IO file_name) -> Integer?
230
+ def self?.size?: (path | io file_name) -> Integer?
229
231
 
230
232
  # <!--
231
233
  # rdoc-file=file.c
@@ -237,7 +239,7 @@ module FileTest
237
239
  # File.socket?(Socket.new(:INET, :STREAM)) # => true
238
240
  # File.socket?(File.new('t.txt')) # => false
239
241
  #
240
- def self?.socket?: (String | IO file_name) -> bool
242
+ def self?.socket?: (path | io file_name) -> bool
241
243
 
242
244
  # <!--
243
245
  # rdoc-file=file.c
@@ -247,7 +249,7 @@ module FileTest
247
249
  #
248
250
  # *file_name* can be an IO object.
249
251
  #
250
- def self?.sticky?: (String | IO file_name) -> bool
252
+ def self?.sticky?: (path | io file_name) -> bool
251
253
 
252
254
  # <!--
253
255
  # rdoc-file=file.c
@@ -259,7 +261,7 @@ module FileTest
259
261
  # File.symlink?('symlink') # => true
260
262
  # File.symlink?('t.txt') # => false
261
263
  #
262
- def self?.symlink?: (String file_name) -> bool
264
+ def self?.symlink?: (path file_name) -> bool
263
265
 
264
266
  # <!--
265
267
  # rdoc-file=file.c
@@ -275,7 +277,7 @@ module FileTest
275
277
  # m = File.world_readable?("/etc/passwd")
276
278
  # sprintf("%o", m) #=> "644"
277
279
  #
278
- def self?.world_readable?: (String | IO file_name) -> Integer?
280
+ def self?.world_readable?: (path | io file_name) -> Integer?
279
281
 
280
282
  # <!--
281
283
  # rdoc-file=file.c
@@ -291,7 +293,7 @@ module FileTest
291
293
  # m = File.world_writable?("/tmp")
292
294
  # sprintf("%o", m) #=> "777"
293
295
  #
294
- def self?.world_writable?: (String | IO file_name) -> Integer?
296
+ def self?.world_writable?: (path | io file_name) -> Integer?
295
297
 
296
298
  # <!--
297
299
  # rdoc-file=file.c
@@ -303,7 +305,7 @@ module FileTest
303
305
  # Note that some OS-level security features may cause this to return true even
304
306
  # though the file is not writable by the effective user/group.
305
307
  #
306
- def self?.writable?: (String file_name) -> bool
308
+ def self?.writable?: (path file_name) -> bool
307
309
 
308
310
  # <!--
309
311
  # rdoc-file=file.c
@@ -315,7 +317,7 @@ module FileTest
315
317
  # Note that some OS-level security features may cause this to return true even
316
318
  # though the file is not writable by the real user/group.
317
319
  #
318
- def self?.writable_real?: (String file_name) -> bool
320
+ def self?.writable_real?: (path file_name) -> bool
319
321
 
320
322
  # <!--
321
323
  # rdoc-file=file.c
@@ -325,5 +327,5 @@ module FileTest
325
327
  #
326
328
  # *file_name* can be an IO object.
327
329
  #
328
- def self?.zero?: (String | IO file_name) -> bool
330
+ def self?.zero?: (path | io file_name) -> bool
329
331
  end