rbs 2.0.0 → 2.1.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 +5 -0
- data/CHANGELOG.md +23 -0
- data/README.md +6 -1
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +472 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1059 -139
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2315 -316
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/cli.rb +45 -1
- data/lib/rbs/definition_builder.rb +5 -1
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +59 -0
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1146 -144
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/net-http.rbs +1492 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +420 -106
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +556 -327
- data/stdlib/uri/0/http.rbs +26 -115
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +17 -5
- data/lib/rbs/location.rb +0 -221
data/stdlib/uri/0/common.rbs
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# <!-- rdoc-file=lib/uri.rb -->
|
1
2
|
# URI is a module providing classes to handle Uniform Resource Identifiers
|
2
3
|
# ([RFC2396](http://tools.ietf.org/html/rfc2396)).
|
3
4
|
#
|
@@ -30,7 +31,7 @@
|
|
30
31
|
# class RSYNC < Generic
|
31
32
|
# DEFAULT_PORT = 873
|
32
33
|
# end
|
33
|
-
#
|
34
|
+
# register_scheme 'RSYNC', RSYNC
|
34
35
|
# end
|
35
36
|
# #=> URI::RSYNC
|
36
37
|
#
|
@@ -75,7 +76,6 @@
|
|
75
76
|
# * URI::REGEXP::PATTERN - (in uri/common.rb)
|
76
77
|
#
|
77
78
|
# * URI::Util - (in uri/common.rb)
|
78
|
-
# * URI::Escape - (in uri/common.rb)
|
79
79
|
# * URI::Error - (in uri/common.rb)
|
80
80
|
# * URI::InvalidURIError - (in uri/common.rb)
|
81
81
|
# * URI::InvalidComponentError - (in uri/common.rb)
|
@@ -93,12 +93,14 @@
|
|
93
93
|
# License
|
94
94
|
# : Copyright (c) 2001 akira yamada <akira@ruby-lang.org> You can redistribute
|
95
95
|
# it and/or modify it under the same term as Ruby.
|
96
|
-
# Revision
|
97
|
-
# : $Id$
|
98
96
|
#
|
99
97
|
module URI
|
100
98
|
include URI::RFC2396_REGEXP
|
101
99
|
|
100
|
+
# <!--
|
101
|
+
# rdoc-file=lib/uri/common.rb
|
102
|
+
# - decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false)
|
103
|
+
# -->
|
102
104
|
# Decodes URL-encoded form data from given `str`.
|
103
105
|
#
|
104
106
|
# This decodes application/x-www-form-urlencoded data and returns an array of
|
@@ -118,6 +120,10 @@ module URI
|
|
118
120
|
#
|
119
121
|
def self.decode_www_form: (String str, ?encoding enc, ?isindex: boolish, ?use__charset_: boolish, ?separator: String) -> Array[[ String, String ]]
|
120
122
|
|
123
|
+
# <!--
|
124
|
+
# rdoc-file=lib/uri/common.rb
|
125
|
+
# - decode_www_form_component(str, enc=Encoding::UTF_8)
|
126
|
+
# -->
|
121
127
|
# Decodes given `str` of URL-encoded form data.
|
122
128
|
#
|
123
129
|
# This decodes + to SP.
|
@@ -126,6 +132,10 @@ module URI
|
|
126
132
|
#
|
127
133
|
def self.decode_www_form_component: (String str, ?encoding enc) -> String
|
128
134
|
|
135
|
+
# <!--
|
136
|
+
# rdoc-file=lib/uri/common.rb
|
137
|
+
# - encode_www_form(enum, enc=nil)
|
138
|
+
# -->
|
129
139
|
# Generates URL-encoded form data from given `enum`.
|
130
140
|
#
|
131
141
|
# This generates application/x-www-form-urlencoded data defined in HTML5 from
|
@@ -141,7 +151,7 @@ module URI
|
|
141
151
|
# This method doesn't handle files. When you send a file, use
|
142
152
|
# multipart/form-data.
|
143
153
|
#
|
144
|
-
# This refers
|
154
|
+
# This refers https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
145
155
|
#
|
146
156
|
# URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
|
147
157
|
# #=> "q=ruby&lang=en"
|
@@ -156,6 +166,10 @@ module URI
|
|
156
166
|
#
|
157
167
|
def self.encode_www_form: (Enumerable[[ _ToS, _ToS ]] enum, ?encoding? enc) -> String
|
158
168
|
|
169
|
+
# <!--
|
170
|
+
# rdoc-file=lib/uri/common.rb
|
171
|
+
# - encode_www_form_component(str, enc=nil)
|
172
|
+
# -->
|
159
173
|
# Encodes given `str` to URL-encoded form data.
|
160
174
|
#
|
161
175
|
# This method doesn't convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP
|
@@ -164,12 +178,16 @@ module URI
|
|
164
178
|
# If `enc` is given, convert `str` to the encoding before percent encoding.
|
165
179
|
#
|
166
180
|
# This is an implementation of
|
167
|
-
#
|
181
|
+
# https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data.
|
168
182
|
#
|
169
183
|
# See URI.decode_www_form_component, URI.encode_www_form.
|
170
184
|
#
|
171
185
|
def self.encode_www_form_component: (_ToS str, ?encoding? enc) -> String
|
172
186
|
|
187
|
+
# <!--
|
188
|
+
# rdoc-file=lib/uri/common.rb
|
189
|
+
# - extract(str, schemes = nil, &block)
|
190
|
+
# -->
|
173
191
|
# ## Synopsis
|
174
192
|
#
|
175
193
|
# URI::extract(str[, schemes][,&blk])
|
@@ -199,6 +217,10 @@ module URI
|
|
199
217
|
|
200
218
|
def self.get_encoding: (String label) -> Encoding?
|
201
219
|
|
220
|
+
# <!--
|
221
|
+
# rdoc-file=lib/uri/common.rb
|
222
|
+
# - join(*str)
|
223
|
+
# -->
|
202
224
|
# ## Synopsis
|
203
225
|
#
|
204
226
|
# URI::join(str[, str, ...])
|
@@ -234,6 +256,10 @@ module URI
|
|
234
256
|
#
|
235
257
|
def self.join: (String str, *String strs) -> URI::Generic
|
236
258
|
|
259
|
+
# <!--
|
260
|
+
# rdoc-file=lib/uri/common.rb
|
261
|
+
# - parse(uri)
|
262
|
+
# -->
|
237
263
|
# ## Synopsis
|
238
264
|
#
|
239
265
|
# URI::parse(uri_str)
|
@@ -270,6 +296,10 @@ module URI
|
|
270
296
|
#
|
271
297
|
def self.parse: (_ToStr uri) -> (File | FTP | HTTP | HTTPS | LDAP | LDAPS | MailTo | WS | WSS | Generic)
|
272
298
|
|
299
|
+
# <!--
|
300
|
+
# rdoc-file=lib/uri/common.rb
|
301
|
+
# - regexp(schemes = nil)
|
302
|
+
# -->
|
273
303
|
# ## Synopsis
|
274
304
|
#
|
275
305
|
# URI::regexp([match_schemes])
|
@@ -285,7 +315,7 @@ module URI
|
|
285
315
|
#
|
286
316
|
# Returns a Regexp object which matches to URI-like strings. The Regexp object
|
287
317
|
# returned by this method includes arbitrary number of capture group
|
288
|
-
# (parentheses). Never rely on
|
318
|
+
# (parentheses). Never rely on its number.
|
289
319
|
#
|
290
320
|
# ## Usage
|
291
321
|
#
|
@@ -304,15 +334,27 @@ module URI
|
|
304
334
|
#
|
305
335
|
def self.regexp: (?Array[String]? schemes) -> Regexp
|
306
336
|
|
337
|
+
# <!--
|
338
|
+
# rdoc-file=lib/uri/common.rb
|
339
|
+
# - scheme_list()
|
340
|
+
# -->
|
307
341
|
# Returns a Hash of the defined schemes.
|
308
342
|
#
|
309
343
|
def self.scheme_list: () -> Hash[String, Class]
|
310
344
|
|
345
|
+
# <!--
|
346
|
+
# rdoc-file=lib/uri/common.rb
|
347
|
+
# - for(scheme, *arguments, default: Generic)
|
348
|
+
# -->
|
311
349
|
# Construct a URI instance, using the scheme to detect the appropriate class
|
312
|
-
# from
|
350
|
+
# from `URI.scheme_list`.
|
313
351
|
#
|
314
352
|
def self.for: (String scheme, *untyped arguments, ?default: Class) -> (File | FTP | HTTP | HTTPS | LDAP | LDAPS | MailTo | WS | WSS | Generic)
|
315
353
|
|
354
|
+
# <!--
|
355
|
+
# rdoc-file=lib/uri/common.rb
|
356
|
+
# - split(uri)
|
357
|
+
# -->
|
316
358
|
# ## Synopsis
|
317
359
|
#
|
318
360
|
# URI::split(uri)
|
@@ -354,7 +396,9 @@ URI::ABS_URI: Regexp
|
|
354
396
|
|
355
397
|
URI::ABS_URI_REF: Regexp
|
356
398
|
|
399
|
+
# <!-- rdoc-file=lib/uri/common.rb -->
|
357
400
|
# URI::Parser.new
|
401
|
+
#
|
358
402
|
URI::DEFAULT_PARSER: URI::RFC2396_Parser
|
359
403
|
|
360
404
|
URI::ESCAPED: Regexp
|
@@ -397,9 +441,14 @@ URI::VERSION_CODE: String
|
|
397
441
|
|
398
442
|
URI::WEB_ENCODINGS_: Hash[String, String]
|
399
443
|
|
444
|
+
%a{annotate:rdoc:skip}
|
400
445
|
module Kernel
|
401
446
|
private
|
402
447
|
|
448
|
+
# <!--
|
449
|
+
# rdoc-file=lib/uri/common.rb
|
450
|
+
# - URI(uri)
|
451
|
+
# -->
|
403
452
|
# Returns `uri` converted to an URI object.
|
404
453
|
#
|
405
454
|
def self?.URI: (URI::Generic | String uri) -> URI::Generic
|
data/stdlib/uri/0/file.rbs
CHANGED
@@ -1,127 +1,34 @@
|
|
1
|
-
|
2
|
-
# ([RFC2396](http://tools.ietf.org/html/rfc2396)).
|
3
|
-
#
|
4
|
-
# ## Features
|
5
|
-
#
|
6
|
-
# * Uniform way of handling URIs.
|
7
|
-
# * Flexibility to introduce custom URI schemes.
|
8
|
-
# * Flexibility to have an alternate URI::Parser (or just different patterns
|
9
|
-
# and regexp's).
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# ## Basic example
|
13
|
-
#
|
14
|
-
# require 'uri'
|
15
|
-
#
|
16
|
-
# uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
|
17
|
-
# #=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
|
18
|
-
#
|
19
|
-
# uri.scheme #=> "http"
|
20
|
-
# uri.host #=> "foo.com"
|
21
|
-
# uri.path #=> "/posts"
|
22
|
-
# uri.query #=> "id=30&limit=5"
|
23
|
-
# uri.fragment #=> "time=1305298413"
|
24
|
-
#
|
25
|
-
# uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
|
26
|
-
#
|
27
|
-
# ## Adding custom URIs
|
28
|
-
#
|
29
|
-
# module URI
|
30
|
-
# class RSYNC < Generic
|
31
|
-
# DEFAULT_PORT = 873
|
32
|
-
# end
|
33
|
-
# @@schemes['RSYNC'] = RSYNC
|
34
|
-
# end
|
35
|
-
# #=> URI::RSYNC
|
36
|
-
#
|
37
|
-
# URI.scheme_list
|
38
|
-
# #=> {"FILE"=>URI::File, "FTP"=>URI::FTP, "HTTP"=>URI::HTTP,
|
39
|
-
# # "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "LDAPS"=>URI::LDAPS,
|
40
|
-
# # "MAILTO"=>URI::MailTo, "RSYNC"=>URI::RSYNC}
|
41
|
-
#
|
42
|
-
# uri = URI("rsync://rsync.foo.com")
|
43
|
-
# #=> #<URI::RSYNC rsync://rsync.foo.com>
|
44
|
-
#
|
45
|
-
# ## RFC References
|
46
|
-
#
|
47
|
-
# A good place to view an RFC spec is http://www.ietf.org/rfc.html.
|
48
|
-
#
|
49
|
-
# Here is a list of all related RFC's:
|
50
|
-
# * [RFC822](http://tools.ietf.org/html/rfc822)
|
51
|
-
# * [RFC1738](http://tools.ietf.org/html/rfc1738)
|
52
|
-
# * [RFC2255](http://tools.ietf.org/html/rfc2255)
|
53
|
-
# * [RFC2368](http://tools.ietf.org/html/rfc2368)
|
54
|
-
# * [RFC2373](http://tools.ietf.org/html/rfc2373)
|
55
|
-
# * [RFC2396](http://tools.ietf.org/html/rfc2396)
|
56
|
-
# * [RFC2732](http://tools.ietf.org/html/rfc2732)
|
57
|
-
# * [RFC3986](http://tools.ietf.org/html/rfc3986)
|
58
|
-
#
|
59
|
-
#
|
60
|
-
# ## Class tree
|
61
|
-
#
|
62
|
-
# * URI::Generic (in uri/generic.rb)
|
63
|
-
# * URI::File - (in uri/file.rb)
|
64
|
-
# * URI::FTP - (in uri/ftp.rb)
|
65
|
-
# * URI::HTTP - (in uri/http.rb)
|
66
|
-
# * URI::HTTPS - (in uri/https.rb)
|
67
|
-
#
|
68
|
-
# * URI::LDAP - (in uri/ldap.rb)
|
69
|
-
# * URI::LDAPS - (in uri/ldaps.rb)
|
70
|
-
#
|
71
|
-
# * URI::MailTo - (in uri/mailto.rb)
|
72
|
-
#
|
73
|
-
# * URI::Parser - (in uri/common.rb)
|
74
|
-
# * URI::REGEXP - (in uri/common.rb)
|
75
|
-
# * URI::REGEXP::PATTERN - (in uri/common.rb)
|
76
|
-
#
|
77
|
-
# * URI::Util - (in uri/common.rb)
|
78
|
-
# * URI::Escape - (in uri/common.rb)
|
79
|
-
# * URI::Error - (in uri/common.rb)
|
80
|
-
# * URI::InvalidURIError - (in uri/common.rb)
|
81
|
-
# * URI::InvalidComponentError - (in uri/common.rb)
|
82
|
-
# * URI::BadURIError - (in uri/common.rb)
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
# ## Copyright Info
|
87
|
-
#
|
88
|
-
# Author
|
89
|
-
# : Akira Yamada <akira@ruby-lang.org>
|
90
|
-
# Documentation
|
91
|
-
# : Akira Yamada <akira@ruby-lang.org> Dmitry V. Sabanin <sdmitry@lrn.ru>
|
92
|
-
# Vincent Batts <vbatts@hashbangbash.com>
|
93
|
-
# License
|
94
|
-
# : Copyright (c) 2001 akira yamada <akira@ruby-lang.org> You can redistribute
|
95
|
-
# it and/or modify it under the same term as Ruby.
|
96
|
-
# Revision
|
97
|
-
# : $Id$
|
98
|
-
#
|
99
|
-
#
|
1
|
+
%a{annotate:rdoc:skip}
|
100
2
|
module URI
|
101
|
-
#
|
3
|
+
# <!-- rdoc-file=lib/uri/file.rb -->
|
102
4
|
# The "file" URI is defined by RFC8089.
|
103
5
|
#
|
104
6
|
class File < Generic
|
7
|
+
# <!-- rdoc-file=lib/uri/file.rb -->
|
105
8
|
# A Default port of nil for URI::File.
|
9
|
+
#
|
106
10
|
DEFAULT_PORT: Integer?
|
107
11
|
|
108
|
-
#
|
12
|
+
# <!-- rdoc-file=lib/uri/file.rb -->
|
109
13
|
# An Array of the available components for URI::File.
|
110
14
|
#
|
111
15
|
COMPONENT: Array[Symbol]
|
112
16
|
|
113
|
-
#
|
114
|
-
#
|
17
|
+
# <!--
|
18
|
+
# rdoc-file=lib/uri/file.rb
|
19
|
+
# - build(args)
|
20
|
+
# -->
|
21
|
+
# ## Description
|
115
22
|
#
|
116
23
|
# Creates a new URI::File object from components, with syntax checking.
|
117
24
|
#
|
118
|
-
# The components accepted are
|
25
|
+
# The components accepted are `host` and `path`.
|
119
26
|
#
|
120
|
-
# The components should be provided either as an Array, or as a Hash
|
121
|
-
#
|
27
|
+
# The components should be provided either as an Array, or as a Hash with keys
|
28
|
+
# formed by preceding the component names with a colon.
|
122
29
|
#
|
123
|
-
# If an Array is used, the components must be passed in the
|
124
|
-
#
|
30
|
+
# If an Array is used, the components must be passed in the order `[host,
|
31
|
+
# path]`.
|
125
32
|
#
|
126
33
|
# Examples:
|
127
34
|
#
|
@@ -137,31 +44,70 @@ module URI
|
|
137
44
|
def self.build: (Array[String] args) -> URI::File
|
138
45
|
| ({ host: String, path: String }) -> URI::File
|
139
46
|
|
140
|
-
#
|
47
|
+
# <!--
|
48
|
+
# rdoc-file=lib/uri/file.rb
|
49
|
+
# - set_host(v)
|
50
|
+
# -->
|
51
|
+
# Protected setter for the host component `v`.
|
141
52
|
#
|
142
53
|
# See also URI::Generic.host=.
|
143
54
|
#
|
144
55
|
def set_host: (String? v) -> String
|
145
56
|
|
57
|
+
# <!--
|
58
|
+
# rdoc-file=lib/uri/file.rb
|
59
|
+
# - set_port(v)
|
60
|
+
# -->
|
146
61
|
# do nothing
|
62
|
+
#
|
147
63
|
def set_port: (Integer v) -> nil
|
148
64
|
|
65
|
+
# <!--
|
66
|
+
# rdoc-file=lib/uri/file.rb
|
67
|
+
# - check_userinfo(user)
|
68
|
+
# -->
|
149
69
|
# raise InvalidURIError
|
70
|
+
#
|
150
71
|
def check_userinfo: (String user) -> nil
|
151
72
|
|
73
|
+
# <!--
|
74
|
+
# rdoc-file=lib/uri/file.rb
|
75
|
+
# - check_user(user)
|
76
|
+
# -->
|
152
77
|
# raise InvalidURIError
|
78
|
+
#
|
153
79
|
def check_user: (String user) -> nil
|
154
80
|
|
81
|
+
# <!--
|
82
|
+
# rdoc-file=lib/uri/file.rb
|
83
|
+
# - check_password(user)
|
84
|
+
# -->
|
155
85
|
# raise InvalidURIError
|
86
|
+
#
|
156
87
|
def check_password: (String user) -> nil
|
157
88
|
|
89
|
+
# <!--
|
90
|
+
# rdoc-file=lib/uri/file.rb
|
91
|
+
# - set_userinfo(v)
|
92
|
+
# -->
|
158
93
|
# do nothing
|
94
|
+
#
|
159
95
|
def set_userinfo: (String v) -> nil
|
160
96
|
|
97
|
+
# <!--
|
98
|
+
# rdoc-file=lib/uri/file.rb
|
99
|
+
# - set_user(v)
|
100
|
+
# -->
|
161
101
|
# do nothing
|
102
|
+
#
|
162
103
|
def set_user: (String v) -> nil
|
163
104
|
|
105
|
+
# <!--
|
106
|
+
# rdoc-file=lib/uri/file.rb
|
107
|
+
# - set_password(v)
|
108
|
+
# -->
|
164
109
|
# do nothing
|
110
|
+
#
|
165
111
|
def set_password: (String v) -> nil
|
166
112
|
end
|
167
113
|
end
|
data/stdlib/uri/0/ftp.rbs
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
+
%a{annotate:rdoc:skip}
|
1
2
|
module URI
|
3
|
+
# <!-- rdoc-file=lib/uri/ftp.rb -->
|
2
4
|
# FTP URI syntax is defined by RFC1738 section 3.2.
|
3
5
|
#
|
4
|
-
# This class will be redesigned because of difference of implementations;
|
5
|
-
#
|
6
|
-
#
|
6
|
+
# This class will be redesigned because of difference of implementations; the
|
7
|
+
# structure of its path. draft-hoffman-ftp-uri-04 is a draft but it is a good
|
8
|
+
# summary about the de facto spec.
|
7
9
|
# http://tools.ietf.org/html/draft-hoffman-ftp-uri-04
|
10
|
+
#
|
8
11
|
class FTP < Generic
|
9
12
|
end
|
10
13
|
end
|