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.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +1 -1
- data/.github/workflows/ruby.yml +7 -2
- data/CHANGELOG.md +85 -0
- data/Gemfile.lock +14 -14
- data/README.md +11 -2
- data/Rakefile +10 -7
- data/Steepfile +7 -7
- data/core/basic_object.rbs +7 -7
- data/core/binding.rbs +3 -3
- data/core/builtin.rbs +171 -5
- data/core/constants.rbs +17 -17
- data/core/dir.rbs +3 -3
- data/core/encoding.rbs +434 -628
- data/core/enumerator.rbs +37 -0
- data/core/exception.rbs +11 -11
- data/core/false_class.rbs +5 -11
- data/core/fiber.rbs +3 -3
- data/core/file_test.rbs +28 -26
- data/core/kernel.rbs +900 -21
- data/core/marshal.rbs +24 -14
- data/core/match_data.rbs +8 -8
- data/core/math.rbs +57 -53
- data/core/method.rbs +3 -1
- data/core/module.rbs +38 -36
- data/core/nil_class.rbs +7 -13
- data/core/object.rbs +3 -966
- data/core/process.rbs +3 -3
- data/core/ractor.rbs +2 -2
- data/core/rb_config.rbs +64 -43
- data/core/regexp.rbs +3 -3
- data/core/signal.rbs +10 -4
- data/core/struct.rbs +1 -1
- data/core/thread.rbs +7 -7
- data/core/thread_group.rbs +9 -9
- data/core/true_class.rbs +5 -11
- data/core/unbound_method.rbs +56 -7
- data/core/warning.rbs +33 -0
- data/docs/collection.md +56 -6
- data/docs/data_and_struct.md +57 -0
- data/docs/stdlib.md +61 -2
- data/docs/syntax.md +123 -2
- data/ext/rbs_extension/lexer.c +624 -569
- data/ext/rbs_extension/lexer.h +1 -0
- data/ext/rbs_extension/lexer.re +1 -0
- data/ext/rbs_extension/lexstate.c +1 -0
- data/ext/rbs_extension/parser.c +6 -0
- data/goodcheck.yml +2 -2
- data/lib/rbs/annotate/formatter.rb +13 -3
- data/lib/rbs/annotate/rdoc_source.rb +10 -1
- data/lib/rbs/cli/colored_io.rb +48 -0
- data/lib/rbs/cli/diff.rb +80 -0
- data/lib/rbs/cli.rb +151 -16
- data/lib/rbs/collection/config/lockfile.rb +0 -25
- data/lib/rbs/collection/config/lockfile_generator.rb +0 -6
- data/lib/rbs/collection/installer.rb +1 -1
- data/lib/rbs/collection/sources/git.rb +6 -4
- data/lib/rbs/collection/sources/local.rb +7 -5
- data/lib/rbs/diff.rb +104 -0
- data/lib/rbs/environment.rb +1 -1
- data/lib/rbs/method_type.rb +23 -0
- data/lib/rbs/prototype/rb.rb +2 -9
- data/lib/rbs/prototype/runtime/helpers.rb +59 -0
- data/lib/rbs/prototype/runtime/value_object_generator.rb +236 -0
- data/lib/rbs/prototype/runtime.rb +234 -150
- data/lib/rbs/sorter.rb +144 -117
- data/lib/rbs/test/guaranteed.rb +31 -0
- data/lib/rbs/test/type_check.rb +4 -4
- data/lib/rbs/test.rb +3 -0
- data/lib/rbs/types.rb +184 -3
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +4 -4
- data/lib/rbs.rb +1 -0
- data/rbs.gemspec +1 -0
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +1 -1
- data/sig/cli/colored_io.rbs +15 -0
- data/sig/cli/diff.rbs +21 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/config/lockfile.rbs +0 -6
- data/sig/diff.rbs +23 -0
- data/sig/errors.rbs +1 -5
- data/sig/method_types.rbs +6 -0
- data/sig/prototype/runtime.rbs +108 -0
- data/sig/rdoc/rbs.rbs +4 -0
- data/sig/shims/bundler.rbs +5 -0
- data/sig/sorter.rbs +23 -5
- data/sig/types.rbs +29 -0
- data/stdlib/benchmark/0/benchmark.rbs +1 -1
- data/stdlib/cgi/0/core.rbs +2 -2
- data/stdlib/did_you_mean/0/did_you_mean.rbs +2 -2
- data/stdlib/digest/0/digest.rbs +1 -1
- data/stdlib/fileutils/0/fileutils.rbs +1 -1
- data/stdlib/forwardable/0/forwardable.rbs +4 -4
- data/stdlib/io-console/0/io-console.rbs +1 -1
- data/stdlib/json/0/json.rbs +37 -0
- data/stdlib/logger/0/logger.rbs +2 -2
- data/stdlib/net-http/0/manifest.yaml +1 -1
- data/stdlib/net-http/0/net-http.rbs +16 -63
- data/stdlib/net-protocol/0/manifest.yaml +2 -0
- data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
- data/stdlib/openssl/0/openssl.rbs +1 -1
- data/stdlib/pp/0/manifest.yaml +2 -0
- data/stdlib/pp/0/pp.rbs +301 -0
- data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
- data/stdlib/psych/0/manifest.yaml +3 -0
- data/stdlib/psych/0/psych.rbs +391 -0
- data/stdlib/{yaml → psych}/0/store.rbs +2 -2
- data/stdlib/rdoc/0/code_object.rbs +55 -0
- data/stdlib/rdoc/0/comment.rbs +60 -0
- data/stdlib/rdoc/0/context.rbs +153 -0
- data/stdlib/rdoc/0/markup.rbs +119 -0
- data/stdlib/rdoc/0/parser.rbs +56 -0
- data/stdlib/rdoc/0/rdoc.rbs +0 -372
- data/stdlib/rdoc/0/ri.rbs +17 -0
- data/stdlib/rdoc/0/store.rbs +48 -0
- data/stdlib/rdoc/0/top_level.rbs +97 -0
- data/stdlib/socket/0/basic_socket.rbs +1 -1
- data/stdlib/socket/0/socket.rbs +1 -1
- data/stdlib/uri/0/common.rbs +1 -1
- data/stdlib/yaml/0/manifest.yaml +1 -2
- data/stdlib/yaml/0/yaml.rbs +1 -199
- metadata +46 -9
- data/sig/shims/pp.rbs +0 -3
- 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
|
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: (?
|
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
|
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: () ->
|
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: () ->
|
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:
|
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
|
-
| (
|
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: (?
|
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 |
|
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
|
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) ->
|
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
|
-
| (
|
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
|
-
| (
|
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[
|
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[
|
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[
|
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?: (
|
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?: (
|
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?: (
|
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
|
-
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
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?: (
|
330
|
+
def self?.zero?: (path | io file_name) -> bool
|
329
331
|
end
|