rbs 1.7.1 → 2.0.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +104 -3
- data/core/array.rbs +3 -3
- data/core/builtin.rbs +4 -0
- data/core/enumerable.rbs +3 -3
- data/docs/collection.md +23 -1
- data/docs/syntax.md +117 -61
- data/ext/rbs_extension/constants.c +2 -6
- data/ext/rbs_extension/constants.h +1 -2
- data/ext/rbs_extension/parser.c +220 -184
- data/ext/rbs_extension/parserstate.c +6 -2
- data/ext/rbs_extension/parserstate.h +10 -0
- data/ext/rbs_extension/ruby_objs.c +17 -17
- data/ext/rbs_extension/ruby_objs.h +3 -4
- data/lib/rbs/ast/declarations.rb +6 -99
- data/lib/rbs/ast/type_param.rb +134 -0
- data/lib/rbs/cli.rb +33 -5
- data/lib/rbs/collection/config/lockfile_generator.rb +26 -18
- data/lib/rbs/collection/sources/git.rb +18 -7
- data/lib/rbs/collection/sources/rubygems.rb +7 -0
- data/lib/rbs/collection/sources/stdlib.rb +6 -0
- data/lib/rbs/definition.rb +9 -0
- data/lib/rbs/definition_builder.rb +78 -16
- data/lib/rbs/environment.rb +32 -8
- data/lib/rbs/environment_loader.rb +0 -2
- data/lib/rbs/environment_walker.rb +4 -1
- data/lib/rbs/errors.rb +31 -6
- data/lib/rbs/location_aux.rb +2 -0
- data/lib/rbs/method_type.rb +29 -6
- data/lib/rbs/prototype/rb.rb +3 -3
- data/lib/rbs/prototype/rbi.rb +8 -6
- data/lib/rbs/prototype/runtime.rb +4 -4
- data/lib/rbs/type_alias_regularity.rb +115 -0
- data/lib/rbs/types.rb +99 -22
- data/lib/rbs/validator.rb +99 -15
- data/lib/rbs/variance_calculator.rb +60 -31
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +2 -14
- data/lib/rbs.rb +2 -0
- data/schema/decls.json +19 -46
- data/schema/methodType.json +1 -1
- data/schema/typeParam.json +36 -0
- data/schema/types.json +8 -2
- data/sig/collection/collections.rbs +11 -2
- data/sig/collection/config.rbs +2 -2
- data/sig/declarations.rbs +15 -62
- data/sig/definition.rbs +11 -1
- data/sig/definition_builder.rbs +37 -1
- data/sig/environment.rbs +7 -1
- data/sig/environment_walker.rbs +26 -0
- data/sig/errors.rbs +28 -3
- data/sig/location.rbs +3 -1
- data/sig/locator.rbs +1 -1
- data/sig/method_types.rbs +25 -4
- data/sig/type_alias_regularity.rbs +92 -0
- data/sig/type_param.rbs +74 -0
- data/sig/types.rbs +37 -8
- data/sig/validator.rbs +38 -2
- data/sig/variance_calculator.rbs +50 -0
- data/sig/writer.rbs +1 -1
- data/stdlib/bigdecimal-math/0/manifest.yaml +2 -0
- data/stdlib/csv/0/manifest.yaml +2 -0
- data/stdlib/date/0/date.rbs +2 -2
- data/stdlib/logger/0/manifest.yaml +2 -0
- data/stdlib/net-http/0/manifest.yaml +2 -0
- data/stdlib/openssl/0/manifest.yaml +2 -0
- data/stdlib/prime/0/manifest.yaml +2 -0
- data/stdlib/resolv/0/manifest.yaml +3 -0
- data/stdlib/set/0/set.rbs +3 -3
- data/stdlib/uri/0/common.rbs +10 -5
- data/stdlib/uri/0/ftp.rbs +10 -0
- data/stdlib/uri/0/generic.rbs +34 -34
- data/stdlib/uri/0/mailto.rbs +5 -0
- data/stdlib/uri/0/ws.rbs +10 -0
- data/stdlib/uri/0/wss.rbs +7 -0
- data/stdlib/yaml/0/manifest.yaml +3 -0
- data/steep/Gemfile.lock +10 -10
- metadata +21 -4
data/sig/validator.rbs
CHANGED
@@ -1,14 +1,50 @@
|
|
1
1
|
module RBS
|
2
2
|
class Validator
|
3
3
|
attr_reader env: Environment
|
4
|
+
|
4
5
|
attr_reader resolver: TypeNameResolver
|
5
6
|
|
6
|
-
|
7
|
+
attr_reader definition_builder: DefinitionBuilder
|
7
8
|
|
8
|
-
|
9
|
+
attr_reader type_alias_dependency: TypeAliasDependency
|
10
|
+
|
11
|
+
attr_reader type_alias_regularity: TypeAliasRegularity
|
12
|
+
|
13
|
+
def initialize: (env: Environment, resolver: TypeNameResolver) -> void
|
9
14
|
|
15
|
+
# Validates the presence of type names and type application arity match.
|
16
|
+
#
|
10
17
|
def validate_type: (Types::t, context: TypeNameResolver::context) -> void
|
11
18
|
|
19
|
+
# Validates type alias definition:
|
20
|
+
#
|
21
|
+
# - There is no circular definition between aliases
|
22
|
+
# - The type alias is _regular_
|
23
|
+
# - The generics type parameter variance annotation is consistent with respect to their usage
|
24
|
+
# - There is no circular dependencies between the generics type parameter bounds
|
25
|
+
#
|
12
26
|
def validate_type_alias: (entry: Environment::SingleEntry[TypeName, AST::Declarations::Alias]) -> void
|
27
|
+
|
28
|
+
# Validates the type parameters in generic methods.
|
29
|
+
#
|
30
|
+
def validate_method_definition: (AST::Members::MethodDefinition, type_name: TypeName) -> void
|
31
|
+
|
32
|
+
# Validates the type parameters if there is no circular dependencies between the bounds.
|
33
|
+
#
|
34
|
+
# ```rbs
|
35
|
+
# [X, Y] # OK
|
36
|
+
# [X, Y < _Foo[X]] # OK
|
37
|
+
# [X < _Foo[Y], Y] # OK
|
38
|
+
# [X < _Foo[Y], Y < _Foo[X]] # Error
|
39
|
+
# ```
|
40
|
+
#
|
41
|
+
def validate_type_params: (Array[AST::TypeParam] params, type_name: TypeName, ?method_name: Symbol?, location: Location[untyped, untyped]?) -> void
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
# Resolves relative type names to absolute type names in given context.
|
46
|
+
# Yields the type when the type name resolution using `#resolver` fails.
|
47
|
+
#
|
48
|
+
def absolute_type: (Types::t, context: TypeNameResolver::context) { (Types::t) -> TypeName } -> Types::t
|
13
49
|
end
|
14
50
|
end
|
data/sig/variance_calculator.rbs
CHANGED
@@ -1,7 +1,47 @@
|
|
1
1
|
module RBS
|
2
|
+
# Calculate the use variances of type variables in declaration.
|
3
|
+
#
|
4
|
+
# ```rb
|
5
|
+
# calculator = VarianceCalculator.new(builder: builder)
|
6
|
+
#
|
7
|
+
# # Calculates variances in a method type
|
8
|
+
# result = calculator.in_method_type(method_type: method_type, variables: variables)
|
9
|
+
#
|
10
|
+
# # Calculates variances in a inheritance/mixin/...
|
11
|
+
# result = calculator.in_inherit(name: name, args: args, variables: variables)
|
12
|
+
#
|
13
|
+
# # Calculates variances in a type alias
|
14
|
+
# result = calculator.in_type_alias(name: name, args: args, variables: variables)
|
15
|
+
# ```
|
16
|
+
#
|
17
|
+
# See `RBS::VarianceCaluculator::Result` for information recorded in the `Result` object.
|
18
|
+
#
|
2
19
|
class VarianceCalculator
|
3
20
|
type variance = :unused | :covariant | :contravariant | :invariant
|
4
21
|
|
22
|
+
# Result contains the set of type variables and it's variance in a occurrence.
|
23
|
+
#
|
24
|
+
# ```rb
|
25
|
+
# # Enumerates recorded type variables
|
26
|
+
# result.each do |name, variance|
|
27
|
+
# # name is the name of a type variable
|
28
|
+
# # variance is one of :unused | :covariant | :contravariant | :invariant
|
29
|
+
# end
|
30
|
+
# ```
|
31
|
+
#
|
32
|
+
# You can test with `compatible?` method if the type variable occurrences are compatible with specified (annotated) variance.
|
33
|
+
#
|
34
|
+
# ```rb
|
35
|
+
# # When T is declared as `out T`
|
36
|
+
# result.compatible?(:T, with_annotation: :covariant)
|
37
|
+
#
|
38
|
+
# # When T is declared as `in T`
|
39
|
+
# result.compatible?(:T, with_annotation: :contravariant)
|
40
|
+
#
|
41
|
+
# # When T is declared as `T`
|
42
|
+
# result.compatible?(:T, with_annotation: :invariant)
|
43
|
+
# ```
|
44
|
+
#
|
5
45
|
class Result
|
6
46
|
attr_reader result: Hash[Symbol, variance]
|
7
47
|
|
@@ -18,6 +58,8 @@ module RBS
|
|
18
58
|
def include?: (Symbol) -> bool
|
19
59
|
|
20
60
|
def compatible?: (Symbol, with_annotation: variance) -> bool
|
61
|
+
|
62
|
+
def incompatible?: (Array[AST::TypeParam]) -> Set[Symbol]?
|
21
63
|
end
|
22
64
|
|
23
65
|
attr_reader builder: DefinitionBuilder
|
@@ -30,6 +72,14 @@ module RBS
|
|
30
72
|
|
31
73
|
def in_inherit: (name: TypeName, args: Array[Types::t], variables: Array[Symbol]) -> Result
|
32
74
|
|
75
|
+
def in_type_alias: (name: TypeName) -> Result
|
76
|
+
|
77
|
+
private
|
78
|
+
|
33
79
|
def type: (Types::t, result: Result, context: variance) -> void
|
80
|
+
|
81
|
+
def function: (Types::Function, result: Result, context: variance) -> void
|
82
|
+
|
83
|
+
def negate: (variance) -> variance
|
34
84
|
end
|
35
85
|
end
|
data/sig/writer.rbs
CHANGED
@@ -27,7 +27,7 @@ module RBS
|
|
27
27
|
|
28
28
|
def write_member: (AST::Declarations::Module::member) -> void
|
29
29
|
|
30
|
-
def name_and_params: (TypeName, AST::
|
30
|
+
def name_and_params: (TypeName, Array[AST::TypeParam]) -> String?
|
31
31
|
|
32
32
|
def name_and_args: (TypeName, Array[Types::t]) -> String?
|
33
33
|
|
data/stdlib/date/0/date.rbs
CHANGED
@@ -446,7 +446,7 @@ class Date
|
|
446
446
|
# DateTime.jd(0,12) + DateTime.new(2001,2,3).ajd
|
447
447
|
# #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
|
448
448
|
#
|
449
|
-
def +: (
|
449
|
+
def +: ((Numeric & _ToR) other) -> Date
|
450
450
|
|
451
451
|
# Returns the difference between the two dates if the other is a date object.
|
452
452
|
# If the other is a numeric value, returns a date object pointing `other` days
|
@@ -461,7 +461,7 @@ class Date
|
|
461
461
|
# DateTime.new(2001,2,3) - DateTime.new(2001,2,2,12)
|
462
462
|
# #=> (1/2)
|
463
463
|
#
|
464
|
-
def -: (
|
464
|
+
def -: ((Numeric & _ToR) other) -> Date
|
465
465
|
| (Date other) -> Rational
|
466
466
|
|
467
467
|
# Returns a date object pointing `n` months before self. The argument `n` should
|
data/stdlib/set/0/set.rbs
CHANGED
@@ -122,7 +122,7 @@ class Set[A]
|
|
122
122
|
#
|
123
123
|
# See also Enumerable#include?
|
124
124
|
#
|
125
|
-
def include?: (
|
125
|
+
def include?: (A) -> bool
|
126
126
|
|
127
127
|
alias member? include?
|
128
128
|
|
@@ -168,12 +168,12 @@ class Set[A]
|
|
168
168
|
# Deletes the given object from the set and returns self. Use `subtract` to
|
169
169
|
# delete many items at once.
|
170
170
|
#
|
171
|
-
def delete: (
|
171
|
+
def delete: (A) -> self
|
172
172
|
|
173
173
|
# Deletes the given object from the set and returns self. If the object is not
|
174
174
|
# in the set, returns nil.
|
175
175
|
#
|
176
|
-
def delete?: (
|
176
|
+
def delete?: (A) -> self?
|
177
177
|
|
178
178
|
# Deletes every element of the set for which block evaluates to true, and
|
179
179
|
# returns self. Returns an enumerator if no block is given.
|
data/stdlib/uri/0/common.rbs
CHANGED
@@ -154,7 +154,7 @@ module URI
|
|
154
154
|
#
|
155
155
|
# See URI.encode_www_form_component, URI.decode_www_form.
|
156
156
|
#
|
157
|
-
def self.encode_www_form: (Enumerable[[ _ToS, _ToS ]] enum, ?encoding enc) -> String
|
157
|
+
def self.encode_www_form: (Enumerable[[ _ToS, _ToS ]] enum, ?encoding? enc) -> String
|
158
158
|
|
159
159
|
# Encodes given `str` to URL-encoded form data.
|
160
160
|
#
|
@@ -168,7 +168,7 @@ module URI
|
|
168
168
|
#
|
169
169
|
# See URI.decode_www_form_component, URI.encode_www_form.
|
170
170
|
#
|
171
|
-
def self.encode_www_form_component: (
|
171
|
+
def self.encode_www_form_component: (_ToS str, ?encoding? enc) -> String
|
172
172
|
|
173
173
|
# ## Synopsis
|
174
174
|
#
|
@@ -268,7 +268,7 @@ module URI
|
|
268
268
|
# It's recommended to first ::escape the provided `uri_str` if there are any
|
269
269
|
# invalid URI characters.
|
270
270
|
#
|
271
|
-
def self.parse: (
|
271
|
+
def self.parse: (_ToStr uri) -> (File | FTP | HTTP | HTTPS | LDAP | LDAPS | MailTo | WS | WSS | Generic)
|
272
272
|
|
273
273
|
# ## Synopsis
|
274
274
|
#
|
@@ -302,12 +302,17 @@ module URI
|
|
302
302
|
# p $&
|
303
303
|
# end
|
304
304
|
#
|
305
|
-
def self.regexp: (?Array[String] schemes) -> Regexp
|
305
|
+
def self.regexp: (?Array[String]? schemes) -> Regexp
|
306
306
|
|
307
307
|
# Returns a Hash of the defined schemes.
|
308
308
|
#
|
309
309
|
def self.scheme_list: () -> Hash[String, Class]
|
310
310
|
|
311
|
+
# Construct a URI instance, using the scheme to detect the appropriate class
|
312
|
+
# from +URI.scheme_list+.
|
313
|
+
#
|
314
|
+
def self.for: (String scheme, *untyped arguments, ?default: Class) -> (File | FTP | HTTP | HTTPS | LDAP | LDAPS | MailTo | WS | WSS | Generic)
|
315
|
+
|
311
316
|
# ## Synopsis
|
312
317
|
#
|
313
318
|
# URI::split(uri)
|
@@ -340,7 +345,7 @@ module URI
|
|
340
345
|
# URI.split("http://www.ruby-lang.org/")
|
341
346
|
# # => ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]
|
342
347
|
#
|
343
|
-
def self.split: (
|
348
|
+
def self.split: (_ToStr uri) -> [ String?, String?, String?, String?, nil, String?, String?, String?, String? ]
|
344
349
|
end
|
345
350
|
|
346
351
|
URI::ABS_PATH: Regexp
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module URI
|
2
|
+
# FTP URI syntax is defined by RFC1738 section 3.2.
|
3
|
+
#
|
4
|
+
# This class will be redesigned because of difference of implementations;
|
5
|
+
# the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it
|
6
|
+
# is a good summary about the de facto spec.
|
7
|
+
# http://tools.ietf.org/html/draft-hoffman-ftp-uri-04
|
8
|
+
class FTP < Generic
|
9
|
+
end
|
10
|
+
end
|
data/stdlib/uri/0/generic.rbs
CHANGED
@@ -193,14 +193,14 @@ module URI
|
|
193
193
|
#
|
194
194
|
# Creates a new URI::Generic instance from ``generic'' components without check.
|
195
195
|
#
|
196
|
-
def initialize: (String scheme, String userinfo, String host, Integer port,
|
196
|
+
def initialize: (String? scheme, String? userinfo, String? host, (String | Integer)? port, nil registry, String? path, String? opaque, String? query, String? fragment, ?untyped parser, ?boolish arg_check) -> void
|
197
197
|
|
198
198
|
#
|
199
199
|
# Returns the scheme component of the URI.
|
200
200
|
#
|
201
201
|
# URI("http://foo/bar/baz").scheme #=> "http"
|
202
202
|
#
|
203
|
-
attr_reader scheme: String
|
203
|
+
attr_reader scheme: String?
|
204
204
|
|
205
205
|
# Returns the host component of the URI.
|
206
206
|
#
|
@@ -222,14 +222,14 @@ module URI
|
|
222
222
|
# URI("http://[::1]/bar/baz").host #=> "[::1]"
|
223
223
|
# URI("http://[::1]/bar/baz").hostname #=> "::1"
|
224
224
|
#
|
225
|
-
attr_reader host: String
|
225
|
+
attr_reader host: String?
|
226
226
|
|
227
227
|
# Returns the port component of the URI.
|
228
228
|
#
|
229
229
|
# URI("http://foo/bar/baz").port #=> 80
|
230
230
|
# URI("http://foo:8080/bar/baz").port #=> 8080
|
231
231
|
#
|
232
|
-
attr_reader port: Integer
|
232
|
+
attr_reader port: Integer?
|
233
233
|
|
234
234
|
def registry: () -> nil
|
235
235
|
|
@@ -237,13 +237,13 @@ module URI
|
|
237
237
|
#
|
238
238
|
# URI("http://foo/bar/baz").path #=> "/bar/baz"
|
239
239
|
#
|
240
|
-
attr_reader path: String
|
240
|
+
attr_reader path: String?
|
241
241
|
|
242
242
|
# Returns the query component of the URI.
|
243
243
|
#
|
244
244
|
# URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar"
|
245
245
|
#
|
246
|
-
attr_reader query: String
|
246
|
+
attr_reader query: String?
|
247
247
|
|
248
248
|
# Returns the opaque part of the URI.
|
249
249
|
#
|
@@ -280,13 +280,13 @@ module URI
|
|
280
280
|
#
|
281
281
|
# Checks the scheme +v+ component against the URI::Parser Regexp for :SCHEME.
|
282
282
|
#
|
283
|
-
def check_scheme: (String v) -> true
|
283
|
+
def check_scheme: (String? v) -> true
|
284
284
|
|
285
285
|
# Protected setter for the scheme component +v+.
|
286
286
|
#
|
287
287
|
# See also URI::Generic.scheme=.
|
288
288
|
#
|
289
|
-
def set_scheme: (String v) -> String
|
289
|
+
def set_scheme: (String? v) -> String?
|
290
290
|
|
291
291
|
#
|
292
292
|
# == Args
|
@@ -309,7 +309,7 @@ module URI
|
|
309
309
|
# uri.scheme = "https"
|
310
310
|
# uri.to_s #=> "https://my.example.com"
|
311
311
|
#
|
312
|
-
def scheme=: (String v) -> String
|
312
|
+
def scheme=: (String? v) -> String?
|
313
313
|
|
314
314
|
#
|
315
315
|
# Checks the +user+ and +password+.
|
@@ -338,12 +338,12 @@ module URI
|
|
338
338
|
# Can not have a registry or opaque component defined,
|
339
339
|
# with a user component defined.
|
340
340
|
#
|
341
|
-
def check_password: (String v, ?String user) -> (String | true)
|
341
|
+
def check_password: (String? v, ?String user) -> (String? | true)
|
342
342
|
|
343
343
|
#
|
344
344
|
# Sets userinfo, argument is string like 'name:pass'.
|
345
345
|
#
|
346
|
-
def userinfo=: (String? userinfo) ->
|
346
|
+
def userinfo=: (String? userinfo) -> String?
|
347
347
|
|
348
348
|
#
|
349
349
|
# == Args
|
@@ -366,7 +366,7 @@ module URI
|
|
366
366
|
# uri.user = "sam"
|
367
367
|
# uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com"
|
368
368
|
#
|
369
|
-
def user=: (String user) -> String
|
369
|
+
def user=: (String? user) -> String?
|
370
370
|
|
371
371
|
#
|
372
372
|
# == Args
|
@@ -389,26 +389,26 @@ module URI
|
|
389
389
|
# uri.password = "V3ry_S3nsit1ve"
|
390
390
|
# uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com"
|
391
391
|
#
|
392
|
-
def password=: (String password) -> String
|
392
|
+
def password=: (String? password) -> String?
|
393
393
|
|
394
394
|
# Protected setter for the +user+ component, and +password+ if available
|
395
395
|
# (with validation).
|
396
396
|
#
|
397
397
|
# See also URI::Generic.userinfo=.
|
398
398
|
#
|
399
|
-
def set_userinfo: (String user, ?String? password) ->
|
399
|
+
def set_userinfo: (String? user, ?String? password) -> [String?, String?]
|
400
400
|
|
401
401
|
# Protected setter for the user component +v+.
|
402
402
|
#
|
403
403
|
# See also URI::Generic.user=.
|
404
404
|
#
|
405
|
-
def set_user: (String v) -> String
|
405
|
+
def set_user: (String? v) -> String?
|
406
406
|
|
407
407
|
# Protected setter for the password component +v+.
|
408
408
|
#
|
409
409
|
# See also URI::Generic.password=.
|
410
410
|
#
|
411
|
-
def set_password: (String v) -> String
|
411
|
+
def set_password: (String? v) -> String?
|
412
412
|
|
413
413
|
# Returns the userinfo +ui+ as <code>[user, password]</code>
|
414
414
|
# if properly formatted as 'user:password'.
|
@@ -421,10 +421,10 @@ module URI
|
|
421
421
|
def userinfo: () -> String?
|
422
422
|
|
423
423
|
# Returns the user component.
|
424
|
-
def user: () -> String
|
424
|
+
def user: () -> String?
|
425
425
|
|
426
426
|
# Returns the password component.
|
427
|
-
def password: () -> String
|
427
|
+
def password: () -> String?
|
428
428
|
|
429
429
|
#
|
430
430
|
# Checks the host +v+ component for RFC2396 compliance
|
@@ -433,13 +433,13 @@ module URI
|
|
433
433
|
# Can not have a registry or opaque component defined,
|
434
434
|
# with a host component defined.
|
435
435
|
#
|
436
|
-
def check_host: (String v) ->
|
436
|
+
def check_host: (String? v) -> true?
|
437
437
|
|
438
438
|
# Protected setter for the host component +v+.
|
439
439
|
#
|
440
440
|
# See also URI::Generic.host=.
|
441
441
|
#
|
442
|
-
def set_host: (String v) -> String
|
442
|
+
def set_host: (String? v) -> String?
|
443
443
|
|
444
444
|
#
|
445
445
|
# == Args
|
@@ -462,7 +462,7 @@ module URI
|
|
462
462
|
# uri.host = "foo.com"
|
463
463
|
# uri.to_s #=> "http://foo.com"
|
464
464
|
#
|
465
|
-
def host=: (String v) -> String
|
465
|
+
def host=: (String? v) -> String?
|
466
466
|
|
467
467
|
# Extract the host part of the URI and unwrap brackets for IPv6 addresses.
|
468
468
|
#
|
@@ -473,7 +473,7 @@ module URI
|
|
473
473
|
# uri.hostname #=> "::1"
|
474
474
|
# uri.host #=> "[::1]"
|
475
475
|
#
|
476
|
-
def hostname: () -> String
|
476
|
+
def hostname: () -> String?
|
477
477
|
|
478
478
|
# Sets the host part of the URI as the argument with brackets for IPv6 addresses.
|
479
479
|
#
|
@@ -487,7 +487,7 @@ module URI
|
|
487
487
|
# If the argument seems to be an IPv6 address,
|
488
488
|
# it is wrapped with brackets.
|
489
489
|
#
|
490
|
-
def hostname=: (String v) -> String
|
490
|
+
def hostname=: (String? v) -> String?
|
491
491
|
|
492
492
|
#
|
493
493
|
# Checks the port +v+ component for RFC2396 compliance
|
@@ -496,13 +496,13 @@ module URI
|
|
496
496
|
# Can not have a registry or opaque component defined,
|
497
497
|
# with a port component defined.
|
498
498
|
#
|
499
|
-
def check_port: (Integer v) ->
|
499
|
+
def check_port: ((String | Integer)? v) -> true?
|
500
500
|
|
501
501
|
# Protected setter for the port component +v+.
|
502
502
|
#
|
503
503
|
# See also URI::Generic.port=.
|
504
504
|
#
|
505
|
-
def set_port: (Integer v) -> Integer
|
505
|
+
def set_port: ((String | Integer)? v) -> (String | Integer)?
|
506
506
|
|
507
507
|
#
|
508
508
|
# == Args
|
@@ -525,7 +525,7 @@ module URI
|
|
525
525
|
# uri.port = 8080
|
526
526
|
# uri.to_s #=> "http://my.example.com:8080"
|
527
527
|
#
|
528
|
-
def port=: (Integer v) -> Integer
|
528
|
+
def port=: ((String | Integer)? v) -> (String | Integer)?
|
529
529
|
|
530
530
|
def check_registry: (String v) -> nil
|
531
531
|
|
@@ -541,13 +541,13 @@ module URI
|
|
541
541
|
# Can not have a opaque component defined,
|
542
542
|
# with a path component defined.
|
543
543
|
#
|
544
|
-
def check_path: (String v) -> true
|
544
|
+
def check_path: (String? v) -> true
|
545
545
|
|
546
546
|
# Protected setter for the path component +v+.
|
547
547
|
#
|
548
548
|
# See also URI::Generic.path=.
|
549
549
|
#
|
550
|
-
def set_path: (String v) -> String
|
550
|
+
def set_path: (String? v) -> String?
|
551
551
|
|
552
552
|
#
|
553
553
|
# == Args
|
@@ -570,7 +570,7 @@ module URI
|
|
570
570
|
# uri.path = "/faq/"
|
571
571
|
# uri.to_s #=> "http://my.example.com/faq/"
|
572
572
|
#
|
573
|
-
def path=: (String v) -> String
|
573
|
+
def path=: (String? v) -> String?
|
574
574
|
|
575
575
|
#
|
576
576
|
# == Args
|
@@ -590,7 +590,7 @@ module URI
|
|
590
590
|
# uri.query = "id=1"
|
591
591
|
# uri.to_s #=> "http://my.example.com/?id=1"
|
592
592
|
#
|
593
|
-
def query=: (String v) -> String
|
593
|
+
def query=: (String? v) -> String?
|
594
594
|
|
595
595
|
#
|
596
596
|
# Checks the opaque +v+ component for RFC2396 compliance and
|
@@ -599,13 +599,13 @@ module URI
|
|
599
599
|
# Can not have a host, port, user, or path component defined,
|
600
600
|
# with an opaque component defined.
|
601
601
|
#
|
602
|
-
def check_opaque: (String v) ->
|
602
|
+
def check_opaque: (String? v) -> true?
|
603
603
|
|
604
604
|
# Protected setter for the opaque component +v+.
|
605
605
|
#
|
606
606
|
# See also URI::Generic.opaque=.
|
607
607
|
#
|
608
|
-
def set_opaque: (String v) -> String
|
608
|
+
def set_opaque: (String? v) -> String?
|
609
609
|
|
610
610
|
#
|
611
611
|
# == Args
|
@@ -620,7 +620,7 @@ module URI
|
|
620
620
|
#
|
621
621
|
# See also URI::Generic.check_opaque.
|
622
622
|
#
|
623
|
-
def opaque=: (String v) -> String
|
623
|
+
def opaque=: (String? v) -> String?
|
624
624
|
|
625
625
|
#
|
626
626
|
# Checks the fragment +v+ component against the URI::Parser Regexp for :FRAGMENT.
|
@@ -644,7 +644,7 @@ module URI
|
|
644
644
|
# uri.fragment = "time=1305212086"
|
645
645
|
# uri.to_s #=> "http://my.example.com/?id=25#time=1305212086"
|
646
646
|
#
|
647
|
-
def fragment=: (String v) -> String
|
647
|
+
def fragment=: (String? v) -> String?
|
648
648
|
|
649
649
|
#
|
650
650
|
# Returns true if URI is hierarchical.
|
data/stdlib/uri/0/ws.rbs
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
module URI
|
2
|
+
# The syntax of WS URIs is defined in RFC6455 section 3.
|
3
|
+
#
|
4
|
+
# Note that the Ruby URI library allows WS URLs containing usernames and
|
5
|
+
# passwords. This is not legal as per the RFC, but used to be
|
6
|
+
# supported in Internet Explorer 5 and 6, before the MS04-004 security
|
7
|
+
# update. See <URL:http://support.microsoft.com/kb/834489>.
|
8
|
+
class WS < Generic
|
9
|
+
end
|
10
|
+
end
|
data/steep/Gemfile.lock
CHANGED
@@ -9,37 +9,37 @@ GEM
|
|
9
9
|
zeitwerk (~> 2.3)
|
10
10
|
ast (2.4.2)
|
11
11
|
concurrent-ruby (1.1.9)
|
12
|
-
ffi (1.15.
|
13
|
-
i18n (1.8.
|
12
|
+
ffi (1.15.4)
|
13
|
+
i18n (1.8.11)
|
14
14
|
concurrent-ruby (~> 1.0)
|
15
15
|
language_server-protocol (3.16.0.3)
|
16
16
|
listen (3.7.0)
|
17
17
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
18
18
|
rb-inotify (~> 0.9, >= 0.9.10)
|
19
19
|
minitest (5.14.4)
|
20
|
-
parallel (1.
|
21
|
-
parser (3.0.
|
20
|
+
parallel (1.21.0)
|
21
|
+
parser (3.0.3.1)
|
22
22
|
ast (~> 2.4.1)
|
23
23
|
rainbow (3.0.0)
|
24
24
|
rb-fsevent (0.11.0)
|
25
25
|
rb-inotify (0.10.1)
|
26
26
|
ffi (~> 1.0)
|
27
|
-
rbs (1.
|
28
|
-
steep (0.
|
27
|
+
rbs (1.7.1)
|
28
|
+
steep (0.47.0)
|
29
29
|
activesupport (>= 5.1)
|
30
30
|
language_server-protocol (>= 3.15, < 4.0)
|
31
31
|
listen (~> 3.0)
|
32
32
|
parallel (>= 1.0.0)
|
33
33
|
parser (>= 3.0)
|
34
34
|
rainbow (>= 2.2.2, < 4.0)
|
35
|
-
rbs (
|
35
|
+
rbs (~> 1.7.0)
|
36
36
|
terminal-table (>= 2, < 4)
|
37
|
-
terminal-table (3.0.
|
37
|
+
terminal-table (3.0.2)
|
38
38
|
unicode-display_width (>= 1.1.1, < 3)
|
39
39
|
tzinfo (2.0.4)
|
40
40
|
concurrent-ruby (~> 1.0)
|
41
|
-
unicode-display_width (2.
|
42
|
-
zeitwerk (2.
|
41
|
+
unicode-display_width (2.1.0)
|
42
|
+
zeitwerk (2.5.1)
|
43
43
|
|
44
44
|
PLATFORMS
|
45
45
|
ruby
|