rbs 2.0.0 → 2.2.2
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 +4 -4
- data/.github/workflows/comments.yml +34 -0
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +82 -0
- data/README.md +6 -1
- data/Rakefile +56 -21
- 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 +1214 -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 +1060 -142
- 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 +2319 -318
- 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/docs/syntax.md +54 -11
- data/ext/rbs_extension/extconf.rb +1 -0
- data/ext/rbs_extension/lexer.h +5 -0
- data/ext/rbs_extension/lexstate.c +6 -0
- data/ext/rbs_extension/parser.c +85 -10
- data/ext/rbs_extension/ruby_objs.c +4 -2
- data/ext/rbs_extension/ruby_objs.h +2 -2
- data/goodcheck.yml +0 -11
- 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/ast/members.rb +21 -13
- data/lib/rbs/buffer.rb +17 -11
- data/lib/rbs/cli.rb +48 -1
- data/lib/rbs/definition_builder/method_builder.rb +28 -16
- data/lib/rbs/definition_builder.rb +6 -2
- data/lib/rbs/environment.rb +8 -4
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/namespace.rb +1 -1
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/type_alias_regularity.rb +6 -4
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/types.rb +1 -1
- data/lib/rbs/validator.rb +6 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +54 -4
- data/lib/rbs.rb +0 -2
- data/schema/typeParam.json +3 -3
- 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/buffer.rbs +6 -2
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/members.rbs +24 -18
- data/sig/method_builder.rbs +5 -4
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/sig/validator.rbs +3 -1
- data/sig/writer.rbs +79 -2
- 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 +649 -21
- 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 +1147 -145
- 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/manifest.yaml +1 -0
- data/stdlib/net-http/0/net-http.rbs +1513 -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 +423 -109
- 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 +558 -329
- data/stdlib/uri/0/http.rbs +60 -114
- 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 +18 -6
- data/lib/rbs/location.rb +0 -221
- data/sig/char_scanner.rbs +0 -9
data/stdlib/uri/0/ldaps.rbs
CHANGED
|
@@ -1,108 +1,14 @@
|
|
|
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
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
3
|
+
# <!-- rdoc-file=lib/uri/ldaps.rb -->
|
|
4
|
+
# The default port for LDAPS URIs is 636, and the scheme is 'ldaps:' rather than
|
|
5
|
+
# 'ldap:'. Other than that, LDAPS URIs are identical to LDAP URIs; see
|
|
6
|
+
# URI::LDAP.
|
|
7
|
+
#
|
|
104
8
|
class LDAPS < LDAP
|
|
9
|
+
# <!-- rdoc-file=lib/uri/ldaps.rb -->
|
|
105
10
|
# A Default port of 636 for URI::LDAPS
|
|
11
|
+
#
|
|
106
12
|
DEFAULT_PORT: Integer
|
|
107
13
|
end
|
|
108
14
|
end
|
data/stdlib/uri/0/mailto.rbs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
%a{annotate:rdoc:skip}
|
|
1
2
|
module URI
|
|
3
|
+
# <!-- rdoc-file=lib/uri/rfc2396_parser.rb -->
|
|
2
4
|
# Includes URI::REGEXP::PATTERN
|
|
3
5
|
#
|
|
4
6
|
module RFC2396_REGEXP
|
|
5
7
|
end
|
|
6
8
|
|
|
9
|
+
# <!-- rdoc-file=lib/uri/rfc2396_parser.rb -->
|
|
7
10
|
# Class that parses String's into URI's.
|
|
8
11
|
#
|
|
9
12
|
# It contains a Hash set of patterns and Regexp's that match and validate.
|
|
@@ -11,57 +14,67 @@ module URI
|
|
|
11
14
|
class RFC2396_Parser
|
|
12
15
|
include RFC2396_REGEXP
|
|
13
16
|
|
|
17
|
+
# <!-- rdoc-file=lib/uri/rfc2396_parser.rb -->
|
|
14
18
|
# The Hash of patterns.
|
|
15
19
|
#
|
|
16
20
|
# See also URI::Parser.initialize_pattern.
|
|
17
21
|
#
|
|
18
22
|
attr_reader pattern: Hash[Symbol, String]
|
|
19
23
|
|
|
24
|
+
# <!-- rdoc-file=lib/uri/rfc2396_parser.rb -->
|
|
20
25
|
# The Hash of Regexp.
|
|
21
26
|
#
|
|
22
27
|
# See also URI::Parser.initialize_regexp.
|
|
23
28
|
#
|
|
24
29
|
attr_reader regexp: Hash[Symbol, Regexp]
|
|
25
30
|
|
|
26
|
-
#
|
|
31
|
+
# <!--
|
|
32
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
33
|
+
# - new(opts = {})
|
|
34
|
+
# -->
|
|
35
|
+
# ## Synopsis
|
|
27
36
|
#
|
|
28
|
-
#
|
|
37
|
+
# URI::Parser.new([opts])
|
|
29
38
|
#
|
|
30
|
-
#
|
|
39
|
+
# ## Args
|
|
31
40
|
#
|
|
32
|
-
# The constructor accepts a hash as options for parser.
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
# The constructor generates set of regexps for parsing URIs.
|
|
41
|
+
# The constructor accepts a hash as options for parser. Keys of options are
|
|
42
|
+
# pattern names of URI components and values of options are pattern strings. The
|
|
43
|
+
# constructor generates set of regexps for parsing URIs.
|
|
36
44
|
#
|
|
37
45
|
# You can use the following keys:
|
|
38
46
|
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
47
|
+
# * :ESCAPED (URI::PATTERN::ESCAPED in default)
|
|
48
|
+
# * :UNRESERVED (URI::PATTERN::UNRESERVED in default)
|
|
49
|
+
# * :DOMLABEL (URI::PATTERN::DOMLABEL in default)
|
|
50
|
+
# * :TOPLABEL (URI::PATTERN::TOPLABEL in default)
|
|
51
|
+
# * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
|
|
44
52
|
#
|
|
45
|
-
#
|
|
53
|
+
# ## Examples
|
|
46
54
|
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
55
|
+
# p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
|
|
56
|
+
# u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD>
|
|
57
|
+
# URI.parse(u.to_s) #=> raises URI::InvalidURIError
|
|
50
58
|
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
59
|
+
# s = "http://example.com/ABCD"
|
|
60
|
+
# u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
|
|
61
|
+
# u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
|
|
62
|
+
# u1 == u2 #=> true
|
|
63
|
+
# u1.eql?(u2) #=> false
|
|
56
64
|
#
|
|
57
65
|
def initialize: (?Hash[Symbol, String] opts) -> void
|
|
58
66
|
|
|
67
|
+
# <!--
|
|
68
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
69
|
+
# - escape( str )
|
|
70
|
+
# - escape( str, unsafe )
|
|
71
|
+
# -->
|
|
59
72
|
# ## Args
|
|
60
73
|
#
|
|
61
74
|
# `str`
|
|
62
75
|
# : String to make safe
|
|
63
76
|
# `unsafe`
|
|
64
|
-
# : Regexp to apply. Defaults to
|
|
77
|
+
# : Regexp to apply. Defaults to `self.regexp[:UNSAFE]`
|
|
65
78
|
#
|
|
66
79
|
#
|
|
67
80
|
# ## Description
|
|
@@ -71,6 +84,12 @@ module URI
|
|
|
71
84
|
#
|
|
72
85
|
def escape: (String str, ?Regexp unsafe) -> String
|
|
73
86
|
|
|
87
|
+
# <!--
|
|
88
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
89
|
+
# - extract( str )
|
|
90
|
+
# - extract( str, schemes )
|
|
91
|
+
# - extract( str, schemes ) {|item| block }
|
|
92
|
+
# -->
|
|
74
93
|
# ## Args
|
|
75
94
|
#
|
|
76
95
|
# `str`
|
|
@@ -89,6 +108,10 @@ module URI
|
|
|
89
108
|
def extract: (String str, ?Array[String] schemes) -> Array[String]
|
|
90
109
|
| (String str, ?Array[String] schemes) { (String) -> untyped } -> nil
|
|
91
110
|
|
|
111
|
+
# <!--
|
|
112
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
113
|
+
# - join(*uris)
|
|
114
|
+
# -->
|
|
92
115
|
# ## Args
|
|
93
116
|
#
|
|
94
117
|
# `uris`
|
|
@@ -101,11 +124,19 @@ module URI
|
|
|
101
124
|
#
|
|
102
125
|
def join: (*String uris) -> URI::Generic
|
|
103
126
|
|
|
104
|
-
#
|
|
105
|
-
#
|
|
127
|
+
# <!--
|
|
128
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
129
|
+
# - make_regexp(schemes = nil)
|
|
130
|
+
# -->
|
|
131
|
+
# Returns Regexp that is default `self.regexp[:ABS_URI_REF]`, unless `schemes`
|
|
132
|
+
# is provided. Then it is a Regexp.union with `self.pattern[:X_ABS_URI]`.
|
|
106
133
|
#
|
|
107
134
|
def make_regexp: (?Array[String] schemes) -> Regexp
|
|
108
135
|
|
|
136
|
+
# <!--
|
|
137
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
138
|
+
# - parse(uri)
|
|
139
|
+
# -->
|
|
109
140
|
# ## Args
|
|
110
141
|
#
|
|
111
142
|
# `uri`
|
|
@@ -125,16 +156,25 @@ module URI
|
|
|
125
156
|
#
|
|
126
157
|
def parse: (String uri) -> URI::Generic
|
|
127
158
|
|
|
128
|
-
#
|
|
159
|
+
# <!--
|
|
160
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
161
|
+
# - split(uri)
|
|
162
|
+
# -->
|
|
163
|
+
# Returns a split URI against `regexp[:ABS_URI]`.
|
|
129
164
|
#
|
|
130
165
|
def split: (String uri) -> [ String?, String?, String?, String?, String?, String?, String?, String?, String? ]
|
|
131
166
|
|
|
167
|
+
# <!--
|
|
168
|
+
# rdoc-file=lib/uri/rfc2396_parser.rb
|
|
169
|
+
# - unescape( str )
|
|
170
|
+
# - unescape( str, escaped )
|
|
171
|
+
# -->
|
|
132
172
|
# ## Args
|
|
133
173
|
#
|
|
134
174
|
# `str`
|
|
135
175
|
# : String to remove escapes from
|
|
136
176
|
# `escaped`
|
|
137
|
-
# : Regexp to apply. Defaults to
|
|
177
|
+
# : Regexp to apply. Defaults to `self.regexp[:ESCAPED]`
|
|
138
178
|
#
|
|
139
179
|
#
|
|
140
180
|
# ## Description
|
data/stdlib/uri/0/ws.rbs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
%a{annotate:rdoc:skip}
|
|
1
2
|
module URI
|
|
3
|
+
# <!-- rdoc-file=lib/uri/ws.rb -->
|
|
2
4
|
# The syntax of WS URIs is defined in RFC6455 section 3.
|
|
3
5
|
#
|
|
4
6
|
# 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
|
-
#
|
|
7
|
-
#
|
|
7
|
+
# passwords. This is not legal as per the RFC, but used to be supported in
|
|
8
|
+
# Internet Explorer 5 and 6, before the MS04-004 security update. See
|
|
9
|
+
# <URL:http://support.microsoft.com/kb/834489>.
|
|
10
|
+
#
|
|
8
11
|
class WS < Generic
|
|
9
12
|
end
|
|
10
13
|
end
|
data/stdlib/uri/0/wss.rbs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
%a{annotate:rdoc:skip}
|
|
1
2
|
module URI
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
# see URI::WS.
|
|
3
|
+
# <!-- rdoc-file=lib/uri/wss.rb -->
|
|
4
|
+
# The default port for WSS URIs is 443, and the scheme is 'wss:' rather than
|
|
5
|
+
# 'ws:'. Other than that, WSS URIs are identical to WS URIs; see URI::WS.
|
|
6
|
+
#
|
|
5
7
|
class WSS < WS
|
|
6
8
|
end
|
|
7
9
|
end
|
data/stdlib/yaml/0/dbm.rbs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# <!-- rdoc-file=lib/yaml.rb -->
|
|
1
2
|
# YAML Ain't Markup Language
|
|
2
3
|
#
|
|
3
4
|
# This module provides a Ruby interface for data serialization in YAML format.
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
#
|
|
28
29
|
# ## History
|
|
29
30
|
#
|
|
30
|
-
# Syck was the original
|
|
31
|
-
#
|
|
31
|
+
# Syck was the original YAML implementation in Ruby's standard library developed
|
|
32
|
+
# by why the lucky stiff.
|
|
32
33
|
#
|
|
33
34
|
# You can still use Syck, if you prefer, for parsing and emitting YAML, but you
|
|
34
35
|
# must install the 'syck' gem now in order to use it.
|
|
@@ -47,175 +48,238 @@
|
|
|
47
48
|
# Syck can also be found on github: https://github.com/ruby/syck
|
|
48
49
|
#
|
|
49
50
|
module YAML
|
|
51
|
+
# <!-- rdoc-file=lib/yaml/dbm.rb -->
|
|
50
52
|
# YAML + DBM = YDBM
|
|
51
53
|
#
|
|
52
54
|
# YAML::DBM provides the same interface as ::DBM.
|
|
53
55
|
#
|
|
54
|
-
# However, while DBM only allows strings for both keys and values,
|
|
55
|
-
#
|
|
56
|
-
#
|
|
56
|
+
# However, while DBM only allows strings for both keys and values, this library
|
|
57
|
+
# allows one to use most Ruby objects for values by first converting them to
|
|
58
|
+
# YAML. Keys must be strings.
|
|
57
59
|
#
|
|
58
60
|
# Conversion to and from YAML is performed automatically.
|
|
59
61
|
#
|
|
60
62
|
# See the documentation for ::DBM and ::YAML for more information.
|
|
63
|
+
#
|
|
61
64
|
class DBM < ::DBM
|
|
62
65
|
VERSION: ::String
|
|
63
66
|
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
67
|
+
# <!--
|
|
68
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
69
|
+
# - ydbm[key] -> value
|
|
70
|
+
# -->
|
|
71
|
+
# Return value associated with `key` from database.
|
|
68
72
|
#
|
|
69
|
-
# Returns
|
|
73
|
+
# Returns `nil` if there is no such `key`.
|
|
70
74
|
#
|
|
71
75
|
# See #fetch for more information.
|
|
76
|
+
#
|
|
72
77
|
def []: (String key) -> untyped
|
|
73
78
|
|
|
74
|
-
#
|
|
75
|
-
#
|
|
76
|
-
#
|
|
77
|
-
#
|
|
79
|
+
# <!--
|
|
80
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
81
|
+
# - ydbm[key] = value
|
|
82
|
+
# -->
|
|
83
|
+
# Set `key` to `value` in database.
|
|
78
84
|
#
|
|
79
|
-
#
|
|
85
|
+
# `value` will be converted to YAML before storage.
|
|
80
86
|
#
|
|
81
87
|
# See #store for more information.
|
|
88
|
+
#
|
|
82
89
|
def []=: (String key, untyped val) -> untyped
|
|
83
90
|
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
# ydbm.fetch( key
|
|
87
|
-
#
|
|
88
|
-
#
|
|
91
|
+
# <!--
|
|
92
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
93
|
+
# - ydbm.fetch( key, ifnone = nil )
|
|
94
|
+
# - ydbm.fetch( key ) { |key| ... }
|
|
95
|
+
# -->
|
|
96
|
+
# Return value associated with `key`.
|
|
89
97
|
#
|
|
90
|
-
# If there is no value for
|
|
98
|
+
# If there is no value for `key` and no block is given, returns `ifnone`.
|
|
91
99
|
#
|
|
92
|
-
# Otherwise, calls block passing in the given
|
|
100
|
+
# Otherwise, calls block passing in the given `key`.
|
|
93
101
|
#
|
|
94
102
|
# See ::DBM#fetch for more information.
|
|
103
|
+
#
|
|
95
104
|
def fetch: (String keystr, ?untyped? ifnone) { (untyped) -> untyped } -> untyped
|
|
96
105
|
|
|
106
|
+
# <!--
|
|
107
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
108
|
+
# - index( keystr )
|
|
109
|
+
# -->
|
|
97
110
|
# Deprecated, used YAML::DBM#key instead.
|
|
98
|
-
#
|
|
99
|
-
# Note:
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
# behaves not same as DBM#index.
|
|
111
|
+
# ---
|
|
112
|
+
# Note: YAML::DBM#index makes warning from internal of ::DBM#index. It says
|
|
113
|
+
# 'DBM#index is deprecated; use DBM#key', but DBM#key behaves not same as
|
|
114
|
+
# DBM#index.
|
|
103
115
|
#
|
|
104
116
|
def index: (String keystr) -> untyped
|
|
105
117
|
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
#
|
|
118
|
+
# <!--
|
|
119
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
120
|
+
# - ydbm.key(value) -> string
|
|
121
|
+
# -->
|
|
109
122
|
# Returns the key for the specified value.
|
|
123
|
+
#
|
|
110
124
|
def key: (String keystr) -> String
|
|
111
125
|
|
|
112
|
-
#
|
|
113
|
-
#
|
|
114
|
-
#
|
|
126
|
+
# <!--
|
|
127
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
128
|
+
# - ydbm.values_at(*keys)
|
|
129
|
+
# -->
|
|
115
130
|
# Returns an array containing the values associated with the given keys.
|
|
131
|
+
#
|
|
116
132
|
def values_at: (*untyped keys) -> Array[untyped]
|
|
117
133
|
|
|
118
|
-
#
|
|
119
|
-
#
|
|
134
|
+
# <!--
|
|
135
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
136
|
+
# - ydbm.delete(key)
|
|
137
|
+
# -->
|
|
138
|
+
# Deletes value from database associated with `key`.
|
|
120
139
|
#
|
|
121
|
-
#
|
|
140
|
+
# Returns value or `nil`.
|
|
122
141
|
#
|
|
123
|
-
# Returns value or +nil+.
|
|
124
142
|
def delete: (String key) -> untyped
|
|
125
143
|
|
|
144
|
+
# <!--
|
|
145
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
146
|
+
# - ydbm.delete_if { |key, value| ... }
|
|
147
|
+
# -->
|
|
148
|
+
# Calls the given block once for each `key`, `value` pair in the database.
|
|
149
|
+
# Deletes all entries for which the block returns true.
|
|
150
|
+
#
|
|
151
|
+
# Returns `self`.
|
|
152
|
+
#
|
|
126
153
|
def delete_if: () { (untyped, untyped) -> untyped } -> untyped
|
|
127
154
|
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
155
|
+
# <!--
|
|
156
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
157
|
+
# - ydbm.reject { |key, value| ... }
|
|
158
|
+
# -->
|
|
131
159
|
# Converts the contents of the database to an in-memory Hash, then calls
|
|
132
160
|
# Hash#reject with the specified code block, returning a new Hash.
|
|
161
|
+
#
|
|
133
162
|
def reject: () { (untyped, untyped) -> untyped } -> Hash[untyped, untyped]
|
|
134
163
|
|
|
164
|
+
# <!--
|
|
165
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
166
|
+
# - ydbm.each_pair { |key, value| ... }
|
|
167
|
+
# -->
|
|
168
|
+
# Calls the given block once for each `key`, `value` pair in the database.
|
|
169
|
+
#
|
|
170
|
+
# Returns `self`.
|
|
171
|
+
#
|
|
135
172
|
def each_pair: () { (untyped, untyped) -> untyped } -> untyped
|
|
136
173
|
|
|
174
|
+
# <!--
|
|
175
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
176
|
+
# - ydbm.each_value { |value| ... }
|
|
177
|
+
# -->
|
|
178
|
+
# Calls the given block for each value in database.
|
|
179
|
+
#
|
|
180
|
+
# Returns `self`.
|
|
181
|
+
#
|
|
137
182
|
def each_value: () { (untyped) -> untyped } -> untyped
|
|
138
183
|
|
|
139
|
-
#
|
|
140
|
-
#
|
|
141
|
-
#
|
|
184
|
+
# <!--
|
|
185
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
186
|
+
# - ydbm.values
|
|
187
|
+
# -->
|
|
142
188
|
# Returns an array of values from the database.
|
|
189
|
+
#
|
|
143
190
|
def values: () -> untyped
|
|
144
191
|
|
|
145
|
-
#
|
|
146
|
-
#
|
|
192
|
+
# <!--
|
|
193
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
194
|
+
# - ydbm.has_value?(value)
|
|
195
|
+
# -->
|
|
196
|
+
# Returns true if specified `value` is found in the database.
|
|
147
197
|
#
|
|
148
|
-
# Returns true if specified +value+ is found in the database.
|
|
149
198
|
def has_value?: (untyped val) -> (::TrueClass | ::FalseClass)
|
|
150
199
|
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
#
|
|
200
|
+
# <!--
|
|
201
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
202
|
+
# - ydbm.invert -> hash
|
|
203
|
+
# -->
|
|
154
204
|
# Returns a Hash (not a DBM database) created by using each value in the
|
|
155
205
|
# database as a key, with the corresponding key as its value.
|
|
156
206
|
#
|
|
157
|
-
# Note that all values in the hash will be Strings, but the keys will be
|
|
158
|
-
#
|
|
207
|
+
# Note that all values in the hash will be Strings, but the keys will be actual
|
|
208
|
+
# objects.
|
|
209
|
+
#
|
|
159
210
|
def invert: () -> Hash[untyped, untyped]
|
|
160
211
|
|
|
161
|
-
#
|
|
162
|
-
#
|
|
163
|
-
#
|
|
212
|
+
# <!--
|
|
213
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
214
|
+
# - ydbm.replace(hash) -> ydbm
|
|
215
|
+
# -->
|
|
164
216
|
# Replaces the contents of the database with the contents of the specified
|
|
165
|
-
# object. Takes any object which implements the each_pair method, including
|
|
166
|
-
#
|
|
217
|
+
# object. Takes any object which implements the each_pair method, including Hash
|
|
218
|
+
# and DBM objects.
|
|
219
|
+
#
|
|
167
220
|
def replace: (Hash[untyped, untyped] | DBM hsh) -> YAML::DBM
|
|
168
221
|
|
|
169
|
-
#
|
|
170
|
-
#
|
|
171
|
-
#
|
|
172
|
-
#
|
|
173
|
-
#
|
|
222
|
+
# <!--
|
|
223
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
224
|
+
# - ydbm.shift -> [key, value]
|
|
225
|
+
# -->
|
|
226
|
+
# Removes a [key, value] pair from the database, and returns it. If the database
|
|
227
|
+
# is empty, returns `nil`.
|
|
174
228
|
#
|
|
175
229
|
# The order in which values are removed/returned is not guaranteed.
|
|
230
|
+
#
|
|
176
231
|
def shift: () -> (Array[untyped] | untyped)
|
|
177
232
|
|
|
178
|
-
#
|
|
179
|
-
#
|
|
180
|
-
# ydbm.select
|
|
181
|
-
#
|
|
182
|
-
#
|
|
183
|
-
#
|
|
233
|
+
# <!--
|
|
234
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
235
|
+
# - ydbm.select { |key, value| ... }
|
|
236
|
+
# - ydbm.select(*keys)
|
|
237
|
+
# -->
|
|
238
|
+
# If a block is provided, returns a new array containing [key, value] pairs for
|
|
239
|
+
# which the block returns true.
|
|
184
240
|
#
|
|
185
241
|
# Otherwise, same as #values_at
|
|
242
|
+
#
|
|
186
243
|
def select: (*untyped keys) { (untyped, untyped) -> untyped } -> Array[untyped]
|
|
187
244
|
|
|
188
|
-
#
|
|
189
|
-
#
|
|
245
|
+
# <!--
|
|
246
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
247
|
+
# - ydbm.store(key, value) -> value
|
|
248
|
+
# -->
|
|
249
|
+
# Stores `value` in database with `key` as the index. `value` is converted to
|
|
250
|
+
# YAML before being stored.
|
|
190
251
|
#
|
|
191
|
-
#
|
|
192
|
-
# to YAML before being stored.
|
|
252
|
+
# Returns `value`
|
|
193
253
|
#
|
|
194
|
-
# Returns +value+
|
|
195
254
|
def store: (String key, untyped val) -> untyped
|
|
196
255
|
|
|
197
|
-
#
|
|
198
|
-
#
|
|
256
|
+
# <!--
|
|
257
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
258
|
+
# - ydbm.update(hash) -> ydbm
|
|
259
|
+
# -->
|
|
260
|
+
# Updates the database with multiple values from the specified object. Takes any
|
|
261
|
+
# object which implements the each_pair method, including Hash and DBM objects.
|
|
199
262
|
#
|
|
200
|
-
#
|
|
201
|
-
# Takes any object which implements the each_pair method, including
|
|
202
|
-
# Hash and DBM objects.
|
|
263
|
+
# Returns `self`.
|
|
203
264
|
#
|
|
204
|
-
# Returns +self+.
|
|
205
265
|
def update: (Hash[untyped, untyped]) -> YAML::DBM
|
|
206
266
|
|
|
207
|
-
#
|
|
208
|
-
#
|
|
267
|
+
# <!--
|
|
268
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
269
|
+
# - ydbm.to_a -> array
|
|
270
|
+
# -->
|
|
271
|
+
# Converts the contents of the database to an array of [key, value] arrays, and
|
|
272
|
+
# returns it.
|
|
209
273
|
#
|
|
210
|
-
|
|
211
|
-
# and returns it.
|
|
212
|
-
def to_a: () -> Array [untyped]
|
|
274
|
+
def to_a: () -> Array[untyped]
|
|
213
275
|
|
|
214
|
-
#
|
|
215
|
-
#
|
|
276
|
+
# <!--
|
|
277
|
+
# rdoc-file=lib/yaml/dbm.rb
|
|
278
|
+
# - ydbm.to_hash -> hash
|
|
279
|
+
# -->
|
|
280
|
+
# Converts the contents of the database to an in-memory Hash object, and returns
|
|
281
|
+
# it.
|
|
216
282
|
#
|
|
217
|
-
# Converts the contents of the database to an in-memory Hash object, and
|
|
218
|
-
# returns it.
|
|
219
283
|
def to_hash: () -> Hash[untyped, untyped]
|
|
220
284
|
end
|
|
221
285
|
end
|