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