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