phlex-stimulus 0.1.0

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.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +16 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +341 -0
  6. data/Rakefile +12 -0
  7. data/lib/generators/phlex/stimulus/controller/USAGE +5 -0
  8. data/lib/generators/phlex/stimulus/controller/controller_generator.rb +49 -0
  9. data/lib/generators/phlex/stimulus/controller/templates/component.rb.erb +30 -0
  10. data/lib/generators/phlex/stimulus/controller/templates/controller.ts.erb +23 -0
  11. data/lib/generators/phlex/stimulus/generator_mixin.rb +21 -0
  12. data/lib/generators/phlex/stimulus/install/USAGE +5 -0
  13. data/lib/generators/phlex/stimulus/install/install_generator.rb +111 -0
  14. data/lib/generators/phlex/stimulus/install/templates/app/components/base.rb.erb +29 -0
  15. data/lib/generators/phlex/stimulus/install/templates/app/components/chain_controller.rb.erb +29 -0
  16. data/lib/generators/phlex/stimulus/install/templates/app/components/classlist_controller.rb.erb +30 -0
  17. data/lib/generators/phlex/stimulus/install/templates/app/components/controller.rb.erb +10 -0
  18. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_chain.rb.erb +32 -0
  19. data/lib/generators/phlex/stimulus/install/templates/app/components/controller_template.rb.erb +24 -0
  20. data/lib/generators/phlex/stimulus/install/templates/app/components/log_controller.rb.erb +33 -0
  21. data/lib/generators/phlex/stimulus/install/templates/app/components/sleep_controller.rb.erb +30 -0
  22. data/lib/generators/phlex/stimulus/install/templates/app/components.rb.erb +7 -0
  23. data/lib/generators/phlex/stimulus/install/templates/app/javascript/application.ts.erb +5 -0
  24. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/application.ts.erb +10 -0
  25. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chain_controller.ts.erb +32 -0
  26. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/chainable_controller.ts.erb +44 -0
  27. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/classlist_controller.ts.erb +30 -0
  28. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/index.ts.erb +4 -0
  29. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/log_controller.ts.erb +25 -0
  30. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/sleep_controller.ts.erb +19 -0
  31. data/lib/generators/phlex/stimulus/install/templates/app/javascript/controllers/typed_controller.ts.erb +53 -0
  32. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/misc.ts.erb +37 -0
  33. data/lib/generators/phlex/stimulus/install/templates/app/javascript/utils/template.ts.erb +11 -0
  34. data/lib/phlex/stimulus/components/base.rb +81 -0
  35. data/lib/phlex/stimulus/components/controller.rb +170 -0
  36. data/lib/phlex/stimulus/components.rb +9 -0
  37. data/lib/phlex/stimulus/version.rb +8 -0
  38. data/lib/phlex/stimulus.rb +15 -0
  39. data/sorbet/config +7 -0
  40. data/sorbet/rbi/annotations/.gitattributes +1 -0
  41. data/sorbet/rbi/annotations/actionmailer.rbi +15 -0
  42. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  43. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  44. data/sorbet/rbi/annotations/activejob.rbi +50 -0
  45. data/sorbet/rbi/annotations/activemodel.rbi +119 -0
  46. data/sorbet/rbi/annotations/activerecord.rbi +172 -0
  47. data/sorbet/rbi/annotations/activesupport.rbi +561 -0
  48. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  49. data/sorbet/rbi/annotations/minitest.rbi +116 -0
  50. data/sorbet/rbi/annotations/railties.rbi +104 -0
  51. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  52. data/sorbet/rbi/dsl/.gitattributes +1 -0
  53. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  54. data/sorbet/rbi/gems/.gitattributes +1 -0
  55. data/sorbet/rbi/gems/action_text-trix@2.1.19.rbi +9 -0
  56. data/sorbet/rbi/gems/actioncable@8.1.3.rbi +9 -0
  57. data/sorbet/rbi/gems/actionmailbox@8.1.3.rbi +9 -0
  58. data/sorbet/rbi/gems/actionmailer@8.1.3.rbi +9 -0
  59. data/sorbet/rbi/gems/actionpack@8.1.3.rbi +20478 -0
  60. data/sorbet/rbi/gems/actiontext@8.1.3.rbi +9 -0
  61. data/sorbet/rbi/gems/actionview@8.1.3.rbi +14722 -0
  62. data/sorbet/rbi/gems/activejob@8.1.3.rbi +9 -0
  63. data/sorbet/rbi/gems/activemodel@8.1.3.rbi +9 -0
  64. data/sorbet/rbi/gems/activerecord@8.1.3.rbi +9 -0
  65. data/sorbet/rbi/gems/activestorage@8.1.3.rbi +9 -0
  66. data/sorbet/rbi/gems/activesupport@8.1.3.rbi +20153 -0
  67. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  68. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  69. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  70. data/sorbet/rbi/gems/booleans@0.1.3.rbi +31 -0
  71. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  72. data/sorbet/rbi/gems/byebug@12.0.0.rbi +49 -0
  73. data/sorbet/rbi/gems/concurrent-ruby@1.3.8.rbi +10656 -0
  74. data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
  75. data/sorbet/rbi/gems/crass@1.0.7.rbi +648 -0
  76. data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
  77. data/sorbet/rbi/gems/drb@2.2.3.rbi +9 -0
  78. data/sorbet/rbi/gems/erb@6.0.6.rbi +1600 -0
  79. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  80. data/sorbet/rbi/gems/globalid@1.4.0.rbi +9 -0
  81. data/sorbet/rbi/gems/i18n@1.15.2.rbi +2285 -0
  82. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  83. data/sorbet/rbi/gems/json@2.21.1.rbi +2289 -0
  84. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  85. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  86. data/sorbet/rbi/gems/loofah@2.25.2.rbi +1134 -0
  87. data/sorbet/rbi/gems/mail@2.9.1.rbi +9 -0
  88. data/sorbet/rbi/gems/marcel@1.2.1.rbi +9 -0
  89. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
  90. data/sorbet/rbi/gems/minitest@6.0.6.rbi +1482 -0
  91. data/sorbet/rbi/gems/net-imap@0.6.4.1.rbi +9 -0
  92. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
  93. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +244 -0
  94. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +9 -0
  95. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  96. data/sorbet/rbi/gems/nio4r@2.7.5.rbi +9 -0
  97. data/sorbet/rbi/gems/nokogiri@1.19.4.rbi +8168 -0
  98. data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
  99. data/sorbet/rbi/gems/phlex-rails@2.4.0.rbi +1945 -0
  100. data/sorbet/rbi/gems/phlex@2.4.1.rbi +1413 -0
  101. data/sorbet/rbi/gems/pp@0.6.4.rbi +387 -0
  102. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
  103. data/sorbet/rbi/gems/prism@1.9.0.rbi +42226 -0
  104. data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
  105. data/sorbet/rbi/gems/rack-session@2.1.2.rbi +756 -0
  106. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +681 -0
  107. data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
  108. data/sorbet/rbi/gems/rackup@2.3.1.rbi +9 -0
  109. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +517 -0
  110. data/sorbet/rbi/gems/rails-html-sanitizer@1.7.1.rbi +620 -0
  111. data/sorbet/rbi/gems/rails@8.1.3.rbi +9 -0
  112. data/sorbet/rbi/gems/railties@8.1.3.rbi +3507 -0
  113. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  114. data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
  115. data/sorbet/rbi/gems/rbi@0.4.0.rbi +5706 -0
  116. data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
  117. data/sorbet/rbi/gems/refract@1.1.0.rbi +9 -0
  118. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  119. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  120. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  121. data/sorbet/rbi/gems/rubocop-espago@1.3.0.rbi +9 -0
  122. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  123. data/sorbet/rbi/gems/rubydex@0.2.9.rbi +841 -0
  124. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  125. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +544 -0
  126. data/sorbet/rbi/gems/spoom@1.8.4.rbi +6738 -0
  127. data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3599 -0
  128. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  129. data/sorbet/rbi/gems/timeout@0.6.1.rbi +200 -0
  130. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  131. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5474 -0
  132. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  133. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  134. data/sorbet/rbi/gems/uri@1.1.1.rbi +2402 -0
  135. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  136. data/sorbet/rbi/gems/websocket-driver@0.8.2.rbi +9 -0
  137. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
  138. data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +9 -0
  139. data/sorbet/rbi/shims/gems/parser.rbi +12 -0
  140. data/sorbet/rbi/shims/gems/rails.rbi +55 -0
  141. data/sorbet/rbi/shims/gems/refract.rbi +13 -0
  142. data/sorbet/rbi/shims/gems/shoulda-context.rbi +16 -0
  143. data/sorbet/tapioca/compilers/phlex_controller.rb +80 -0
  144. data/sorbet/tapioca/config.yml +26 -0
  145. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  146. data/sorbet/tapioca/require.rb +4 -0
  147. metadata +266 -0
