e621_export_downloader 0.0.1

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