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