@@ -0,0 +1,2402 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `uri` gem.
5
+ # Please instead update this file by running `bin/tapioca gem uri`.
6
+
7
+
8
+ # module URI
9
+ #
10
+ # pkg:gem/uri#lib/uri/common.rb:895
11
+ module Kernel
12
+ include ::Booleans::KernelExtension
13
+
14
+ private
15
+
16
+ # Returns a \URI object derived from the given +uri+,
17
+ # which may be a \URI string or an existing \URI object:
18
+ #
19
+ # require 'uri'
20
+ # # Returns a new URI.
21
+ # uri = URI('http://github.com/ruby/ruby')
22
+ # # => #<URI::HTTP http://github.com/ruby/ruby>
23
+ # # Returns the given URI.
24
+ # URI(uri)
25
+ # # => #<URI::HTTP http://github.com/ruby/ruby>
26
+ #
27
+ # You must require 'uri' to use this method.
28
+ #
29
+ # pkg:gem/uri#lib/uri/common.rb:911
30
+ def URI(uri); end
31
+
32
+ class << self
33
+ # Returns a \URI object derived from the given +uri+,
34
+ # which may be a \URI string or an existing \URI object:
35
+ #
36
+ # require 'uri'
37
+ # # Returns a new URI.
38
+ # uri = URI('http://github.com/ruby/ruby')
39
+ # # => #<URI::HTTP http://github.com/ruby/ruby>
40
+ # # Returns the given URI.
41
+ # URI(uri)
42
+ # # => #<URI::HTTP http://github.com/ruby/ruby>
43
+ #
44
+ # You must require 'uri' to use this method.
45
+ #
46
+ # pkg:gem/uri#lib/uri/common.rb:921
47
+ def URI(uri); end
48
+ end
49
+ end
50
+
51
+ # URI is a module providing classes to handle Uniform Resource Identifiers
52
+ # (RFC2396[https://www.rfc-editor.org/rfc/rfc2396]).
53
+ #
54
+ # == Features
55
+ #
56
+ # * Uniform way of handling URIs.
57
+ # * Flexibility to introduce custom URI schemes.
58
+ # * Flexibility to have an alternate URI::Parser (or just different patterns
59
+ # and regexp's).
60
+ #
61
+ # == Basic example
62
+ #
63
+ # require 'uri'
64
+ #
65
+ # uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
66
+ # #=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
67
+ #
68
+ # uri.scheme #=> "http"
69
+ # uri.host #=> "foo.com"
70
+ # uri.path #=> "/posts"
71
+ # uri.query #=> "id=30&limit=5"
72
+ # uri.fragment #=> "time=1305298413"
73
+ #
74
+ # uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
75
+ #
76
+ # == Adding custom URIs
77
+ #
78
+ # module URI
79
+ # class RSYNC < Generic
80
+ # DEFAULT_PORT = 873
81
+ # end
82
+ # register_scheme 'RSYNC', RSYNC
83
+ # end
84
+ # #=> URI::RSYNC
85
+ #
86
+ # URI.scheme_list
87
+ # #=> {"FILE"=>URI::File, "FTP"=>URI::FTP, "HTTP"=>URI::HTTP,
88
+ # # "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "LDAPS"=>URI::LDAPS,
89
+ # # "MAILTO"=>URI::MailTo, "RSYNC"=>URI::RSYNC}
90
+ #
91
+ # uri = URI("rsync://rsync.foo.com")
92
+ # #=> #<URI::RSYNC rsync://rsync.foo.com>
93
+ #
94
+ # == RFC References
95
+ #
96
+ # A good place to view an RFC spec is http://www.ietf.org/rfc.html.
97
+ #
98
+ # Here is a list of all related RFC's:
99
+ # - RFC822[https://www.rfc-editor.org/rfc/rfc822]
100
+ # - RFC1738[https://www.rfc-editor.org/rfc/rfc1738]
101
+ # - RFC2255[https://www.rfc-editor.org/rfc/rfc2255]
102
+ # - RFC2368[https://www.rfc-editor.org/rfc/rfc2368]
103
+ # - RFC2373[https://www.rfc-editor.org/rfc/rfc2373]
104
+ # - RFC2396[https://www.rfc-editor.org/rfc/rfc2396]
105
+ # - RFC2732[https://www.rfc-editor.org/rfc/rfc2732]
106
+ # - RFC3986[https://www.rfc-editor.org/rfc/rfc3986]
107
+ #
108
+ # == Class tree
109
+ #
110
+ # - URI::Generic (in uri/generic.rb)
111
+ # - URI::File - (in uri/file.rb)
112
+ # - URI::FTP - (in uri/ftp.rb)
113
+ # - URI::HTTP - (in uri/http.rb)
114
+ # - URI::HTTPS - (in uri/https.rb)
115
+ # - URI::LDAP - (in uri/ldap.rb)
116
+ # - URI::LDAPS - (in uri/ldaps.rb)
117
+ # - URI::MailTo - (in uri/mailto.rb)
118
+ # - URI::Parser - (in uri/common.rb)
119
+ # - URI::REGEXP - (in uri/common.rb)
120
+ # - URI::REGEXP::PATTERN - (in uri/common.rb)
121
+ # - URI::Util - (in uri/common.rb)
122
+ # - URI::Error - (in uri/common.rb)
123
+ # - URI::InvalidURIError - (in uri/common.rb)
124
+ # - URI::InvalidComponentError - (in uri/common.rb)
125
+ # - URI::BadURIError - (in uri/common.rb)
126
+ #
127
+ # == Copyright Info
128
+ #
129
+ # Author:: Akira Yamada <akira@ruby-lang.org>
130
+ # Documentation::
131
+ # Akira Yamada <akira@ruby-lang.org>
132
+ # Dmitry V. Sabanin <sdmitry@lrn.ru>
133
+ # Vincent Batts <vbatts@hashbangbash.com>
134
+ # License::
135
+ # Copyright (c) 2001 akira yamada <akira@ruby-lang.org>
136
+ # You can redistribute it and/or modify it under the same term as Ruby.
137
+ #
138
+ # --
139
+ # = uri/common.rb
140
+ #
141
+ # Author:: Akira Yamada <akira@ruby-lang.org>
142
+ # License::
143
+ # You can redistribute it and/or modify it under the same term as Ruby.
144
+ #
145
+ # See URI for general documentation
146
+ #
147
+ # pkg:gem/uri#lib/uri.rb:90
148
+ module URI
149
+ class << self
150
+ # pkg:gem/uri#lib/uri/common.rb:50
151
+ def const_missing(const); end
152
+
153
+ # Like URI.decode_www_form_component, except that <tt>'+'</tt> is preserved.
154
+ #
155
+ # pkg:gem/uri#lib/uri/common.rb:441
156
+ def decode_uri_component(str, enc = T.unsafe(nil)); end
157
+
158
+ # Returns name/value pairs derived from the given string +str+,
159
+ # which must be an ASCII string.
160
+ #
161
+ # The method may be used to decode the body of Net::HTTPResponse object +res+
162
+ # for which <tt>res['Content-Type']</tt> is <tt>'application/x-www-form-urlencoded'</tt>.
163
+ #
164
+ # The returned data is an array of 2-element subarrays;
165
+ # each subarray is a name/value pair (both are strings).
166
+ # Each returned string has encoding +enc+,
167
+ # and has had invalid characters removed via
168
+ # {String#scrub}[https://docs.ruby-lang.org/en/master/String.html#method-i-scrub].
169
+ #
170
+ # A simple example:
171
+ #
172
+ # URI.decode_www_form('foo=0&bar=1&baz')
173
+ # # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
174
+ #
175
+ # The returned strings have certain conversions,
176
+ # similar to those performed in URI.decode_www_form_component:
177
+ #
178
+ # URI.decode_www_form('f%23o=%2F&b-r=%24&b+z=%40')
179
+ # # => [["f#o", "/"], ["b-r", "$"], ["b z", "@"]]
180
+ #
181
+ # The given string may contain consecutive separators:
182
+ #
183
+ # URI.decode_www_form('foo=0&&bar=1&&baz=2')
184
+ # # => [["foo", "0"], ["", ""], ["bar", "1"], ["", ""], ["baz", "2"]]
185
+ #
186
+ # A different separator may be specified:
187
+ #
188
+ # URI.decode_www_form('foo=0--bar=1--baz', separator: '--')
189
+ # # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
190
+ #
191
+ # pkg:gem/uri#lib/uri/common.rb:620
192
+ def decode_www_form(str, enc = T.unsafe(nil), separator: T.unsafe(nil), use__charset_: T.unsafe(nil), isindex: T.unsafe(nil)); end
193
+
194
+ # Returns a string decoded from the given \URL-encoded string +str+.
195
+ #
196
+ # The given string is first encoded as Encoding::ASCII-8BIT (using String#b),
197
+ # then decoded (as below), and finally force-encoded to the given encoding +enc+.
198
+ #
199
+ # The returned string:
200
+ #
201
+ # - Preserves:
202
+ #
203
+ # - Characters <tt>'*'</tt>, <tt>'.'</tt>, <tt>'-'</tt>, and <tt>'_'</tt>.
204
+ # - Character in ranges <tt>'a'..'z'</tt>, <tt>'A'..'Z'</tt>,
205
+ # and <tt>'0'..'9'</tt>.
206
+ #
207
+ # Example:
208
+ #
209
+ # URI.decode_www_form_component('*.-_azAZ09')
210
+ # # => "*.-_azAZ09"
211
+ #
212
+ # - Converts:
213
+ #
214
+ # - Character <tt>'+'</tt> to character <tt>' '</tt>.
215
+ # - Each "percent notation" to an ASCII character.
216
+ #
217
+ # Example:
218
+ #
219
+ # URI.decode_www_form_component('Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A')
220
+ # # => "Here are some punctuation characters: ,;?:"
221
+ #
222
+ # Related: URI.decode_uri_component (preserves <tt>'+'</tt>).
223
+ #
224
+ # pkg:gem/uri#lib/uri/common.rb:430
225
+ def decode_www_form_component(str, enc = T.unsafe(nil)); end
226
+
227
+ # Like URI.encode_www_form_component, except that <tt>' '</tt> (space)
228
+ # is encoded as <tt>'%20'</tt> (instead of <tt>'+'</tt>).
229
+ #
230
+ # pkg:gem/uri#lib/uri/common.rb:436
231
+ def encode_uri_component(str, enc = T.unsafe(nil)); end
232
+
233
+ # Returns a URL-encoded string derived from the given
234
+ # {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes]
235
+ # +enum+.
236
+ #
237
+ # The result is suitable for use as form data
238
+ # for an \HTTP request whose <tt>Content-Type</tt> is
239
+ # <tt>'application/x-www-form-urlencoded'</tt>.
240
+ #
241
+ # The returned string consists of the elements of +enum+,
242
+ # each converted to one or more URL-encoded strings,
243
+ # and all joined with character <tt>'&'</tt>.
244
+ #
245
+ # Simple examples:
246
+ #
247
+ # URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]])
248
+ # # => "foo=0&bar=1&baz=2"
249
+ # URI.encode_www_form({foo: 0, bar: 1, baz: 2})
250
+ # # => "foo=0&bar=1&baz=2"
251
+ #
252
+ # The returned string is formed using method URI.encode_www_form_component,
253
+ # which converts certain characters:
254
+ #
255
+ # URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@')
256
+ # # => "f%23o=%2F&b-r=%24&b+z=%40"
257
+ #
258
+ # When +enum+ is Array-like, each element +ele+ is converted to a field:
259
+ #
260
+ # - If +ele+ is an array of two or more elements,
261
+ # the field is formed from its first two elements
262
+ # (and any additional elements are ignored):
263
+ #
264
+ # name = URI.encode_www_form_component(ele[0], enc)
265
+ # value = URI.encode_www_form_component(ele[1], enc)
266
+ # "#{name}=#{value}"
267
+ #
268
+ # Examples:
269
+ #
270
+ # URI.encode_www_form([%w[foo bar], %w[baz bat bah]])
271
+ # # => "foo=bar&baz=bat"
272
+ # URI.encode_www_form([['foo', 0], ['bar', :baz, 'bat']])
273
+ # # => "foo=0&bar=baz"
274
+ #
275
+ # - If +ele+ is an array of one element,
276
+ # the field is formed from <tt>ele[0]</tt>:
277
+ #
278
+ # URI.encode_www_form_component(ele[0])
279
+ #
280
+ # Example:
281
+ #
282
+ # URI.encode_www_form([['foo'], [:bar], [0]])
283
+ # # => "foo&bar&0"
284
+ #
285
+ # - Otherwise the field is formed from +ele+:
286
+ #
287
+ # URI.encode_www_form_component(ele)
288
+ #
289
+ # Example:
290
+ #
291
+ # URI.encode_www_form(['foo', :bar, 0])
292
+ # # => "foo&bar&0"
293
+ #
294
+ # The elements of an Array-like +enum+ may be mixture:
295
+ #
296
+ # URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat])
297
+ # # => "foo=0&bar=1&baz&bat"
298
+ #
299
+ # When +enum+ is Hash-like,
300
+ # each +key+/+value+ pair is converted to one or more fields:
301
+ #
302
+ # - If +value+ is
303
+ # {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects],
304
+ # each element +ele+ in +value+ is paired with +key+ to form a field:
305
+ #
306
+ # name = URI.encode_www_form_component(key, enc)
307
+ # value = URI.encode_www_form_component(ele, enc)
308
+ # "#{name}=#{value}"
309
+ #
310
+ # Example:
311
+ #
312
+ # URI.encode_www_form({foo: [:bar, 1], baz: [:bat, :bam, 2]})
313
+ # # => "foo=bar&foo=1&baz=bat&baz=bam&baz=2"
314
+ #
315
+ # - Otherwise, +key+ and +value+ are paired to form a field:
316
+ #
317
+ # name = URI.encode_www_form_component(key, enc)
318
+ # value = URI.encode_www_form_component(value, enc)
319
+ # "#{name}=#{value}"
320
+ #
321
+ # Example:
322
+ #
323
+ # URI.encode_www_form({foo: 0, bar: 1, baz: 2})
324
+ # # => "foo=0&bar=1&baz=2"
325
+ #
326
+ # The elements of a Hash-like +enum+ may be mixture:
327
+ #
328
+ # URI.encode_www_form({foo: [0, 1], bar: 2})
329
+ # # => "foo=0&foo=1&bar=2"
330
+ #
331
+ # pkg:gem/uri#lib/uri/common.rb:567
332
+ def encode_www_form(enum, enc = T.unsafe(nil)); end
333
+
334
+ # Returns a URL-encoded string derived from the given string +str+.
335
+ #
336
+ # The returned string:
337
+ #
338
+ # - Preserves:
339
+ #
340
+ # - Characters <tt>'*'</tt>, <tt>'.'</tt>, <tt>'-'</tt>, and <tt>'_'</tt>.
341
+ # - Character in ranges <tt>'a'..'z'</tt>, <tt>'A'..'Z'</tt>,
342
+ # and <tt>'0'..'9'</tt>.
343
+ #
344
+ # Example:
345
+ #
346
+ # URI.encode_www_form_component('*.-_azAZ09')
347
+ # # => "*.-_azAZ09"
348
+ #
349
+ # - Converts:
350
+ #
351
+ # - Character <tt>' '</tt> to character <tt>'+'</tt>.
352
+ # - Any other character to "percent notation";
353
+ # the percent notation for character <i>c</i> is <tt>'%%%X' % c.ord</tt>.
354
+ #
355
+ # Example:
356
+ #
357
+ # URI.encode_www_form_component('Here are some punctuation characters: ,;?:')
358
+ # # => "Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A"
359
+ #
360
+ # Encoding:
361
+ #
362
+ # - If +str+ has encoding Encoding::ASCII_8BIT, argument +enc+ is ignored.
363
+ # - Otherwise +str+ is converted first to Encoding::UTF_8
364
+ # (with suitable character replacements),
365
+ # and then to encoding +enc+.
366
+ #
367
+ # In either case, the returned string has forced encoding Encoding::US_ASCII.
368
+ #
369
+ # Related: URI.encode_uri_component (encodes <tt>' '</tt> as <tt>'%20'</tt>).
370
+ #
371
+ # pkg:gem/uri#lib/uri/common.rb:397
372
+ def encode_www_form_component(str, enc = T.unsafe(nil)); end
373
+
374
+ # == Synopsis
375
+ #
376
+ # URI::extract(str[, schemes][,&blk])
377
+ #
378
+ # == Args
379
+ #
380
+ # +str+::
381
+ # String to extract URIs from.
382
+ # +schemes+::
383
+ # Limit URI matching to specific schemes.
384
+ #
385
+ # == Description
386
+ #
387
+ # Extracts URIs from a string. If block given, iterates through all matched URIs.
388
+ # Returns nil if block given or array with matches.
389
+ #
390
+ # == Usage
391
+ #
392
+ # require "uri"
393
+ #
394
+ # URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
395
+ # # => ["http://foo.example.com/bla", "mailto:test@example.com"]
396
+ #
397
+ # pkg:gem/uri#lib/uri/common.rb:301
398
+ def extract(str, schemes = T.unsafe(nil), &block); end
399
+
400
+ # Returns a new object constructed from the given +scheme+, +arguments+,
401
+ # and +default+:
402
+ #
403
+ # - The new object is an instance of <tt>URI.scheme_list[scheme.upcase]</tt>.
404
+ # - The object is initialized by calling the class initializer
405
+ # using +scheme+ and +arguments+.
406
+ # See URI::Generic.new.
407
+ #
408
+ # Examples:
409
+ #
410
+ # values = ['john.doe', 'www.example.com', '123', nil, '/forum/questions/', nil, 'tag=networking&order=newest', 'top']
411
+ # URI.for('https', *values)
412
+ # # => #<URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
413
+ # URI.for('foo', *values, default: URI::HTTP)
414
+ # # => #<URI::HTTP foo://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
415
+ #
416
+ # pkg:gem/uri#lib/uri/common.rb:187
417
+ def for(scheme, *arguments, default: T.unsafe(nil)); end
418
+
419
+ # return encoding or nil
420
+ # http://encoding.spec.whatwg.org/#concept-encoding-get
421
+ #
422
+ # pkg:gem/uri#lib/uri/common.rb:890
423
+ def get_encoding(label); end
424
+
425
+ # Merges the given URI strings +str+
426
+ # per {RFC 2396}[https://www.rfc-editor.org/rfc/rfc2396.html].
427
+ #
428
+ # Each string in +str+ is converted to an
429
+ # {RFC3986 URI}[https://www.rfc-editor.org/rfc/rfc3986.html] before being merged.
430
+ #
431
+ # Examples:
432
+ #
433
+ # URI.join("http://example.com/","main.rbx")
434
+ # # => #<URI::HTTP http://example.com/main.rbx>
435
+ #
436
+ # URI.join('http://example.com', 'foo')
437
+ # # => #<URI::HTTP http://example.com/foo>
438
+ #
439
+ # URI.join('http://example.com', '/foo', '/bar')
440
+ # # => #<URI::HTTP http://example.com/bar>
441
+ #
442
+ # URI.join('http://example.com', '/foo', 'bar')
443
+ # # => #<URI::HTTP http://example.com/bar>
444
+ #
445
+ # URI.join('http://example.com', '/foo/', 'bar')
446
+ # # => #<URI::HTTP http://example.com/foo/bar>
447
+ #
448
+ # pkg:gem/uri#lib/uri/common.rb:273
449
+ def join(*str); end
450
+
451
+ # Returns a new \URI object constructed from the given string +uri+:
452
+ #
453
+ # URI.parse('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
454
+ # # => #<URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
455
+ # URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
456
+ # # => #<URI::HTTP http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
457
+ #
458
+ # It's recommended to first URI::RFC2396_PARSER.escape string +uri+
459
+ # if it may contain invalid URI characters.
460
+ #
461
+ # pkg:gem/uri#lib/uri/common.rb:246
462
+ def parse(uri); end
463
+
464
+ # Set the default parser instance.
465
+ #
466
+ # pkg:gem/uri#lib/uri/common.rb:29
467
+ def parser=(parser = T.unsafe(nil)); end
468
+
469
+ # == Synopsis
470
+ #
471
+ # URI::regexp([match_schemes])
472
+ #
473
+ # == Args
474
+ #
475
+ # +match_schemes+::
476
+ # Array of schemes. If given, resulting regexp matches to URIs
477
+ # whose scheme is one of the match_schemes.
478
+ #
479
+ # == Description
480
+ #
481
+ # Returns a Regexp object which matches to URI-like strings.
482
+ # The Regexp object returned by this method includes arbitrary
483
+ # number of capture group (parentheses). Never rely on its number.
484
+ #
485
+ # == Usage
486
+ #
487
+ # require 'uri'
488
+ #
489
+ # # extract first URI from html_string
490
+ # html_string.slice(URI.regexp)
491
+ #
492
+ # # remove ftp URIs
493
+ # html_string.sub(URI.regexp(['ftp']), '')
494
+ #
495
+ # # You should not rely on the number of parentheses
496
+ # html_string.scan(URI.regexp) do |*matches|
497
+ # p $&
498
+ # end
499
+ #
500
+ # pkg:gem/uri#lib/uri/common.rb:338
501
+ def regexp(schemes = T.unsafe(nil)); end
502
+
503
+ # Registers the given +klass+ as the class to be instantiated
504
+ # when parsing a \URI with the given +scheme+:
505
+ #
506
+ # URI.register_scheme('MS_SEARCH', URI::Generic) # => URI::Generic
507
+ # URI.scheme_list['MS_SEARCH'] # => URI::Generic
508
+ #
509
+ # Note that after calling String#upcase on +scheme+, it must be a valid
510
+ # constant name.
511
+ #
512
+ # pkg:gem/uri#lib/uri/common.rb:143
513
+ def register_scheme(scheme, klass); end
514
+
515
+ # Returns a hash of the defined schemes:
516
+ #
517
+ # URI.scheme_list
518
+ # # =>
519
+ # {"MAILTO"=>URI::MailTo,
520
+ # "LDAPS"=>URI::LDAPS,
521
+ # "WS"=>URI::WS,
522
+ # "HTTP"=>URI::HTTP,
523
+ # "HTTPS"=>URI::HTTPS,
524
+ # "LDAP"=>URI::LDAP,
525
+ # "FILE"=>URI::File,
526
+ # "FTP"=>URI::FTP}
527
+ #
528
+ # Related: URI.register_scheme.
529
+ #
530
+ # pkg:gem/uri#lib/uri/common.rb:161
531
+ def scheme_list; end
532
+
533
+ # Returns a 9-element array representing the parts of the \URI
534
+ # formed from the string +uri+;
535
+ # each array element is a string or +nil+:
536
+ #
537
+ # names = %w[scheme userinfo host port registry path opaque query fragment]
538
+ # values = URI.split('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
539
+ # names.zip(values)
540
+ # # =>
541
+ # [["scheme", "https"],
542
+ # ["userinfo", "john.doe"],
543
+ # ["host", "www.example.com"],
544
+ # ["port", "123"],
545
+ # ["registry", nil],
546
+ # ["path", "/forum/questions/"],
547
+ # ["opaque", nil],
548
+ # ["query", "tag=networking&order=newest"],
549
+ # ["fragment", "top"]]
550
+ #
551
+ # pkg:gem/uri#lib/uri/common.rb:232
552
+ def split(uri); end
553
+
554
+ private
555
+
556
+ # Returns a string decoding characters matching +regexp+ from the
557
+ # given \URL-encoded string +str+.
558
+ #
559
+ # pkg:gem/uri#lib/uri/common.rb:463
560
+ def _decode_uri_component(regexp, str, enc); end
561
+
562
+ # Returns a string derived from the given string +str+ with
563
+ # URI-encoded characters matching +regexp+ according to +table+.
564
+ #
565
+ # pkg:gem/uri#lib/uri/common.rb:447
566
+ def _encode_uri_component(regexp, table, str, enc); end
567
+ end
568
+ end
569
+
570
+ # FTP URI syntax is defined by RFC1738 section 3.2.
571
+ #
572
+ # This class will be redesigned because of difference of implementations;
573
+ # the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it
574
+ # is a good summary about the de facto spec.
575
+ # https://datatracker.ietf.org/doc/html/draft-hoffman-ftp-uri-04
576
+ #
577
+ # pkg:gem/uri#lib/uri/ftp.rb:22
578
+ class URI::FTP < ::URI::Generic
579
+ # == Description
580
+ #
581
+ # Creates a new URI::FTP object from generic URL components with no
582
+ # syntax checking.
583
+ #
584
+ # Unlike build(), this method does not escape the path component as
585
+ # required by RFC1738; instead it is treated as per RFC2396.
586
+ #
587
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
588
+ # +opaque+, +query+, and +fragment+, in that order.
589
+ #
590
+ # pkg:gem/uri#lib/uri/ftp.rb:133
591
+ def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end
592
+
593
+ # pkg:gem/uri#lib/uri/ftp.rb:214
594
+ def merge(oth); end
595
+
596
+ # Returns the path from an FTP URI.
597
+ #
598
+ # RFC 1738 specifically states that the path for an FTP URI does not
599
+ # include the / which separates the URI path from the URI host. Example:
600
+ #
601
+ # <code>ftp://ftp.example.com/pub/ruby</code>
602
+ #
603
+ # The above URI indicates that the client should connect to
604
+ # ftp.example.com then cd to pub/ruby from the initial login directory.
605
+ #
606
+ # If you want to cd to an absolute directory, you must include an
607
+ # escaped / (%2F) in the path. Example:
608
+ #
609
+ # <code>ftp://ftp.example.com/%2Fpub/ruby</code>
610
+ #
611
+ # This method will then return "/pub/ruby".
612
+ #
613
+ # pkg:gem/uri#lib/uri/ftp.rb:240
614
+ def path; end
615
+
616
+ # Returns a String representation of the URI::FTP.
617
+ #
618
+ # pkg:gem/uri#lib/uri/ftp.rb:251
619
+ def to_s; end
620
+
621
+ # typecode accessor.
622
+ #
623
+ # See URI::FTP::COMPONENT.
624
+ #
625
+ # pkg:gem/uri#lib/uri/ftp.rb:161
626
+ def typecode; end
627
+
628
+ # == Args
629
+ #
630
+ # +v+::
631
+ # String
632
+ #
633
+ # == Description
634
+ #
635
+ # Public setter for the typecode +v+
636
+ # (with validation).
637
+ #
638
+ # See also URI::FTP.check_typecode.
639
+ #
640
+ # == Usage
641
+ #
642
+ # require 'uri'
643
+ #
644
+ # uri = URI.parse("ftp://john@ftp.example.com/my_file.img")
645
+ # #=> #<URI::FTP ftp://john@ftp.example.com/my_file.img>
646
+ # uri.typecode = "i"
647
+ # uri
648
+ # #=> #<URI::FTP ftp://john@ftp.example.com/my_file.img;type=i>
649
+ #
650
+ # pkg:gem/uri#lib/uri/ftp.rb:208
651
+ def typecode=(typecode); end
652
+
653
+ protected
654
+
655
+ # Private setter for the path of the URI::FTP.
656
+ #
657
+ # pkg:gem/uri#lib/uri/ftp.rb:245
658
+ def set_path(v); end
659
+
660
+ # Private setter for the typecode +v+.
661
+ #
662
+ # See also URI::FTP.typecode=.
663
+ #
664
+ # pkg:gem/uri#lib/uri/ftp.rb:180
665
+ def set_typecode(v); end
666
+
667
+ private
668
+
669
+ # Validates typecode +v+,
670
+ # returns +true+ or +false+.
671
+ #
672
+ # pkg:gem/uri#lib/uri/ftp.rb:166
673
+ def check_typecode(v); end
674
+
675
+ class << self
676
+ # == Description
677
+ #
678
+ # Creates a new URI::FTP object from components, with syntax checking.
679
+ #
680
+ # The components accepted are +userinfo+, +host+, +port+, +path+, and
681
+ # +typecode+.
682
+ #
683
+ # The components should be provided either as an Array, or as a Hash
684
+ # with keys formed by preceding the component names with a colon.
685
+ #
686
+ # If an Array is used, the components must be passed in the
687
+ # order <code>[userinfo, host, port, path, typecode]</code>.
688
+ #
689
+ # If the path supplied is absolute, it will be escaped in order to
690
+ # make it absolute in the URI.
691
+ #
692
+ # Examples:
693
+ #
694
+ # require 'uri'
695
+ #
696
+ # uri1 = URI::FTP.build(['user:password', 'ftp.example.com', nil,
697
+ # '/path/file.zip', 'i'])
698
+ # uri1.to_s # => "ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i"
699
+ #
700
+ # uri2 = URI::FTP.build({:host => 'ftp.example.com',
701
+ # :path => 'ruby/src'})
702
+ # uri2.to_s # => "ftp://ftp.example.com/ruby/src"
703
+ #
704
+ # pkg:gem/uri#lib/uri/ftp.rb:96
705
+ def build(args); end
706
+
707
+ # pkg:gem/uri#lib/uri/ftp.rb:47
708
+ def new2(user, password, host, port, path, typecode = T.unsafe(nil), arg_check = T.unsafe(nil)); end
709
+ end
710
+ end
711
+
712
+ # The "file" URI is defined by RFC8089.
713
+ #
714
+ # pkg:gem/uri#lib/uri/file.rb:10
715
+ class URI::File < ::URI::Generic
716
+ # raise InvalidURIError
717
+ #
718
+ # pkg:gem/uri#lib/uri/file.rb:82
719
+ def check_password(user); end
720
+
721
+ # raise InvalidURIError
722
+ #
723
+ # pkg:gem/uri#lib/uri/file.rb:77
724
+ def check_user(user); end
725
+
726
+ # raise InvalidURIError
727
+ #
728
+ # pkg:gem/uri#lib/uri/file.rb:72
729
+ def check_userinfo(user); end
730
+
731
+ # Protected setter for the host component +v+.
732
+ #
733
+ # See also URI::Generic.host=.
734
+ #
735
+ # pkg:gem/uri#lib/uri/file.rb:62
736
+ def set_host(v); end
737
+
738
+ # do nothing
739
+ #
740
+ # pkg:gem/uri#lib/uri/file.rb:95
741
+ def set_password(v); end
742
+
743
+ # do nothing
744
+ #
745
+ # pkg:gem/uri#lib/uri/file.rb:68
746
+ def set_port(v); end
747
+
748
+ # do nothing
749
+ #
750
+ # pkg:gem/uri#lib/uri/file.rb:91
751
+ def set_user(v); end
752
+
753
+ # do nothing
754
+ #
755
+ # pkg:gem/uri#lib/uri/file.rb:87
756
+ def set_userinfo(v); end
757
+
758
+ class << self
759
+ # == Description
760
+ #
761
+ # Creates a new URI::File object from components, with syntax checking.
762
+ #
763
+ # The components accepted are +host+ and +path+.
764
+ #
765
+ # The components should be provided either as an Array, or as a Hash
766
+ # with keys formed by preceding the component names with a colon.
767
+ #
768
+ # If an Array is used, the components must be passed in the
769
+ # order <code>[host, path]</code>.
770
+ #
771
+ # A path from e.g. the File class should be escaped before
772
+ # being passed.
773
+ #
774
+ # Examples:
775
+ #
776
+ # require 'uri'
777
+ #
778
+ # uri1 = URI::File.build(['host.example.com', '/path/file.zip'])
779
+ # uri1.to_s # => "file://host.example.com/path/file.zip"
780
+ #
781
+ # uri2 = URI::File.build({:host => 'host.example.com',
782
+ # :path => '/ruby/src'})
783
+ # uri2.to_s # => "file://host.example.com/ruby/src"
784
+ #
785
+ # uri3 = URI::File.build({:path => URI::RFC2396_PARSER.escape('/path/my file.txt')})
786
+ # uri3.to_s # => "file:///path/my%20file.txt"
787
+ #
788
+ # pkg:gem/uri#lib/uri/file.rb:53
789
+ def build(args); end
790
+ end
791
+ end
792
+
793
+ # An Array of the available components for URI::File.
794
+ #
795
+ # pkg:gem/uri#lib/uri/file.rb:17
796
+ URI::File::COMPONENT = T.let(T.unsafe(nil), Array)
797
+
798
+ # A Default port of nil for URI::File.
799
+ #
800
+ # pkg:gem/uri#lib/uri/file.rb:12
801
+ URI::File::DEFAULT_PORT = T.let(T.unsafe(nil), T.untyped)
802
+
803
+ # Base class for all URI classes.
804
+ # Implements generic URI syntax as per RFC 2396.
805
+ #
806
+ # pkg:gem/uri#lib/uri/generic.rb:21
807
+ class URI::Generic
808
+ include ::URI
809
+
810
+ # == Args
811
+ #
812
+ # +scheme+::
813
+ # Protocol scheme, i.e. 'http','ftp','mailto' and so on.
814
+ # +userinfo+::
815
+ # User name and password, i.e. 'sdmitry:bla'.
816
+ # +host+::
817
+ # Server host name.
818
+ # +port+::
819
+ # Server port.
820
+ # +registry+::
821
+ # Registry of naming authorities.
822
+ # +path+::
823
+ # Path on server.
824
+ # +opaque+::
825
+ # Opaque part.
826
+ # +query+::
827
+ # Query data.
828
+ # +fragment+::
829
+ # Part of the URI after '#' character.
830
+ # +parser+::
831
+ # Parser for internal use [URI::DEFAULT_PARSER by default].
832
+ # +arg_check+::
833
+ # Check arguments [false by default].
834
+ #
835
+ # == Description
836
+ #
837
+ # Creates a new URI::Generic instance from ``generic'' components without check.
838
+ #
839
+ # pkg:gem/uri#lib/uri/generic.rb:169
840
+ def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end
841
+
842
+ # merge
843
+ #
844
+ # pkg:gem/uri#lib/uri/generic.rb:1164
845
+ def +(oth); end
846
+
847
+ # pkg:gem/uri#lib/uri/generic.rb:1294
848
+ def -(oth); end
849
+
850
+ # Compares two URIs.
851
+ #
852
+ # pkg:gem/uri#lib/uri/generic.rb:1399
853
+ def ==(oth); end
854
+
855
+ # pkg:gem/uri#lib/uri/generic.rb:994
856
+ def absolute; end
857
+
858
+ # Returns true if URI has a scheme (e.g. http:// or https://) specified.
859
+ #
860
+ # pkg:gem/uri#lib/uri/generic.rb:987
861
+ def absolute?; end
862
+
863
+ # Returns the authority info (array of user, password, host and
864
+ # port), if any is set. Or returns +nil+.
865
+ #
866
+ # pkg:gem/uri#lib/uri/generic.rb:579
867
+ def authority; end
868
+
869
+ # == Args
870
+ #
871
+ # +v+::
872
+ # URI or String
873
+ #
874
+ # == Description
875
+ #
876
+ # Attempts to parse other URI +oth+,
877
+ # returns [parsed_oth, self].
878
+ #
879
+ # == Usage
880
+ #
881
+ # require 'uri'
882
+ #
883
+ # uri = URI.parse("http://my.example.com")
884
+ # uri.coerce("http://foo.com")
885
+ # #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]
886
+ #
887
+ # pkg:gem/uri#lib/uri/generic.rb:1478
888
+ def coerce(oth); end
889
+
890
+ # Components of the URI in the order.
891
+ #
892
+ # pkg:gem/uri#lib/uri/generic.rb:313
893
+ def component; end
894
+
895
+ # Returns the password component after URI decoding.
896
+ #
897
+ # pkg:gem/uri#lib/uri/generic.rb:589
898
+ def decoded_password; end
899
+
900
+ # Returns the user component after URI decoding.
901
+ #
902
+ # pkg:gem/uri#lib/uri/generic.rb:584
903
+ def decoded_user; end
904
+
905
+ # Returns default port.
906
+ #
907
+ # pkg:gem/uri#lib/uri/generic.rb:39
908
+ def default_port; end
909
+
910
+ # Compares with _oth_ for Hash.
911
+ #
912
+ # pkg:gem/uri#lib/uri/generic.rb:1413
913
+ def eql?(oth); end
914
+
915
+ # Returns a proxy URI.
916
+ # The proxy URI is obtained from environment variables such as http_proxy,
917
+ # ftp_proxy, no_proxy, etc.
918
+ # If there is no proper proxy, nil is returned.
919
+ #
920
+ # If the optional parameter +env+ is specified, it is used instead of ENV.
921
+ #
922
+ # Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.)
923
+ # are examined, too.
924
+ #
925
+ # But http_proxy and HTTP_PROXY is treated specially under CGI environment.
926
+ # It's because HTTP_PROXY may be set by Proxy: header.
927
+ # So HTTP_PROXY is not used.
928
+ # http_proxy is not used too if the variable is case insensitive.
929
+ # CGI_HTTP_PROXY can be used instead.
930
+ #
931
+ # pkg:gem/uri#lib/uri/generic.rb:1504
932
+ def find_proxy(env = T.unsafe(nil)); end
933
+
934
+ # Returns the fragment component of the URI.
935
+ #
936
+ # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies"
937
+ #
938
+ # pkg:gem/uri#lib/uri/generic.rb:283
939
+ def fragment; end
940
+
941
+ # Checks the fragment +v+ component against the +parser+ Regexp for :FRAGMENT.
942
+ #
943
+ #
944
+ # == Args
945
+ #
946
+ # +v+::
947
+ # String
948
+ #
949
+ # == Description
950
+ #
951
+ # Public setter for the fragment component +v+
952
+ # (with validation).
953
+ #
954
+ # == Usage
955
+ #
956
+ # require 'uri'
957
+ #
958
+ # uri = URI.parse("http://my.example.com/?id=25#time=1305212049")
959
+ # uri.fragment = "time=1305212086"
960
+ # uri.to_s #=> "http://my.example.com/?id=25#time=1305212086"
961
+ #
962
+ # pkg:gem/uri#lib/uri/generic.rb:944
963
+ def fragment=(v); end
964
+
965
+ # Returns the hash value.
966
+ #
967
+ # pkg:gem/uri#lib/uri/generic.rb:1408
968
+ def hash; end
969
+
970
+ # Returns true if URI is hierarchical.
971
+ #
972
+ # == Description
973
+ #
974
+ # URI has components listed in order of decreasing significance from left to right,
975
+ # see RFC3986 https://www.rfc-editor.org/rfc/rfc3986 1.2.3.
976
+ #
977
+ # == Usage
978
+ #
979
+ # require 'uri'
980
+ #
981
+ # uri = URI.parse("http://my.example.com/")
982
+ # uri.hierarchical?
983
+ # #=> true
984
+ # uri = URI.parse("mailto:joe@example.com")
985
+ # uri.hierarchical?
986
+ # #=> false
987
+ #
988
+ # pkg:gem/uri#lib/uri/generic.rb:976
989
+ def hierarchical?; end
990
+
991
+ # Returns the host component of the URI.
992
+ #
993
+ # URI("http://foo/bar/baz").host #=> "foo"
994
+ #
995
+ # It returns nil if no host component exists.
996
+ #
997
+ # URI("mailto:foo@example.org").host #=> nil
998
+ #
999
+ # The component does not contain the port number.
1000
+ #
1001
+ # URI("http://foo:8080/bar/baz").host #=> "foo"
1002
+ #
1003
+ # Since IPv6 addresses are wrapped with brackets in URIs,
1004
+ # this method returns IPv6 addresses wrapped with brackets.
1005
+ # This form is not appropriate to pass to socket methods such as TCPSocket.open.
1006
+ # If unwrapped host names are required, use the #hostname method.
1007
+ #
1008
+ # URI("http://[::1]/bar/baz").host #=> "[::1]"
1009
+ # URI("http://[::1]/bar/baz").hostname #=> "::1"
1010
+ #
1011
+ # pkg:gem/uri#lib/uri/generic.rb:243
1012
+ def host; end
1013
+
1014
+ # == Args
1015
+ #
1016
+ # +v+::
1017
+ # String
1018
+ #
1019
+ # == Description
1020
+ #
1021
+ # Public setter for the host component +v+
1022
+ # (with validation).
1023
+ #
1024
+ # See also URI::Generic.check_host.
1025
+ #
1026
+ # == Usage
1027
+ #
1028
+ # require 'uri'
1029
+ #
1030
+ # uri = URI.parse("http://my.example.com")
1031
+ # uri.host = "foo.com"
1032
+ # uri.to_s #=> "http://foo.com"
1033
+ #
1034
+ # pkg:gem/uri#lib/uri/generic.rb:652
1035
+ def host=(v); end
1036
+
1037
+ # Extract the host part of the URI and unwrap brackets for IPv6 addresses.
1038
+ #
1039
+ # This method is the same as URI::Generic#host except
1040
+ # brackets for IPv6 (and future IP) addresses are removed.
1041
+ #
1042
+ # uri = URI("http://[::1]/bar")
1043
+ # uri.hostname #=> "::1"
1044
+ # uri.host #=> "[::1]"
1045
+ #
1046
+ # pkg:gem/uri#lib/uri/generic.rb:668
1047
+ def hostname; end
1048
+
1049
+ # Sets the host part of the URI as the argument with brackets for IPv6 addresses.
1050
+ #
1051
+ # This method is the same as URI::Generic#host= except
1052
+ # the argument can be a bare IPv6 address.
1053
+ #
1054
+ # uri = URI("http://foo/bar")
1055
+ # uri.hostname = "::1"
1056
+ # uri.to_s #=> "http://[::1]/bar"
1057
+ #
1058
+ # If the argument seems to be an IPv6 address,
1059
+ # it is wrapped with brackets.
1060
+ #
1061
+ # pkg:gem/uri#lib/uri/generic.rb:685
1062
+ def hostname=(v); end
1063
+
1064
+ # pkg:gem/uri#lib/uri/generic.rb:1455
1065
+ def inspect; end
1066
+
1067
+ # == Args
1068
+ #
1069
+ # +oth+::
1070
+ # URI or String
1071
+ #
1072
+ # == Description
1073
+ #
1074
+ # Merges two URIs.
1075
+ #
1076
+ # == Usage
1077
+ #
1078
+ # require 'uri'
1079
+ #
1080
+ # uri = URI.parse("http://my.example.com")
1081
+ # uri.merge("/main.rbx?page=1")
1082
+ # # => "http://my.example.com/main.rbx?page=1"
1083
+ #
1084
+ # pkg:gem/uri#lib/uri/generic.rb:1124
1085
+ def merge(oth); end
1086
+
1087
+ # == Args
1088
+ #
1089
+ # +oth+::
1090
+ # URI or String
1091
+ #
1092
+ # == Description
1093
+ #
1094
+ # Destructive form of #merge.
1095
+ #
1096
+ # == Usage
1097
+ #
1098
+ # require 'uri'
1099
+ #
1100
+ # uri = URI.parse("http://my.example.com")
1101
+ # uri.merge!("/main.rbx?page=1")
1102
+ # uri.to_s # => "http://my.example.com/main.rbx?page=1"
1103
+ #
1104
+ # pkg:gem/uri#lib/uri/generic.rb:1096
1105
+ def merge!(oth); end
1106
+
1107
+ # Returns normalized URI.
1108
+ #
1109
+ # require 'uri'
1110
+ #
1111
+ # URI("HTTP://my.EXAMPLE.com").normalize
1112
+ # #=> #<URI::HTTP http://my.example.com/>
1113
+ #
1114
+ # Normalization here means:
1115
+ #
1116
+ # * scheme and host are converted to lowercase,
1117
+ # * an empty path component is set to "/".
1118
+ #
1119
+ # pkg:gem/uri#lib/uri/generic.rb:1331
1120
+ def normalize; end
1121
+
1122
+ # Destructive version of #normalize.
1123
+ #
1124
+ # pkg:gem/uri#lib/uri/generic.rb:1340
1125
+ def normalize!; end
1126
+
1127
+ # Returns the opaque part of the URI.
1128
+ #
1129
+ # URI("mailto:foo@example.org").opaque #=> "foo@example.org"
1130
+ # URI("http://foo/bar/baz").opaque #=> nil
1131
+ #
1132
+ # The portion of the path that does not make use of the slash '/'.
1133
+ # The path typically refers to an absolute path or an opaque part.
1134
+ # (See RFC2396 Section 3 and 5.2.)
1135
+ #
1136
+ # pkg:gem/uri#lib/uri/generic.rb:277
1137
+ def opaque; end
1138
+
1139
+ # == Args
1140
+ #
1141
+ # +v+::
1142
+ # String
1143
+ #
1144
+ # == Description
1145
+ #
1146
+ # Public setter for the opaque component +v+
1147
+ # (with validation).
1148
+ #
1149
+ # See also URI::Generic.check_opaque.
1150
+ #
1151
+ # pkg:gem/uri#lib/uri/generic.rb:916
1152
+ def opaque=(v); end
1153
+
1154
+ # Returns the parser to be used.
1155
+ #
1156
+ # Unless the +parser+ is defined, DEFAULT_PARSER is used.
1157
+ #
1158
+ # pkg:gem/uri#lib/uri/generic.rb:289
1159
+ def parser; end
1160
+
1161
+ # Returns the password component (without URI decoding).
1162
+ #
1163
+ # pkg:gem/uri#lib/uri/generic.rb:573
1164
+ def password; end
1165
+
1166
+ # == Args
1167
+ #
1168
+ # +v+::
1169
+ # String
1170
+ #
1171
+ # == Description
1172
+ #
1173
+ # Public setter for the +password+ component
1174
+ # (with validation).
1175
+ #
1176
+ # See also URI::Generic.check_password.
1177
+ #
1178
+ # == Usage
1179
+ #
1180
+ # require 'uri'
1181
+ #
1182
+ # uri = URI.parse("http://john:S3nsit1ve@my.example.com")
1183
+ # uri.password = "V3ry_S3nsit1ve"
1184
+ # uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com"
1185
+ #
1186
+ # pkg:gem/uri#lib/uri/generic.rb:498
1187
+ def password=(password); end
1188
+
1189
+ # Returns the path component of the URI.
1190
+ #
1191
+ # URI("http://foo/bar/baz").path #=> "/bar/baz"
1192
+ #
1193
+ # pkg:gem/uri#lib/uri/generic.rb:260
1194
+ def path; end
1195
+
1196
+ # == Args
1197
+ #
1198
+ # +v+::
1199
+ # String
1200
+ #
1201
+ # == Description
1202
+ #
1203
+ # Public setter for the path component +v+
1204
+ # (with validation).
1205
+ #
1206
+ # See also URI::Generic.check_path.
1207
+ #
1208
+ # == Usage
1209
+ #
1210
+ # require 'uri'
1211
+ #
1212
+ # uri = URI.parse("http://my.example.com/pub/files")
1213
+ # uri.path = "/faq/"
1214
+ # uri.to_s #=> "http://my.example.com/faq/"
1215
+ #
1216
+ # pkg:gem/uri#lib/uri/generic.rb:830
1217
+ def path=(v); end
1218
+
1219
+ # Returns the port component of the URI.
1220
+ #
1221
+ # URI("http://foo/bar/baz").port #=> 80
1222
+ # URI("http://foo:8080/bar/baz").port #=> 8080
1223
+ #
1224
+ # pkg:gem/uri#lib/uri/generic.rb:250
1225
+ def port; end
1226
+
1227
+ # == Args
1228
+ #
1229
+ # +v+::
1230
+ # String
1231
+ #
1232
+ # == Description
1233
+ #
1234
+ # Public setter for the port component +v+
1235
+ # (with validation).
1236
+ #
1237
+ # See also URI::Generic.check_port.
1238
+ #
1239
+ # == Usage
1240
+ #
1241
+ # require 'uri'
1242
+ #
1243
+ # uri = URI.parse("http://my.example.com")
1244
+ # uri.port = 8080
1245
+ # uri.to_s #=> "http://my.example.com:8080"
1246
+ #
1247
+ # pkg:gem/uri#lib/uri/generic.rb:743
1248
+ def port=(v); end
1249
+
1250
+ # Returns the query component of the URI.
1251
+ #
1252
+ # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar"
1253
+ #
1254
+ # pkg:gem/uri#lib/uri/generic.rb:266
1255
+ def query; end
1256
+
1257
+ # == Args
1258
+ #
1259
+ # +v+::
1260
+ # String
1261
+ #
1262
+ # == Description
1263
+ #
1264
+ # Public setter for the query component +v+.
1265
+ #
1266
+ # == Usage
1267
+ #
1268
+ # require 'uri'
1269
+ #
1270
+ # uri = URI.parse("http://my.example.com/?id=25")
1271
+ # uri.query = "id=1"
1272
+ # uri.to_s #=> "http://my.example.com/?id=1"
1273
+ #
1274
+ # pkg:gem/uri#lib/uri/generic.rb:854
1275
+ def query=(v); end
1276
+
1277
+ # pkg:gem/uri#lib/uri/generic.rb:252
1278
+ def registry; end
1279
+
1280
+ # pkg:gem/uri#lib/uri/generic.rb:760
1281
+ def registry=(v); end
1282
+
1283
+ # Returns true if URI does not have a scheme (e.g. http:// or https://) specified.
1284
+ #
1285
+ # pkg:gem/uri#lib/uri/generic.rb:999
1286
+ def relative?; end
1287
+
1288
+ # == Args
1289
+ #
1290
+ # +oth+::
1291
+ # URI or String
1292
+ #
1293
+ # == Description
1294
+ #
1295
+ # Calculates relative path from oth to self.
1296
+ #
1297
+ # == Usage
1298
+ #
1299
+ # require 'uri'
1300
+ #
1301
+ # uri = URI.parse('http://my.example.com/main.rbx?page=1')
1302
+ # uri.route_from('http://my.example.com')
1303
+ # #=> #<URI::Generic /main.rbx?page=1>
1304
+ #
1305
+ # pkg:gem/uri#lib/uri/generic.rb:1274
1306
+ def route_from(oth); end
1307
+
1308
+ # == Args
1309
+ #
1310
+ # +oth+::
1311
+ # URI or String
1312
+ #
1313
+ # == Description
1314
+ #
1315
+ # Calculates relative path to oth from self.
1316
+ #
1317
+ # == Usage
1318
+ #
1319
+ # require 'uri'
1320
+ #
1321
+ # uri = URI.parse('http://my.example.com')
1322
+ # uri.route_to('http://my.example.com/main.rbx?page=1')
1323
+ # #=> #<URI::Generic /main.rbx?page=1>
1324
+ #
1325
+ # pkg:gem/uri#lib/uri/generic.rb:1314
1326
+ def route_to(oth); end
1327
+
1328
+ # Returns the scheme component of the URI.
1329
+ #
1330
+ # URI("http://foo/bar/baz").scheme #=> "http"
1331
+ #
1332
+ # pkg:gem/uri#lib/uri/generic.rb:221
1333
+ def scheme; end
1334
+
1335
+ # == Args
1336
+ #
1337
+ # +v+::
1338
+ # String
1339
+ #
1340
+ # == Description
1341
+ #
1342
+ # Public setter for the scheme component +v+
1343
+ # (with validation).
1344
+ #
1345
+ # See also URI::Generic.check_scheme.
1346
+ #
1347
+ # == Usage
1348
+ #
1349
+ # require 'uri'
1350
+ #
1351
+ # uri = URI.parse("http://my.example.com")
1352
+ # uri.scheme = "https"
1353
+ # uri.to_s #=> "https://my.example.com"
1354
+ #
1355
+ # pkg:gem/uri#lib/uri/generic.rb:360
1356
+ def scheme=(v); end
1357
+
1358
+ # == Args
1359
+ #
1360
+ # +components+::
1361
+ # Multiple Symbol arguments defined in URI::HTTP.
1362
+ #
1363
+ # == Description
1364
+ #
1365
+ # Selects specified components from URI.
1366
+ #
1367
+ # == Usage
1368
+ #
1369
+ # require 'uri'
1370
+ #
1371
+ # uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx')
1372
+ # uri.select(:userinfo, :host, :path)
1373
+ # # => ["myuser:mypass", "my.example.com", "/test.rbx"]
1374
+ #
1375
+ # pkg:gem/uri#lib/uri/generic.rb:1444
1376
+ def select(*components); end
1377
+
1378
+ # Constructs String from URI.
1379
+ #
1380
+ # pkg:gem/uri#lib/uri/generic.rb:1355
1381
+ def to_s; end
1382
+
1383
+ # pkg:gem/uri#lib/uri/generic.rb:1394
1384
+ def to_str; end
1385
+
1386
+ # Returns the user component (without URI decoding).
1387
+ #
1388
+ # pkg:gem/uri#lib/uri/generic.rb:568
1389
+ def user; end
1390
+
1391
+ # == Args
1392
+ #
1393
+ # +v+::
1394
+ # String
1395
+ #
1396
+ # == Description
1397
+ #
1398
+ # Public setter for the +user+ component
1399
+ # (with validation).
1400
+ #
1401
+ # See also URI::Generic.check_user.
1402
+ #
1403
+ # == Usage
1404
+ #
1405
+ # require 'uri'
1406
+ #
1407
+ # uri = URI.parse("http://john:S3nsit1ve@my.example.com")
1408
+ # uri.user = "sam"
1409
+ # uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com"
1410
+ #
1411
+ # pkg:gem/uri#lib/uri/generic.rb:471
1412
+ def user=(user); end
1413
+
1414
+ # Returns the userinfo, either as 'user' or 'user:password'.
1415
+ #
1416
+ # pkg:gem/uri#lib/uri/generic.rb:557
1417
+ def userinfo; end
1418
+
1419
+ # Sets userinfo, argument is string like 'name:pass'.
1420
+ #
1421
+ # pkg:gem/uri#lib/uri/generic.rb:441
1422
+ def userinfo=(userinfo); end
1423
+
1424
+ protected
1425
+
1426
+ # Returns an Array of the components defined from the COMPONENT Array.
1427
+ #
1428
+ # pkg:gem/uri#lib/uri/generic.rb:1420
1429
+ def component_ary; end
1430
+
1431
+ # Protected setter for the authority info (+user+, +password+, +host+
1432
+ # and +port+). If +port+ is +nil+, +default_port+ will be set.
1433
+ #
1434
+ # pkg:gem/uri#lib/uri/generic.rb:627
1435
+ def set_authority(user, password, host, port = T.unsafe(nil)); end
1436
+
1437
+ # Protected setter for the host component +v+.
1438
+ #
1439
+ # See also URI::Generic.host=.
1440
+ #
1441
+ # pkg:gem/uri#lib/uri/generic.rb:619
1442
+ def set_host(v); end
1443
+
1444
+ # Protected setter for the opaque component +v+.
1445
+ #
1446
+ # See also URI::Generic.opaque=.
1447
+ #
1448
+ # pkg:gem/uri#lib/uri/generic.rb:898
1449
+ def set_opaque(v); end
1450
+
1451
+ # Protected setter for the password component +v+.
1452
+ #
1453
+ # See also URI::Generic.password=.
1454
+ #
1455
+ # pkg:gem/uri#lib/uri/generic.rb:534
1456
+ def set_password(v); end
1457
+
1458
+ # Protected setter for the path component +v+.
1459
+ #
1460
+ # See also URI::Generic.path=.
1461
+ #
1462
+ # pkg:gem/uri#lib/uri/generic.rb:804
1463
+ def set_path(v); end
1464
+
1465
+ # Protected setter for the port component +v+.
1466
+ #
1467
+ # See also URI::Generic.port=.
1468
+ #
1469
+ # pkg:gem/uri#lib/uri/generic.rb:716
1470
+ def set_port(v); end
1471
+
1472
+ # pkg:gem/uri#lib/uri/generic.rb:755
1473
+ def set_registry(v); end
1474
+
1475
+ # Protected setter for the scheme component +v+.
1476
+ #
1477
+ # See also URI::Generic.scheme=.
1478
+ #
1479
+ # pkg:gem/uri#lib/uri/generic.rb:334
1480
+ def set_scheme(v); end
1481
+
1482
+ # Protected setter for the user component +v+.
1483
+ #
1484
+ # See also URI::Generic.user=.
1485
+ #
1486
+ # pkg:gem/uri#lib/uri/generic.rb:524
1487
+ def set_user(v); end
1488
+
1489
+ # Protected setter for the +user+ component, and +password+ if available
1490
+ # (with validation).
1491
+ #
1492
+ # See also URI::Generic.userinfo=.
1493
+ #
1494
+ # pkg:gem/uri#lib/uri/generic.rb:509
1495
+ def set_userinfo(user, password = T.unsafe(nil)); end
1496
+
1497
+ private
1498
+
1499
+ # Checks the host +v+ component for RFC2396 compliance
1500
+ # and against the +parser+ Regexp for :HOST.
1501
+ #
1502
+ # Can not have a registry or opaque component defined,
1503
+ # with a host component defined.
1504
+ #
1505
+ # pkg:gem/uri#lib/uri/generic.rb:600
1506
+ def check_host(v); end
1507
+
1508
+ # Checks the opaque +v+ component for RFC2396 compliance and
1509
+ # against the +parser+ Regexp for :OPAQUE.
1510
+ #
1511
+ # Can not have a host, port, user, or path component defined,
1512
+ # with an opaque component defined.
1513
+ #
1514
+ # pkg:gem/uri#lib/uri/generic.rb:876
1515
+ def check_opaque(v); end
1516
+
1517
+ # Checks the password +v+ component for RFC2396 compliance
1518
+ # and against the +parser+ Regexp for :USERINFO.
1519
+ #
1520
+ # Can not have a registry or opaque component defined,
1521
+ # with a user component defined.
1522
+ #
1523
+ # pkg:gem/uri#lib/uri/generic.rb:417
1524
+ def check_password(v, user = T.unsafe(nil)); end
1525
+
1526
+ # Checks the path +v+ component for RFC2396 compliance
1527
+ # and against the +parser+ Regexp
1528
+ # for :ABS_PATH and :REL_PATH.
1529
+ #
1530
+ # Can not have a opaque component defined,
1531
+ # with a path component defined.
1532
+ #
1533
+ # pkg:gem/uri#lib/uri/generic.rb:772
1534
+ def check_path(v); end
1535
+
1536
+ # Checks the port +v+ component for RFC2396 compliance
1537
+ # and against the +parser+ Regexp for :PORT.
1538
+ #
1539
+ # Can not have a registry or opaque component defined,
1540
+ # with a port component defined.
1541
+ #
1542
+ # pkg:gem/uri#lib/uri/generic.rb:697
1543
+ def check_port(v); end
1544
+
1545
+ # pkg:gem/uri#lib/uri/generic.rb:750
1546
+ def check_registry(v); end
1547
+
1548
+ # Checks the scheme +v+ component against the +parser+ Regexp for :SCHEME.
1549
+ #
1550
+ # pkg:gem/uri#lib/uri/generic.rb:320
1551
+ def check_scheme(v); end
1552
+
1553
+ # Checks the user +v+ component for RFC2396 compliance
1554
+ # and against the +parser+ Regexp for :USERINFO.
1555
+ #
1556
+ # Can not have a registry or opaque component defined,
1557
+ # with a user component defined.
1558
+ #
1559
+ # pkg:gem/uri#lib/uri/generic.rb:393
1560
+ def check_user(v); end
1561
+
1562
+ # Checks the +user+ and +password+.
1563
+ #
1564
+ # If +password+ is not provided, then +user+ is
1565
+ # split, using URI::Generic.split_userinfo, to
1566
+ # pull +user+ and +password.
1567
+ #
1568
+ # See also URI::Generic.check_user, URI::Generic.check_password.
1569
+ #
1570
+ # pkg:gem/uri#lib/uri/generic.rb:375
1571
+ def check_userinfo(user, password = T.unsafe(nil)); end
1572
+
1573
+ # Escapes 'user:password' +v+ based on RFC 1738 section 3.1.
1574
+ #
1575
+ # pkg:gem/uri#lib/uri/generic.rb:551
1576
+ def escape_userpass(v); end
1577
+
1578
+ # Merges a base path +base+, with relative path +rel+,
1579
+ # returns a modified base path.
1580
+ #
1581
+ # pkg:gem/uri#lib/uri/generic.rb:1015
1582
+ def merge_path(base, rel); end
1583
+
1584
+ # Replaces self by other URI object.
1585
+ #
1586
+ # pkg:gem/uri#lib/uri/generic.rb:299
1587
+ def replace!(oth); end
1588
+
1589
+ # :stopdoc:
1590
+ #
1591
+ # pkg:gem/uri#lib/uri/generic.rb:1206
1592
+ def route_from0(oth); end
1593
+
1594
+ # :stopdoc:
1595
+ #
1596
+ # pkg:gem/uri#lib/uri/generic.rb:1167
1597
+ def route_from_path(src, dst); end
1598
+
1599
+ # Returns an Array of the path split on '/'.
1600
+ #
1601
+ # pkg:gem/uri#lib/uri/generic.rb:1006
1602
+ def split_path(path); end
1603
+
1604
+ # Returns the userinfo +ui+ as <code>[user, password]</code>
1605
+ # if properly formatted as 'user:password'.
1606
+ #
1607
+ # pkg:gem/uri#lib/uri/generic.rb:542
1608
+ def split_userinfo(ui); end
1609
+
1610
+ class << self
1611
+ # == Synopsis
1612
+ #
1613
+ # See ::new.
1614
+ #
1615
+ # == Description
1616
+ #
1617
+ # Creates a new URI::Generic instance from components of URI::Generic
1618
+ # with check. Components are: scheme, userinfo, host, port, registry, path,
1619
+ # opaque, query, and fragment. You can provide arguments either by an Array or a Hash.
1620
+ # See ::new for hash keys to use or for order of array items.
1621
+ #
1622
+ # pkg:gem/uri#lib/uri/generic.rb:116
1623
+ def build(args); end
1624
+
1625
+ # == Synopsis
1626
+ #
1627
+ # See ::new.
1628
+ #
1629
+ # == Description
1630
+ #
1631
+ # At first, tries to create a new URI::Generic instance using
1632
+ # URI::Generic::build. But, if exception URI::InvalidComponentError is raised,
1633
+ # then it does URI::RFC2396_PARSER.escape all URI components and tries again.
1634
+ #
1635
+ # pkg:gem/uri#lib/uri/generic.rb:78
1636
+ def build2(args); end
1637
+
1638
+ # Components of the URI in the order.
1639
+ #
1640
+ # pkg:gem/uri#lib/uri/generic.rb:57
1641
+ def component; end
1642
+
1643
+ # Returns default port.
1644
+ #
1645
+ # pkg:gem/uri#lib/uri/generic.rb:32
1646
+ def default_port; end
1647
+
1648
+ # pkg:gem/uri#lib/uri/generic.rb:1570
1649
+ def use_proxy?(hostname, addr, port, no_proxy); end
1650
+
1651
+ # pkg:gem/uri#lib/uri/generic.rb:63
1652
+ def use_registry; end
1653
+ end
1654
+ end
1655
+
1656
+ # The syntax of HTTP URIs is defined in RFC1738 section 3.3.
1657
+ #
1658
+ # Note that the Ruby URI library allows HTTP URLs containing usernames and
1659
+ # passwords. This is not legal as per the RFC, but used to be
1660
+ # supported in Internet Explorer 5 and 6, before the MS04-004 security
1661
+ # update. See <URL:http://support.microsoft.com/kb/834489>.
1662
+ #
1663
+ # pkg:gem/uri#lib/uri/http.rb:22
1664
+ class URI::HTTP < ::URI::Generic
1665
+ # == Description
1666
+ #
1667
+ # Returns the authority for an HTTP uri, as defined in
1668
+ # https://www.rfc-editor.org/rfc/rfc3986#section-3.2.
1669
+ #
1670
+ #
1671
+ # Example:
1672
+ #
1673
+ # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
1674
+ # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
1675
+ # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
1676
+ #
1677
+ # pkg:gem/uri#lib/uri/http.rb:109
1678
+ def authority; end
1679
+
1680
+ # Do not allow empty host names, as they are not allowed by RFC 3986.
1681
+ #
1682
+ # pkg:gem/uri#lib/uri/http.rb:65
1683
+ def check_host(v); end
1684
+
1685
+ # == Description
1686
+ #
1687
+ # Returns the origin for an HTTP uri, as defined in
1688
+ # https://www.rfc-editor.org/rfc/rfc6454.
1689
+ #
1690
+ #
1691
+ # Example:
1692
+ #
1693
+ # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
1694
+ # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
1695
+ # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
1696
+ # URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
1697
+ #
1698
+ # pkg:gem/uri#lib/uri/http.rb:131
1699
+ def origin; end
1700
+
1701
+ # == Description
1702
+ #
1703
+ # Returns the full path for an HTTP request, as required by Net::HTTP::Get.
1704
+ #
1705
+ # If the URI contains a query, the full path is URI#path + '?' + URI#query.
1706
+ # Otherwise, the path is simply URI#path.
1707
+ #
1708
+ # Example:
1709
+ #
1710
+ # uri = URI::HTTP.build(path: '/foo/bar', query: 'test=true')
1711
+ # uri.request_uri # => "/foo/bar?test=true"
1712
+ #
1713
+ # pkg:gem/uri#lib/uri/http.rb:89
1714
+ def request_uri; end
1715
+
1716
+ class << self
1717
+ # == Description
1718
+ #
1719
+ # Creates a new URI::HTTP object from components, with syntax checking.
1720
+ #
1721
+ # The components accepted are userinfo, host, port, path, query, and
1722
+ # fragment.
1723
+ #
1724
+ # The components should be provided either as an Array, or as a Hash
1725
+ # with keys formed by preceding the component names with a colon.
1726
+ #
1727
+ # If an Array is used, the components must be passed in the
1728
+ # order <code>[userinfo, host, port, path, query, fragment]</code>.
1729
+ #
1730
+ # Example:
1731
+ #
1732
+ # uri = URI::HTTP.build(host: 'www.example.com', path: '/foo/bar')
1733
+ #
1734
+ # uri = URI::HTTP.build([nil, "www.example.com", nil, "/path",
1735
+ # "query", 'fragment'])
1736
+ #
1737
+ # Currently, if passed userinfo components this method generates
1738
+ # invalid HTTP URIs as per RFC 1738.
1739
+ #
1740
+ # pkg:gem/uri#lib/uri/http.rb:59
1741
+ def build(args); end
1742
+ end
1743
+ end
1744
+
1745
+ # :stopdoc:
1746
+ #
1747
+ # pkg:gem/uri#lib/uri/common.rb:166
1748
+ URI::INITIAL_SCHEMES = T.let(T.unsafe(nil), Hash)
1749
+
1750
+ # LDAP URI SCHEMA (described in RFC2255).
1751
+ # --
1752
+ # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
1753
+ # ++
1754
+ #
1755
+ # pkg:gem/uri#lib/uri/ldap.rb:23
1756
+ class URI::LDAP < ::URI::Generic
1757
+ # == Description
1758
+ #
1759
+ # Creates a new URI::LDAP object from generic URI components as per
1760
+ # RFC 2396. No LDAP-specific syntax checking is performed.
1761
+ #
1762
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
1763
+ # +opaque+, +query+, and +fragment+, in that order.
1764
+ #
1765
+ # Example:
1766
+ #
1767
+ # uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
1768
+ # "/dc=example;dc=com", nil, "query", nil)
1769
+ #
1770
+ # See also URI::Generic.new.
1771
+ #
1772
+ # pkg:gem/uri#lib/uri/ldap.rb:108
1773
+ def initialize(*arg); end
1774
+
1775
+ # Returns attributes.
1776
+ #
1777
+ # pkg:gem/uri#lib/uri/ldap.rb:178
1778
+ def attributes; end
1779
+
1780
+ # Setter for attributes +val+.
1781
+ #
1782
+ # pkg:gem/uri#lib/uri/ldap.rb:191
1783
+ def attributes=(val); end
1784
+
1785
+ # Returns dn.
1786
+ #
1787
+ # pkg:gem/uri#lib/uri/ldap.rb:159
1788
+ def dn; end
1789
+
1790
+ # Setter for dn +val+.
1791
+ #
1792
+ # pkg:gem/uri#lib/uri/ldap.rb:172
1793
+ def dn=(val); end
1794
+
1795
+ # Returns extensions.
1796
+ #
1797
+ # pkg:gem/uri#lib/uri/ldap.rb:235
1798
+ def extensions; end
1799
+
1800
+ # Setter for extensions +val+.
1801
+ #
1802
+ # pkg:gem/uri#lib/uri/ldap.rb:248
1803
+ def extensions=(val); end
1804
+
1805
+ # Returns filter.
1806
+ #
1807
+ # pkg:gem/uri#lib/uri/ldap.rb:216
1808
+ def filter; end
1809
+
1810
+ # Setter for filter +val+.
1811
+ #
1812
+ # pkg:gem/uri#lib/uri/ldap.rb:229
1813
+ def filter=(val); end
1814
+
1815
+ # Checks if URI has a path.
1816
+ # For URI::LDAP this will return +false+.
1817
+ #
1818
+ # pkg:gem/uri#lib/uri/ldap.rb:255
1819
+ def hierarchical?; end
1820
+
1821
+ # Returns scope.
1822
+ #
1823
+ # pkg:gem/uri#lib/uri/ldap.rb:197
1824
+ def scope; end
1825
+
1826
+ # Setter for scope +val+.
1827
+ #
1828
+ # pkg:gem/uri#lib/uri/ldap.rb:210
1829
+ def scope=(val); end
1830
+
1831
+ protected
1832
+
1833
+ # Private setter for attributes +val+.
1834
+ #
1835
+ # pkg:gem/uri#lib/uri/ldap.rb:183
1836
+ def set_attributes(val); end
1837
+
1838
+ # Private setter for dn +val+.
1839
+ #
1840
+ # pkg:gem/uri#lib/uri/ldap.rb:164
1841
+ def set_dn(val); end
1842
+
1843
+ # Private setter for extensions +val+.
1844
+ #
1845
+ # pkg:gem/uri#lib/uri/ldap.rb:240
1846
+ def set_extensions(val); end
1847
+
1848
+ # Private setter for filter +val+.
1849
+ #
1850
+ # pkg:gem/uri#lib/uri/ldap.rb:221
1851
+ def set_filter(val); end
1852
+
1853
+ # Private setter for scope +val+.
1854
+ #
1855
+ # pkg:gem/uri#lib/uri/ldap.rb:202
1856
+ def set_scope(val); end
1857
+
1858
+ private
1859
+
1860
+ # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+.
1861
+ #
1862
+ # pkg:gem/uri#lib/uri/ldap.rb:146
1863
+ def build_path_query; end
1864
+
1865
+ # Private method to cleanup +dn+ from using the +path+ component attribute.
1866
+ #
1867
+ # pkg:gem/uri#lib/uri/ldap.rb:120
1868
+ def parse_dn; end
1869
+
1870
+ # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+
1871
+ # from using the +query+ component attribute.
1872
+ #
1873
+ # pkg:gem/uri#lib/uri/ldap.rb:128
1874
+ def parse_query; end
1875
+
1876
+ class << self
1877
+ # == Description
1878
+ #
1879
+ # Creates a new URI::LDAP object from components, with syntax checking.
1880
+ #
1881
+ # The components accepted are host, port, dn, attributes,
1882
+ # scope, filter, and extensions.
1883
+ #
1884
+ # The components should be provided either as an Array, or as a Hash
1885
+ # with keys formed by preceding the component names with a colon.
1886
+ #
1887
+ # If an Array is used, the components must be passed in the
1888
+ # order <code>[host, port, dn, attributes, scope, filter, extensions]</code>.
1889
+ #
1890
+ # Example:
1891
+ #
1892
+ # uri = URI::LDAP.build({:host => 'ldap.example.com',
1893
+ # :dn => '/dc=example'})
1894
+ #
1895
+ # uri = URI::LDAP.build(["ldap.example.com", nil,
1896
+ # "/dc=example;dc=com", "query", nil, nil, nil])
1897
+ #
1898
+ # pkg:gem/uri#lib/uri/ldap.rb:74
1899
+ def build(args); end
1900
+ end
1901
+ end
1902
+
1903
+ # RFC6068, the mailto URL scheme.
1904
+ #
1905
+ # pkg:gem/uri#lib/uri/mailto.rb:17
1906
+ class URI::MailTo < ::URI::Generic
1907
+ include ::URI::RFC2396_REGEXP
1908
+
1909
+ # == Description
1910
+ #
1911
+ # Creates a new URI::MailTo object from generic URL components with
1912
+ # no syntax checking.
1913
+ #
1914
+ # This method is usually called from URI::parse, which checks
1915
+ # the validity of each component.
1916
+ #
1917
+ # pkg:gem/uri#lib/uri/mailto.rb:132
1918
+ def initialize(*arg); end
1919
+
1920
+ # E-mail headers set by the URL, as an Array of Arrays.
1921
+ #
1922
+ # pkg:gem/uri#lib/uri/mailto.rb:166
1923
+ def headers; end
1924
+
1925
+ # Setter for headers +v+.
1926
+ #
1927
+ # pkg:gem/uri#lib/uri/mailto.rb:232
1928
+ def headers=(v); end
1929
+
1930
+ # The primary e-mail address of the URL, as a String.
1931
+ #
1932
+ # pkg:gem/uri#lib/uri/mailto.rb:163
1933
+ def to; end
1934
+
1935
+ # Setter for to +v+.
1936
+ #
1937
+ # pkg:gem/uri#lib/uri/mailto.rb:200
1938
+ def to=(v); end
1939
+
1940
+ # Returns the RFC822 e-mail text equivalent of the URL, as a String.
1941
+ #
1942
+ # Example:
1943
+ #
1944
+ # require 'uri'
1945
+ #
1946
+ # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr")
1947
+ # uri.to_mailtext
1948
+ # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
1949
+ #
1950
+ # pkg:gem/uri#lib/uri/mailto.rb:268
1951
+ def to_mailtext; end
1952
+
1953
+ # pkg:gem/uri#lib/uri/mailto.rb:289
1954
+ def to_rfc822text; end
1955
+
1956
+ # Constructs String from URI.
1957
+ #
1958
+ # pkg:gem/uri#lib/uri/mailto.rb:239
1959
+ def to_s; end
1960
+
1961
+ protected
1962
+
1963
+ # Private setter for headers +v+.
1964
+ #
1965
+ # pkg:gem/uri#lib/uri/mailto.rb:221
1966
+ def set_headers(v); end
1967
+
1968
+ # Private setter for to +v+.
1969
+ #
1970
+ # pkg:gem/uri#lib/uri/mailto.rb:194
1971
+ def set_to(v); end
1972
+
1973
+ private
1974
+
1975
+ # Checks the headers +v+ component against either
1976
+ # * HEADER_REGEXP
1977
+ #
1978
+ # pkg:gem/uri#lib/uri/mailto.rb:208
1979
+ def check_headers(v); end
1980
+
1981
+ # Checks the to +v+ component.
1982
+ #
1983
+ # pkg:gem/uri#lib/uri/mailto.rb:169
1984
+ def check_to(v); end
1985
+
1986
+ class << self
1987
+ # == Description
1988
+ #
1989
+ # Creates a new URI::MailTo object from components, with syntax checking.
1990
+ #
1991
+ # Components can be provided as an Array or Hash. If an Array is used,
1992
+ # the components must be supplied as <code>[to, headers]</code>.
1993
+ #
1994
+ # If a Hash is used, the keys are the component names preceded by colons.
1995
+ #
1996
+ # The headers can be supplied as a pre-encoded string, such as
1997
+ # <code>"subject=subscribe&cc=address"</code>, or as an Array of Arrays
1998
+ # like <code>[['subject', 'subscribe'], ['cc', 'address']]</code>.
1999
+ #
2000
+ # Examples:
2001
+ #
2002
+ # require 'uri'
2003
+ #
2004
+ # m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
2005
+ # m1.to_s # => "mailto:joe@example.com?subject=Ruby"
2006
+ #
2007
+ # m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
2008
+ # m2.to_s # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com"
2009
+ #
2010
+ # m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
2011
+ # m3.to_s # => "mailto:listman@example.com?subject=subscribe"
2012
+ #
2013
+ # pkg:gem/uri#lib/uri/mailto.rb:85
2014
+ def build(args); end
2015
+ end
2016
+ end
2017
+
2018
+ # pkg:gem/uri#lib/uri/common.rb:34
2019
+ URI::PARSER = T.let(T.unsafe(nil), URI::RFC3986_Parser)
2020
+
2021
+ # Class that parses String's into URI's.
2022
+ #
2023
+ # It contains a Hash set of patterns and Regexp's that match and validate.
2024
+ #
2025
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:64
2026
+ class URI::RFC2396_Parser
2027
+ include ::URI::RFC2396_REGEXP
2028
+
2029
+ # == Synopsis
2030
+ #
2031
+ # URI::RFC2396_Parser.new([opts])
2032
+ #
2033
+ # == Args
2034
+ #
2035
+ # The constructor accepts a hash as options for parser.
2036
+ # Keys of options are pattern names of URI components
2037
+ # and values of options are pattern strings.
2038
+ # The constructor generates set of regexps for parsing URIs.
2039
+ #
2040
+ # You can use the following keys:
2041
+ #
2042
+ # * :ESCAPED (URI::PATTERN::ESCAPED in default)
2043
+ # * :UNRESERVED (URI::PATTERN::UNRESERVED in default)
2044
+ # * :DOMLABEL (URI::PATTERN::DOMLABEL in default)
2045
+ # * :TOPLABEL (URI::PATTERN::TOPLABEL in default)
2046
+ # * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
2047
+ #
2048
+ # == Examples
2049
+ #
2050
+ # p = URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
2051
+ # u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD>
2052
+ # URI.parse(u.to_s) #=> raises URI::InvalidURIError
2053
+ #
2054
+ # s = "http://example.com/ABCD"
2055
+ # u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
2056
+ # u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
2057
+ # u1 == u2 #=> true
2058
+ # u1.eql?(u2) #=> false
2059
+ #
2060
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:99
2061
+ def initialize(opts = T.unsafe(nil)); end
2062
+
2063
+ # :call-seq:
2064
+ # escape( str )
2065
+ # escape( str, unsafe )
2066
+ #
2067
+ # == Args
2068
+ #
2069
+ # +str+::
2070
+ # String to make safe
2071
+ # +unsafe+::
2072
+ # Regexp to apply. Defaults to +self.regexp[:UNSAFE]+
2073
+ #
2074
+ # == Description
2075
+ #
2076
+ # Constructs a safe String from +str+, removing unsafe characters,
2077
+ # replacing them with codes.
2078
+ #
2079
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:286
2080
+ def escape(str, unsafe = T.unsafe(nil)); end
2081
+
2082
+ # :call-seq:
2083
+ # extract( str )
2084
+ # extract( str, schemes )
2085
+ # extract( str, schemes ) {|item| block }
2086
+ #
2087
+ # == Args
2088
+ #
2089
+ # +str+::
2090
+ # String to search
2091
+ # +schemes+::
2092
+ # Patterns to apply to +str+
2093
+ #
2094
+ # == Description
2095
+ #
2096
+ # Attempts to parse and merge a set of URIs.
2097
+ # If no +block+ given, then returns the result,
2098
+ # else it calls +block+ for each element in result.
2099
+ #
2100
+ # See also #make_regexp.
2101
+ #
2102
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:248
2103
+ def extract(str, schemes = T.unsafe(nil)); end
2104
+
2105
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:325
2106
+ def inspect; end
2107
+
2108
+ # == Args
2109
+ #
2110
+ # +uris+::
2111
+ # an Array of Strings
2112
+ #
2113
+ # == Description
2114
+ #
2115
+ # Attempts to parse and merge a set of URIs.
2116
+ #
2117
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:222
2118
+ def join(*uris); end
2119
+
2120
+ # Returns Regexp that is default +self.regexp[:ABS_URI_REF]+,
2121
+ # unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+.
2122
+ #
2123
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:261
2124
+ def make_regexp(schemes = T.unsafe(nil)); end
2125
+
2126
+ # == Args
2127
+ #
2128
+ # +uri+::
2129
+ # String
2130
+ #
2131
+ # == Description
2132
+ #
2133
+ # Parses +uri+ and constructs either matching URI scheme object
2134
+ # (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic.
2135
+ #
2136
+ # == Usage
2137
+ #
2138
+ # URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john")
2139
+ # #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
2140
+ #
2141
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:208
2142
+ def parse(uri); end
2143
+
2144
+ # The Hash of patterns.
2145
+ #
2146
+ # See also #initialize_pattern.
2147
+ #
2148
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:112
2149
+ def pattern; end
2150
+
2151
+ # The Hash of Regexp.
2152
+ #
2153
+ # See also #initialize_regexp.
2154
+ #
2155
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:117
2156
+ def regexp; end
2157
+
2158
+ # Returns a split URI against +regexp[:ABS_URI]+.
2159
+ #
2160
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:120
2161
+ def split(uri); end
2162
+
2163
+ # :call-seq:
2164
+ # unescape( str )
2165
+ # unescape( str, escaped )
2166
+ #
2167
+ # == Args
2168
+ #
2169
+ # +str+::
2170
+ # String to remove escapes from
2171
+ # +escaped+::
2172
+ # Regexp to apply. Defaults to +self.regexp[:ESCAPED]+
2173
+ #
2174
+ # == Description
2175
+ #
2176
+ # Removes escapes from +str+.
2177
+ #
2178
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:317
2179
+ def unescape(str, escaped = T.unsafe(nil)); end
2180
+
2181
+ private
2182
+
2183
+ # Returns +uri+ as-is if it is URI, or convert it to URI if it is
2184
+ # a String.
2185
+ #
2186
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:528
2187
+ def convert_to_uri(uri); end
2188
+
2189
+ # Constructs the default Hash of patterns.
2190
+ #
2191
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:337
2192
+ def initialize_pattern(opts = T.unsafe(nil)); end
2193
+
2194
+ # Constructs the default Hash of Regexp's.
2195
+ #
2196
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:495
2197
+ def initialize_regexp(pattern); end
2198
+ end
2199
+
2200
+ # pkg:gem/uri#lib/uri/rfc2396_parser.rb:323
2201
+ URI::RFC2396_Parser::TO_S = T.let(T.unsafe(nil), UnboundMethod)
2202
+
2203
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:3
2204
+ class URI::RFC3986_Parser
2205
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:73
2206
+ def initialize; end
2207
+
2208
+ # Compatibility for RFC2396 parser
2209
+ #
2210
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:156
2211
+ def escape(str, unsafe = T.unsafe(nil)); end
2212
+
2213
+ # Compatibility for RFC2396 parser
2214
+ #
2215
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:144
2216
+ def extract(str, schemes = T.unsafe(nil), &block); end
2217
+
2218
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:169
2219
+ def inspect; end
2220
+
2221
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:138
2222
+ def join(*uris); end
2223
+
2224
+ # Compatibility for RFC2396 parser
2225
+ #
2226
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:150
2227
+ def make_regexp(schemes = T.unsafe(nil)); end
2228
+
2229
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:134
2230
+ def parse(uri); end
2231
+
2232
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:71
2233
+ def regexp; end
2234
+
2235
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:77
2236
+ def split(uri); end
2237
+
2238
+ # Compatibility for RFC2396 parser
2239
+ #
2240
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:162
2241
+ def unescape(str, escaped = T.unsafe(nil)); end
2242
+
2243
+ private
2244
+
2245
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:194
2246
+ def convert_to_uri(uri); end
2247
+
2248
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:180
2249
+ def default_regexp; end
2250
+ end
2251
+
2252
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:33
2253
+ URI::RFC3986_Parser::FRAGMENT = T.let(T.unsafe(nil), String)
2254
+
2255
+ # URI defined in RFC3986
2256
+ #
2257
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:5
2258
+ URI::RFC3986_Parser::HOST = T.let(T.unsafe(nil), Regexp)
2259
+
2260
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:54
2261
+ URI::RFC3986_Parser::RFC3986_relative_ref = T.let(T.unsafe(nil), Regexp)
2262
+
2263
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:30
2264
+ URI::RFC3986_Parser::SCHEME = T.let(T.unsafe(nil), String)
2265
+
2266
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:31
2267
+ URI::RFC3986_Parser::SEG = T.let(T.unsafe(nil), String)
2268
+
2269
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:32
2270
+ URI::RFC3986_Parser::SEG_NC = T.let(T.unsafe(nil), String)
2271
+
2272
+ # pkg:gem/uri#lib/uri/rfc3986_parser.rb:28
2273
+ URI::RFC3986_Parser::USERINFO = T.let(T.unsafe(nil), Regexp)
2274
+
2275
+ # pkg:gem/uri#lib/uri/common.rb:97
2276
+ module URI::Schemes
2277
+ class << self
2278
+ # Use Lo category chars as escaped chars for TruffleRuby, which
2279
+ # does not allow Symbol categories as identifiers.
2280
+ #
2281
+ # pkg:gem/uri#lib/uri/common.rb:104
2282
+ def escape(name); end
2283
+
2284
+ # pkg:gem/uri#lib/uri/common.rb:115
2285
+ def find(name); end
2286
+
2287
+ # pkg:gem/uri#lib/uri/common.rb:126
2288
+ def list; end
2289
+
2290
+ # pkg:gem/uri#lib/uri/common.rb:119
2291
+ def register(name, klass); end
2292
+
2293
+ # pkg:gem/uri#lib/uri/common.rb:111
2294
+ def unescape(name); end
2295
+ end
2296
+ end
2297
+
2298
+ # pkg:gem/uri#lib/uri/common.rb:123
2299
+ URI::Schemes::FILE = URI::File
2300
+
2301
+ # pkg:gem/uri#lib/uri/common.rb:123
2302
+ URI::Schemes::FTP = URI::FTP
2303
+
2304
+ # pkg:gem/uri#lib/uri/common.rb:123
2305
+ URI::Schemes::HTTP = URI::HTTP
2306
+
2307
+ # pkg:gem/uri#lib/uri/common.rb:123
2308
+ URI::Schemes::HTTPS = URI::HTTPS
2309
+
2310
+ # pkg:gem/uri#lib/uri/common.rb:123
2311
+ URI::Schemes::LDAP = URI::LDAP
2312
+
2313
+ # pkg:gem/uri#lib/uri/common.rb:123
2314
+ URI::Schemes::LDAPS = URI::LDAPS
2315
+
2316
+ # pkg:gem/uri#lib/uri/common.rb:123
2317
+ URI::Schemes::MAILTO = URI::MailTo
2318
+
2319
+ # pkg:gem/uri#lib/uri/common.rb:123
2320
+ URI::Schemes::WS = URI::WS
2321
+
2322
+ # pkg:gem/uri#lib/uri/common.rb:123
2323
+ URI::Schemes::WSS = URI::WSS
2324
+
2325
+ # pkg:gem/uri#lib/uri/common.rb:347
2326
+ URI::TBLENCURICOMP_ = T.let(T.unsafe(nil), Hash)
2327
+
2328
+ # pkg:gem/uri#lib/uri/common.rb:65
2329
+ module URI::Util
2330
+ private
2331
+
2332
+ # pkg:gem/uri#lib/uri/common.rb:66
2333
+ def make_components_hash(klass, array_hash); end
2334
+
2335
+ class << self
2336
+ # pkg:gem/uri#lib/uri/common.rb:94
2337
+ def make_components_hash(klass, array_hash); end
2338
+ end
2339
+ end
2340
+
2341
+ # The syntax of WS URIs is defined in RFC6455 section 3.
2342
+ #
2343
+ # Note that the Ruby URI library allows WS URLs containing usernames and
2344
+ # passwords. This is not legal as per the RFC, but used to be
2345
+ # supported in Internet Explorer 5 and 6, before the MS04-004 security
2346
+ # update. See <URL:http://support.microsoft.com/kb/834489>.
2347
+ #
2348
+ # pkg:gem/uri#lib/uri/ws.rb:22
2349
+ class URI::WS < ::URI::Generic
2350
+ # == Description
2351
+ #
2352
+ # Returns the full path for a WS URI, as required by Net::HTTP::Get.
2353
+ #
2354
+ # If the URI contains a query, the full path is URI#path + '?' + URI#query.
2355
+ # Otherwise, the path is simply URI#path.
2356
+ #
2357
+ # Example:
2358
+ #
2359
+ # uri = URI::WS.build(path: '/foo/bar', query: 'test=true')
2360
+ # uri.request_uri # => "/foo/bar?test=true"
2361
+ #
2362
+ # pkg:gem/uri#lib/uri/ws.rb:74
2363
+ def request_uri; end
2364
+
2365
+ class << self
2366
+ # == Description
2367
+ #
2368
+ # Creates a new URI::WS object from components, with syntax checking.
2369
+ #
2370
+ # The components accepted are userinfo, host, port, path, and query.
2371
+ #
2372
+ # The components should be provided either as an Array, or as a Hash
2373
+ # with keys formed by preceding the component names with a colon.
2374
+ #
2375
+ # If an Array is used, the components must be passed in the
2376
+ # order <code>[userinfo, host, port, path, query]</code>.
2377
+ #
2378
+ # Example:
2379
+ #
2380
+ # uri = URI::WS.build(host: 'www.example.com', path: '/foo/bar')
2381
+ #
2382
+ # uri = URI::WS.build([nil, "www.example.com", nil, "/path", "query"])
2383
+ #
2384
+ # Currently, if passed userinfo components this method generates
2385
+ # invalid WS URIs as per RFC 1738.
2386
+ #
2387
+ # pkg:gem/uri#lib/uri/ws.rb:56
2388
+ def build(args); end
2389
+ end
2390
+ end
2391
+
2392
+ # The default port for WSS URIs is 443, and the scheme is 'wss:' rather
2393
+ # than 'ws:'. Other than that, WSS URIs are identical to WS URIs;
2394
+ # see URI::WS.
2395
+ #
2396
+ # pkg:gem/uri#lib/uri/wss.rb:17
2397
+ class URI::WSS < ::URI::WS; end
2398
+
2399
+ # A Default port of 443 for URI::WSS
2400
+ #
2401
+ # pkg:gem/uri#lib/uri/wss.rb:19
2402
+ URI::WSS::DEFAULT_PORT = T.let(T.unsafe(nil), Integer)