rails_type_id 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 (124) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +25 -0
  3. data/.ruby-version +1 -0
  4. data/README.md +46 -0
  5. data/Rakefile +16 -0
  6. data/lib/rails_type_id/concern.rb +129 -0
  7. data/lib/rails_type_id/require.rb +6 -0
  8. data/lib/rails_type_id/test_helper.rb +16 -0
  9. data/lib/rails_type_id/version.rb +6 -0
  10. data/lib/rails_type_id.rb +9 -0
  11. data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
  12. data/sig/rails_type_id.rbs +4 -0
  13. data/sorbet/config +4 -0
  14. data/sorbet/rbi/annotations/.gitattributes +1 -0
  15. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  16. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  17. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  18. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  19. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  20. data/sorbet/rbi/annotations/activerecord.rbi +98 -0
  21. data/sorbet/rbi/annotations/activesupport.rbi +468 -0
  22. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/railties.rbi +61 -0
  25. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  26. data/sorbet/rbi/dsl/.gitattributes +1 -0
  27. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
  28. data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
  29. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  30. data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
  31. data/sorbet/rbi/gems/.gitattributes +1 -0
  32. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
  33. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
  34. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
  35. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
  36. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
  37. data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
  38. data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
  39. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
  40. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
  41. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
  42. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
  43. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  44. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  45. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  46. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
  47. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  48. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
  49. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  50. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  51. data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
  52. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  53. data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
  54. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  55. data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
  56. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
  57. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  58. data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
  59. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  60. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  61. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  62. data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
  63. data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
  64. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  65. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  66. data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
  67. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
  68. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  69. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  70. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
  71. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  72. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
  73. data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
  79. data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
  80. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  81. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
  82. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
  83. data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
  84. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  85. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
  86. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
  87. data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
  88. data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
  89. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  90. data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
  91. data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
  92. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
  93. data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
  95. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  96. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  97. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
  98. data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
  99. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  100. data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
  101. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  102. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  103. data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
  104. data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
  105. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  106. data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
  107. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  108. data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
  109. data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
  110. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  111. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  112. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  113. data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
  114. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  115. data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
  118. data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
  119. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
  120. data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
  121. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +13 -0
  124. metadata +208 -0
@@ -0,0 +1,2354 @@
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#879
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
+ class URI::GID < ::URI::Generic; end
707
+
708
+ # Base class for all URI classes.
709
+ # Implements generic URI syntax as per RFC 2396.
710
+ #
711
+ # source://uri//lib/uri/generic.rb#21
712
+ class URI::Generic
713
+ include ::URI
714
+
715
+ # == Args
716
+ #
717
+ # +scheme+::
718
+ # Protocol scheme, i.e. 'http','ftp','mailto' and so on.
719
+ # +userinfo+::
720
+ # User name and password, i.e. 'sdmitry:bla'.
721
+ # +host+::
722
+ # Server host name.
723
+ # +port+::
724
+ # Server port.
725
+ # +registry+::
726
+ # Registry of naming authorities.
727
+ # +path+::
728
+ # Path on server.
729
+ # +opaque+::
730
+ # Opaque part.
731
+ # +query+::
732
+ # Query data.
733
+ # +fragment+::
734
+ # Part of the URI after '#' character.
735
+ # +parser+::
736
+ # Parser for internal use [URI::DEFAULT_PARSER by default].
737
+ # +arg_check+::
738
+ # Check arguments [false by default].
739
+ #
740
+ # == Description
741
+ #
742
+ # Creates a new URI::Generic instance from ``generic'' components without check.
743
+ #
744
+ # @return [Generic] a new instance of Generic
745
+ #
746
+ # source://uri//lib/uri/generic.rb#169
747
+ def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end
748
+
749
+ # == Args
750
+ #
751
+ # +oth+::
752
+ # URI or String
753
+ #
754
+ # == Description
755
+ #
756
+ # Merges two URIs.
757
+ #
758
+ # == Usage
759
+ #
760
+ # require 'uri'
761
+ #
762
+ # uri = URI.parse("http://my.example.com")
763
+ # uri.merge("/main.rbx?page=1")
764
+ # # => "http://my.example.com/main.rbx?page=1"
765
+ # merge
766
+ #
767
+ # source://uri//lib/uri/generic.rb#1151
768
+ def +(oth); end
769
+
770
+ # == Args
771
+ #
772
+ # +oth+::
773
+ # URI or String
774
+ #
775
+ # == Description
776
+ #
777
+ # Calculates relative path from oth to self.
778
+ #
779
+ # == Usage
780
+ #
781
+ # require 'uri'
782
+ #
783
+ # uri = URI.parse('http://my.example.com/main.rbx?page=1')
784
+ # uri.route_from('http://my.example.com')
785
+ # #=> #<URI::Generic /main.rbx?page=1>
786
+ #
787
+ # source://uri//lib/uri/generic.rb#1281
788
+ def -(oth); end
789
+
790
+ # Compares two URIs.
791
+ #
792
+ # source://uri//lib/uri/generic.rb#1386
793
+ def ==(oth); end
794
+
795
+ # Returns true if URI has a scheme (e.g. http:// or https://) specified.
796
+ #
797
+ # @return [Boolean]
798
+ #
799
+ # source://uri//lib/uri/generic.rb#979
800
+ def absolute; end
801
+
802
+ # Returns true if URI has a scheme (e.g. http:// or https://) specified.
803
+ #
804
+ # @return [Boolean]
805
+ #
806
+ # source://uri//lib/uri/generic.rb#972
807
+ def absolute?; end
808
+
809
+ # == Args
810
+ #
811
+ # +v+::
812
+ # URI or String
813
+ #
814
+ # == Description
815
+ #
816
+ # Attempts to parse other URI +oth+,
817
+ # returns [parsed_oth, self].
818
+ #
819
+ # == Usage
820
+ #
821
+ # require 'uri'
822
+ #
823
+ # uri = URI.parse("http://my.example.com")
824
+ # uri.coerce("http://foo.com")
825
+ # #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]
826
+ #
827
+ # source://uri//lib/uri/generic.rb#1465
828
+ def coerce(oth); end
829
+
830
+ # Components of the URI in the order.
831
+ #
832
+ # source://uri//lib/uri/generic.rb#313
833
+ def component; end
834
+
835
+ # Returns the password component after URI decoding.
836
+ #
837
+ # source://uri//lib/uri/generic.rb#583
838
+ def decoded_password; end
839
+
840
+ # Returns the user component after URI decoding.
841
+ #
842
+ # source://uri//lib/uri/generic.rb#578
843
+ def decoded_user; end
844
+
845
+ # Returns default port.
846
+ #
847
+ # source://uri//lib/uri/generic.rb#39
848
+ def default_port; end
849
+
850
+ # Compares with _oth_ for Hash.
851
+ #
852
+ # @return [Boolean]
853
+ #
854
+ # source://uri//lib/uri/generic.rb#1400
855
+ def eql?(oth); end
856
+
857
+ # Returns a proxy URI.
858
+ # The proxy URI is obtained from environment variables such as http_proxy,
859
+ # ftp_proxy, no_proxy, etc.
860
+ # If there is no proper proxy, nil is returned.
861
+ #
862
+ # If the optional parameter +env+ is specified, it is used instead of ENV.
863
+ #
864
+ # Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.)
865
+ # are examined, too.
866
+ #
867
+ # But http_proxy and HTTP_PROXY is treated specially under CGI environment.
868
+ # It's because HTTP_PROXY may be set by Proxy: header.
869
+ # So HTTP_PROXY is not used.
870
+ # http_proxy is not used too if the variable is case insensitive.
871
+ # CGI_HTTP_PROXY can be used instead.
872
+ #
873
+ # @raise [BadURIError]
874
+ #
875
+ # source://uri//lib/uri/generic.rb#1491
876
+ def find_proxy(env = T.unsafe(nil)); end
877
+
878
+ # Returns the fragment component of the URI.
879
+ #
880
+ # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies"
881
+ #
882
+ # source://uri//lib/uri/generic.rb#283
883
+ def fragment; end
884
+
885
+ # Checks the fragment +v+ component against the URI::Parser Regexp for :FRAGMENT.
886
+ #
887
+ #
888
+ # == Args
889
+ #
890
+ # +v+::
891
+ # String
892
+ #
893
+ # == Description
894
+ #
895
+ # Public setter for the fragment component +v+
896
+ # (with validation).
897
+ #
898
+ # == Usage
899
+ #
900
+ # require 'uri'
901
+ #
902
+ # uri = URI.parse("http://my.example.com/?id=25#time=1305212049")
903
+ # uri.fragment = "time=1305212086"
904
+ # uri.to_s #=> "http://my.example.com/?id=25#time=1305212086"
905
+ #
906
+ # source://uri//lib/uri/generic.rb#929
907
+ def fragment=(v); end
908
+
909
+ # Returns the hash value.
910
+ #
911
+ # source://uri//lib/uri/generic.rb#1395
912
+ def hash; end
913
+
914
+ # Returns true if URI is hierarchical.
915
+ #
916
+ # == Description
917
+ #
918
+ # URI has components listed in order of decreasing significance from left to right,
919
+ # see RFC3986 https://www.rfc-editor.org/rfc/rfc3986 1.2.3.
920
+ #
921
+ # == Usage
922
+ #
923
+ # require 'uri'
924
+ #
925
+ # uri = URI.parse("http://my.example.com/")
926
+ # uri.hierarchical?
927
+ # #=> true
928
+ # uri = URI.parse("mailto:joe@example.com")
929
+ # uri.hierarchical?
930
+ # #=> false
931
+ #
932
+ # @return [Boolean]
933
+ #
934
+ # source://uri//lib/uri/generic.rb#961
935
+ def hierarchical?; end
936
+
937
+ # Returns the host component of the URI.
938
+ #
939
+ # URI("http://foo/bar/baz").host #=> "foo"
940
+ #
941
+ # It returns nil if no host component exists.
942
+ #
943
+ # URI("mailto:foo@example.org").host #=> nil
944
+ #
945
+ # The component does not contain the port number.
946
+ #
947
+ # URI("http://foo:8080/bar/baz").host #=> "foo"
948
+ #
949
+ # Since IPv6 addresses are wrapped with brackets in URIs,
950
+ # this method returns IPv6 addresses wrapped with brackets.
951
+ # This form is not appropriate to pass to socket methods such as TCPSocket.open.
952
+ # If unwrapped host names are required, use the #hostname method.
953
+ #
954
+ # URI("http://[::1]/bar/baz").host #=> "[::1]"
955
+ # URI("http://[::1]/bar/baz").hostname #=> "::1"
956
+ #
957
+ # source://uri//lib/uri/generic.rb#243
958
+ def host; end
959
+
960
+ # == Args
961
+ #
962
+ # +v+::
963
+ # String
964
+ #
965
+ # == Description
966
+ #
967
+ # Public setter for the host component +v+
968
+ # (with validation).
969
+ #
970
+ # See also URI::Generic.check_host.
971
+ #
972
+ # == Usage
973
+ #
974
+ # require 'uri'
975
+ #
976
+ # uri = URI.parse("http://my.example.com")
977
+ # uri.host = "foo.com"
978
+ # uri.to_s #=> "http://foo.com"
979
+ #
980
+ # source://uri//lib/uri/generic.rb#639
981
+ def host=(v); end
982
+
983
+ # Extract the host part of the URI and unwrap brackets for IPv6 addresses.
984
+ #
985
+ # This method is the same as URI::Generic#host except
986
+ # brackets for IPv6 (and future IP) addresses are removed.
987
+ #
988
+ # uri = URI("http://[::1]/bar")
989
+ # uri.hostname #=> "::1"
990
+ # uri.host #=> "[::1]"
991
+ #
992
+ # source://uri//lib/uri/generic.rb#654
993
+ def hostname; end
994
+
995
+ # Sets the host part of the URI as the argument with brackets for IPv6 addresses.
996
+ #
997
+ # This method is the same as URI::Generic#host= except
998
+ # the argument can be a bare IPv6 address.
999
+ #
1000
+ # uri = URI("http://foo/bar")
1001
+ # uri.hostname = "::1"
1002
+ # uri.to_s #=> "http://[::1]/bar"
1003
+ #
1004
+ # If the argument seems to be an IPv6 address,
1005
+ # it is wrapped with brackets.
1006
+ #
1007
+ # source://uri//lib/uri/generic.rb#671
1008
+ def hostname=(v); end
1009
+
1010
+ # source://uri//lib/uri/generic.rb#1442
1011
+ def inspect; end
1012
+
1013
+ # == Args
1014
+ #
1015
+ # +oth+::
1016
+ # URI or String
1017
+ #
1018
+ # == Description
1019
+ #
1020
+ # Merges two URIs.
1021
+ #
1022
+ # == Usage
1023
+ #
1024
+ # require 'uri'
1025
+ #
1026
+ # uri = URI.parse("http://my.example.com")
1027
+ # uri.merge("/main.rbx?page=1")
1028
+ # # => "http://my.example.com/main.rbx?page=1"
1029
+ #
1030
+ # source://uri//lib/uri/generic.rb#1109
1031
+ def merge(oth); end
1032
+
1033
+ # == Args
1034
+ #
1035
+ # +oth+::
1036
+ # URI or String
1037
+ #
1038
+ # == Description
1039
+ #
1040
+ # Destructive form of #merge.
1041
+ #
1042
+ # == Usage
1043
+ #
1044
+ # require 'uri'
1045
+ #
1046
+ # uri = URI.parse("http://my.example.com")
1047
+ # uri.merge!("/main.rbx?page=1")
1048
+ # uri.to_s # => "http://my.example.com/main.rbx?page=1"
1049
+ #
1050
+ # source://uri//lib/uri/generic.rb#1081
1051
+ def merge!(oth); end
1052
+
1053
+ # Returns normalized URI.
1054
+ #
1055
+ # require 'uri'
1056
+ #
1057
+ # URI("HTTP://my.EXAMPLE.com").normalize
1058
+ # #=> #<URI::HTTP http://my.example.com/>
1059
+ #
1060
+ # Normalization here means:
1061
+ #
1062
+ # * scheme and host are converted to lowercase,
1063
+ # * an empty path component is set to "/".
1064
+ #
1065
+ # source://uri//lib/uri/generic.rb#1318
1066
+ def normalize; end
1067
+
1068
+ # Destructive version of #normalize.
1069
+ #
1070
+ # source://uri//lib/uri/generic.rb#1327
1071
+ def normalize!; end
1072
+
1073
+ # Returns the opaque part of the URI.
1074
+ #
1075
+ # URI("mailto:foo@example.org").opaque #=> "foo@example.org"
1076
+ # URI("http://foo/bar/baz").opaque #=> nil
1077
+ #
1078
+ # The portion of the path that does not make use of the slash '/'.
1079
+ # The path typically refers to an absolute path or an opaque part.
1080
+ # (See RFC2396 Section 3 and 5.2.)
1081
+ #
1082
+ # source://uri//lib/uri/generic.rb#277
1083
+ def opaque; end
1084
+
1085
+ # == Args
1086
+ #
1087
+ # +v+::
1088
+ # String
1089
+ #
1090
+ # == Description
1091
+ #
1092
+ # Public setter for the opaque component +v+
1093
+ # (with validation).
1094
+ #
1095
+ # See also URI::Generic.check_opaque.
1096
+ #
1097
+ # source://uri//lib/uri/generic.rb#901
1098
+ def opaque=(v); end
1099
+
1100
+ # Returns the parser to be used.
1101
+ #
1102
+ # Unless a URI::Parser is defined, DEFAULT_PARSER is used.
1103
+ #
1104
+ # source://uri//lib/uri/generic.rb#289
1105
+ def parser; end
1106
+
1107
+ # Returns the password component (without URI decoding).
1108
+ #
1109
+ # source://uri//lib/uri/generic.rb#573
1110
+ def password; end
1111
+
1112
+ # == Args
1113
+ #
1114
+ # +v+::
1115
+ # String
1116
+ #
1117
+ # == Description
1118
+ #
1119
+ # Public setter for the +password+ component
1120
+ # (with validation).
1121
+ #
1122
+ # See also URI::Generic.check_password.
1123
+ #
1124
+ # == Usage
1125
+ #
1126
+ # require 'uri'
1127
+ #
1128
+ # uri = URI.parse("http://john:S3nsit1ve@my.example.com")
1129
+ # uri.password = "V3ry_S3nsit1ve"
1130
+ # uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com"
1131
+ #
1132
+ # source://uri//lib/uri/generic.rb#498
1133
+ def password=(password); end
1134
+
1135
+ # Returns the path component of the URI.
1136
+ #
1137
+ # URI("http://foo/bar/baz").path #=> "/bar/baz"
1138
+ #
1139
+ # source://uri//lib/uri/generic.rb#260
1140
+ def path; end
1141
+
1142
+ # == Args
1143
+ #
1144
+ # +v+::
1145
+ # String
1146
+ #
1147
+ # == Description
1148
+ #
1149
+ # Public setter for the path component +v+
1150
+ # (with validation).
1151
+ #
1152
+ # See also URI::Generic.check_path.
1153
+ #
1154
+ # == Usage
1155
+ #
1156
+ # require 'uri'
1157
+ #
1158
+ # uri = URI.parse("http://my.example.com/pub/files")
1159
+ # uri.path = "/faq/"
1160
+ # uri.to_s #=> "http://my.example.com/faq/"
1161
+ #
1162
+ # source://uri//lib/uri/generic.rb#815
1163
+ def path=(v); end
1164
+
1165
+ # Returns the port component of the URI.
1166
+ #
1167
+ # URI("http://foo/bar/baz").port #=> 80
1168
+ # URI("http://foo:8080/bar/baz").port #=> 8080
1169
+ #
1170
+ # source://uri//lib/uri/generic.rb#250
1171
+ def port; end
1172
+
1173
+ # == Args
1174
+ #
1175
+ # +v+::
1176
+ # String
1177
+ #
1178
+ # == Description
1179
+ #
1180
+ # Public setter for the port component +v+
1181
+ # (with validation).
1182
+ #
1183
+ # See also URI::Generic.check_port.
1184
+ #
1185
+ # == Usage
1186
+ #
1187
+ # require 'uri'
1188
+ #
1189
+ # uri = URI.parse("http://my.example.com")
1190
+ # uri.port = 8080
1191
+ # uri.to_s #=> "http://my.example.com:8080"
1192
+ #
1193
+ # source://uri//lib/uri/generic.rb#729
1194
+ def port=(v); end
1195
+
1196
+ # Returns the query component of the URI.
1197
+ #
1198
+ # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar"
1199
+ #
1200
+ # source://uri//lib/uri/generic.rb#266
1201
+ def query; end
1202
+
1203
+ # == Args
1204
+ #
1205
+ # +v+::
1206
+ # String
1207
+ #
1208
+ # == Description
1209
+ #
1210
+ # Public setter for the query component +v+.
1211
+ #
1212
+ # == Usage
1213
+ #
1214
+ # require 'uri'
1215
+ #
1216
+ # uri = URI.parse("http://my.example.com/?id=25")
1217
+ # uri.query = "id=1"
1218
+ # uri.to_s #=> "http://my.example.com/?id=1"
1219
+ #
1220
+ # @raise [InvalidURIError]
1221
+ #
1222
+ # source://uri//lib/uri/generic.rb#839
1223
+ def query=(v); end
1224
+
1225
+ # source://uri//lib/uri/generic.rb#252
1226
+ def registry; end
1227
+
1228
+ # @raise [InvalidURIError]
1229
+ #
1230
+ # source://uri//lib/uri/generic.rb#745
1231
+ def registry=(v); end
1232
+
1233
+ # Returns true if URI does not have a scheme (e.g. http:// or https://) specified.
1234
+ #
1235
+ # @return [Boolean]
1236
+ #
1237
+ # source://uri//lib/uri/generic.rb#984
1238
+ def relative?; end
1239
+
1240
+ # == Args
1241
+ #
1242
+ # +oth+::
1243
+ # URI or String
1244
+ #
1245
+ # == Description
1246
+ #
1247
+ # Calculates relative path from oth to self.
1248
+ #
1249
+ # == Usage
1250
+ #
1251
+ # require 'uri'
1252
+ #
1253
+ # uri = URI.parse('http://my.example.com/main.rbx?page=1')
1254
+ # uri.route_from('http://my.example.com')
1255
+ # #=> #<URI::Generic /main.rbx?page=1>
1256
+ #
1257
+ # source://uri//lib/uri/generic.rb#1261
1258
+ def route_from(oth); end
1259
+
1260
+ # == Args
1261
+ #
1262
+ # +oth+::
1263
+ # URI or String
1264
+ #
1265
+ # == Description
1266
+ #
1267
+ # Calculates relative path to oth from self.
1268
+ #
1269
+ # == Usage
1270
+ #
1271
+ # require 'uri'
1272
+ #
1273
+ # uri = URI.parse('http://my.example.com')
1274
+ # uri.route_to('http://my.example.com/main.rbx?page=1')
1275
+ # #=> #<URI::Generic /main.rbx?page=1>
1276
+ #
1277
+ # source://uri//lib/uri/generic.rb#1301
1278
+ def route_to(oth); end
1279
+
1280
+ # Returns the scheme component of the URI.
1281
+ #
1282
+ # URI("http://foo/bar/baz").scheme #=> "http"
1283
+ #
1284
+ # source://uri//lib/uri/generic.rb#221
1285
+ def scheme; end
1286
+
1287
+ # == Args
1288
+ #
1289
+ # +v+::
1290
+ # String
1291
+ #
1292
+ # == Description
1293
+ #
1294
+ # Public setter for the scheme component +v+
1295
+ # (with validation).
1296
+ #
1297
+ # See also URI::Generic.check_scheme.
1298
+ #
1299
+ # == Usage
1300
+ #
1301
+ # require 'uri'
1302
+ #
1303
+ # uri = URI.parse("http://my.example.com")
1304
+ # uri.scheme = "https"
1305
+ # uri.to_s #=> "https://my.example.com"
1306
+ #
1307
+ # source://uri//lib/uri/generic.rb#360
1308
+ def scheme=(v); end
1309
+
1310
+ # == Args
1311
+ #
1312
+ # +components+::
1313
+ # Multiple Symbol arguments defined in URI::HTTP.
1314
+ #
1315
+ # == Description
1316
+ #
1317
+ # Selects specified components from URI.
1318
+ #
1319
+ # == Usage
1320
+ #
1321
+ # require 'uri'
1322
+ #
1323
+ # uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx')
1324
+ # uri.select(:userinfo, :host, :path)
1325
+ # # => ["myuser:mypass", "my.example.com", "/test.rbx"]
1326
+ #
1327
+ # source://uri//lib/uri/generic.rb#1431
1328
+ def select(*components); end
1329
+
1330
+ # Constructs String from URI.
1331
+ #
1332
+ # source://uri//lib/uri/generic.rb#1342
1333
+ def to_s; end
1334
+
1335
+ # Constructs String from URI.
1336
+ #
1337
+ # source://uri//lib/uri/generic.rb#1381
1338
+ def to_str; end
1339
+
1340
+ # Returns the user component (without URI decoding).
1341
+ #
1342
+ # source://uri//lib/uri/generic.rb#568
1343
+ def user; end
1344
+
1345
+ # == Args
1346
+ #
1347
+ # +v+::
1348
+ # String
1349
+ #
1350
+ # == Description
1351
+ #
1352
+ # Public setter for the +user+ component
1353
+ # (with validation).
1354
+ #
1355
+ # See also URI::Generic.check_user.
1356
+ #
1357
+ # == Usage
1358
+ #
1359
+ # require 'uri'
1360
+ #
1361
+ # uri = URI.parse("http://john:S3nsit1ve@my.example.com")
1362
+ # uri.user = "sam"
1363
+ # uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com"
1364
+ #
1365
+ # source://uri//lib/uri/generic.rb#471
1366
+ def user=(user); end
1367
+
1368
+ # Returns the userinfo, either as 'user' or 'user:password'.
1369
+ #
1370
+ # source://uri//lib/uri/generic.rb#557
1371
+ def userinfo; end
1372
+
1373
+ # Sets userinfo, argument is string like 'name:pass'.
1374
+ #
1375
+ # source://uri//lib/uri/generic.rb#441
1376
+ def userinfo=(userinfo); end
1377
+
1378
+ protected
1379
+
1380
+ # Returns an Array of the components defined from the COMPONENT Array.
1381
+ #
1382
+ # source://uri//lib/uri/generic.rb#1407
1383
+ def component_ary; end
1384
+
1385
+ # Protected setter for the host component +v+.
1386
+ #
1387
+ # See also URI::Generic.host=.
1388
+ #
1389
+ # source://uri//lib/uri/generic.rb#613
1390
+ def set_host(v); end
1391
+
1392
+ # Protected setter for the opaque component +v+.
1393
+ #
1394
+ # See also URI::Generic.opaque=.
1395
+ #
1396
+ # source://uri//lib/uri/generic.rb#883
1397
+ def set_opaque(v); end
1398
+
1399
+ # Protected setter for the password component +v+.
1400
+ #
1401
+ # See also URI::Generic.password=.
1402
+ #
1403
+ # source://uri//lib/uri/generic.rb#534
1404
+ def set_password(v); end
1405
+
1406
+ # Protected setter for the path component +v+.
1407
+ #
1408
+ # See also URI::Generic.path=.
1409
+ #
1410
+ # source://uri//lib/uri/generic.rb#789
1411
+ def set_path(v); end
1412
+
1413
+ # Protected setter for the port component +v+.
1414
+ #
1415
+ # See also URI::Generic.port=.
1416
+ #
1417
+ # source://uri//lib/uri/generic.rb#702
1418
+ def set_port(v); end
1419
+
1420
+ # @raise [InvalidURIError]
1421
+ #
1422
+ # source://uri//lib/uri/generic.rb#740
1423
+ def set_registry(v); end
1424
+
1425
+ # Protected setter for the scheme component +v+.
1426
+ #
1427
+ # See also URI::Generic.scheme=.
1428
+ #
1429
+ # source://uri//lib/uri/generic.rb#334
1430
+ def set_scheme(v); end
1431
+
1432
+ # Protected setter for the user component +v+.
1433
+ #
1434
+ # See also URI::Generic.user=.
1435
+ #
1436
+ # source://uri//lib/uri/generic.rb#524
1437
+ def set_user(v); end
1438
+
1439
+ # Protected setter for the +user+ component, and +password+ if available
1440
+ # (with validation).
1441
+ #
1442
+ # See also URI::Generic.userinfo=.
1443
+ #
1444
+ # source://uri//lib/uri/generic.rb#509
1445
+ def set_userinfo(user, password = T.unsafe(nil)); end
1446
+
1447
+ private
1448
+
1449
+ # Checks the host +v+ component for RFC2396 compliance
1450
+ # and against the URI::Parser Regexp for :HOST.
1451
+ #
1452
+ # Can not have a registry or opaque component defined,
1453
+ # with a host component defined.
1454
+ #
1455
+ # source://uri//lib/uri/generic.rb#594
1456
+ def check_host(v); end
1457
+
1458
+ # Checks the opaque +v+ component for RFC2396 compliance and
1459
+ # against the URI::Parser Regexp for :OPAQUE.
1460
+ #
1461
+ # Can not have a host, port, user, or path component defined,
1462
+ # with an opaque component defined.
1463
+ #
1464
+ # source://uri//lib/uri/generic.rb#861
1465
+ def check_opaque(v); end
1466
+
1467
+ # Checks the password +v+ component for RFC2396 compliance
1468
+ # and against the URI::Parser Regexp for :USERINFO.
1469
+ #
1470
+ # Can not have a registry or opaque component defined,
1471
+ # with a user component defined.
1472
+ #
1473
+ # source://uri//lib/uri/generic.rb#417
1474
+ def check_password(v, user = T.unsafe(nil)); end
1475
+
1476
+ # Checks the path +v+ component for RFC2396 compliance
1477
+ # and against the URI::Parser Regexp
1478
+ # for :ABS_PATH and :REL_PATH.
1479
+ #
1480
+ # Can not have a opaque component defined,
1481
+ # with a path component defined.
1482
+ #
1483
+ # source://uri//lib/uri/generic.rb#757
1484
+ def check_path(v); end
1485
+
1486
+ # Checks the port +v+ component for RFC2396 compliance
1487
+ # and against the URI::Parser Regexp for :PORT.
1488
+ #
1489
+ # Can not have a registry or opaque component defined,
1490
+ # with a port component defined.
1491
+ #
1492
+ # source://uri//lib/uri/generic.rb#683
1493
+ def check_port(v); end
1494
+
1495
+ # @raise [InvalidURIError]
1496
+ #
1497
+ # source://uri//lib/uri/generic.rb#735
1498
+ def check_registry(v); end
1499
+
1500
+ # Checks the scheme +v+ component against the URI::Parser Regexp for :SCHEME.
1501
+ #
1502
+ # source://uri//lib/uri/generic.rb#320
1503
+ def check_scheme(v); end
1504
+
1505
+ # Checks the user +v+ component for RFC2396 compliance
1506
+ # and against the URI::Parser Regexp for :USERINFO.
1507
+ #
1508
+ # Can not have a registry or opaque component defined,
1509
+ # with a user component defined.
1510
+ #
1511
+ # source://uri//lib/uri/generic.rb#393
1512
+ def check_user(v); end
1513
+
1514
+ # Checks the +user+ and +password+.
1515
+ #
1516
+ # If +password+ is not provided, then +user+ is
1517
+ # split, using URI::Generic.split_userinfo, to
1518
+ # pull +user+ and +password.
1519
+ #
1520
+ # See also URI::Generic.check_user, URI::Generic.check_password.
1521
+ #
1522
+ # source://uri//lib/uri/generic.rb#375
1523
+ def check_userinfo(user, password = T.unsafe(nil)); end
1524
+
1525
+ # Escapes 'user:password' +v+ based on RFC 1738 section 3.1.
1526
+ #
1527
+ # source://uri//lib/uri/generic.rb#551
1528
+ def escape_userpass(v); end
1529
+
1530
+ # Merges a base path +base+, with relative path +rel+,
1531
+ # returns a modified base path.
1532
+ #
1533
+ # source://uri//lib/uri/generic.rb#1000
1534
+ def merge_path(base, rel); end
1535
+
1536
+ # Replaces self by other URI object.
1537
+ #
1538
+ # source://uri//lib/uri/generic.rb#299
1539
+ def replace!(oth); end
1540
+
1541
+ # :stopdoc:
1542
+ #
1543
+ # source://uri//lib/uri/generic.rb#1193
1544
+ def route_from0(oth); end
1545
+
1546
+ # :stopdoc:
1547
+ #
1548
+ # source://uri//lib/uri/generic.rb#1154
1549
+ def route_from_path(src, dst); end
1550
+
1551
+ # Returns an Array of the path split on '/'.
1552
+ #
1553
+ # source://uri//lib/uri/generic.rb#991
1554
+ def split_path(path); end
1555
+
1556
+ # Returns the userinfo +ui+ as <code>[user, password]</code>
1557
+ # if properly formatted as 'user:password'.
1558
+ #
1559
+ # source://uri//lib/uri/generic.rb#542
1560
+ def split_userinfo(ui); end
1561
+
1562
+ class << self
1563
+ # == Synopsis
1564
+ #
1565
+ # See ::new.
1566
+ #
1567
+ # == Description
1568
+ #
1569
+ # Creates a new URI::Generic instance from components of URI::Generic
1570
+ # with check. Components are: scheme, userinfo, host, port, registry, path,
1571
+ # opaque, query, and fragment. You can provide arguments either by an Array or a Hash.
1572
+ # See ::new for hash keys to use or for order of array items.
1573
+ #
1574
+ # source://uri//lib/uri/generic.rb#116
1575
+ def build(args); end
1576
+
1577
+ # == Synopsis
1578
+ #
1579
+ # See ::new.
1580
+ #
1581
+ # == Description
1582
+ #
1583
+ # At first, tries to create a new URI::Generic instance using
1584
+ # URI::Generic::build. But, if exception URI::InvalidComponentError is raised,
1585
+ # then it does URI::Escape.escape all URI components and tries again.
1586
+ #
1587
+ # source://uri//lib/uri/generic.rb#78
1588
+ def build2(args); end
1589
+
1590
+ # Components of the URI in the order.
1591
+ #
1592
+ # source://uri//lib/uri/generic.rb#57
1593
+ def component; end
1594
+
1595
+ # Returns default port.
1596
+ #
1597
+ # source://uri//lib/uri/generic.rb#32
1598
+ def default_port; end
1599
+
1600
+ # @return [Boolean]
1601
+ #
1602
+ # source://uri//lib/uri/generic.rb#1557
1603
+ def use_proxy?(hostname, addr, port, no_proxy); end
1604
+
1605
+ # source://uri//lib/uri/generic.rb#63
1606
+ def use_registry; end
1607
+ end
1608
+ end
1609
+
1610
+ # The syntax of HTTP URIs is defined in RFC1738 section 3.3.
1611
+ #
1612
+ # Note that the Ruby URI library allows HTTP URLs containing usernames and
1613
+ # passwords. This is not legal as per the RFC, but used to be
1614
+ # supported in Internet Explorer 5 and 6, before the MS04-004 security
1615
+ # update. See <URL:http://support.microsoft.com/kb/834489>.
1616
+ #
1617
+ # source://uri//lib/uri/http.rb#22
1618
+ class URI::HTTP < ::URI::Generic
1619
+ # == Description
1620
+ #
1621
+ # Returns the authority for an HTTP uri, as defined in
1622
+ # https://www.rfc-editor.org/rfc/rfc3986#section-3.2.
1623
+ #
1624
+ #
1625
+ # Example:
1626
+ #
1627
+ # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
1628
+ # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
1629
+ # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
1630
+ #
1631
+ # source://uri//lib/uri/http.rb#97
1632
+ def authority; end
1633
+
1634
+ # == Description
1635
+ #
1636
+ # Returns the origin for an HTTP uri, as defined in
1637
+ # https://www.rfc-editor.org/rfc/rfc6454.
1638
+ #
1639
+ #
1640
+ # Example:
1641
+ #
1642
+ # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
1643
+ # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
1644
+ # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
1645
+ # URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
1646
+ #
1647
+ # source://uri//lib/uri/http.rb#119
1648
+ def origin; end
1649
+
1650
+ # == Description
1651
+ #
1652
+ # Returns the full path for an HTTP request, as required by Net::HTTP::Get.
1653
+ #
1654
+ # If the URI contains a query, the full path is URI#path + '?' + URI#query.
1655
+ # Otherwise, the path is simply URI#path.
1656
+ #
1657
+ # Example:
1658
+ #
1659
+ # uri = URI::HTTP.build(path: '/foo/bar', query: 'test=true')
1660
+ # uri.request_uri # => "/foo/bar?test=true"
1661
+ #
1662
+ # source://uri//lib/uri/http.rb#77
1663
+ def request_uri; end
1664
+
1665
+ class << self
1666
+ # == Description
1667
+ #
1668
+ # Creates a new URI::HTTP object from components, with syntax checking.
1669
+ #
1670
+ # The components accepted are userinfo, host, port, path, query, and
1671
+ # fragment.
1672
+ #
1673
+ # The components should be provided either as an Array, or as a Hash
1674
+ # with keys formed by preceding the component names with a colon.
1675
+ #
1676
+ # If an Array is used, the components must be passed in the
1677
+ # order <code>[userinfo, host, port, path, query, fragment]</code>.
1678
+ #
1679
+ # Example:
1680
+ #
1681
+ # uri = URI::HTTP.build(host: 'www.example.com', path: '/foo/bar')
1682
+ #
1683
+ # uri = URI::HTTP.build([nil, "www.example.com", nil, "/path",
1684
+ # "query", 'fragment'])
1685
+ #
1686
+ # Currently, if passed userinfo components this method generates
1687
+ # invalid HTTP URIs as per RFC 1738.
1688
+ #
1689
+ # source://uri//lib/uri/http.rb#59
1690
+ def build(args); end
1691
+ end
1692
+ end
1693
+
1694
+ # source://uri//lib/uri/common.rb#130
1695
+ URI::INITIAL_SCHEMES = T.let(T.unsafe(nil), Hash)
1696
+
1697
+ # LDAP URI SCHEMA (described in RFC2255).
1698
+ # --
1699
+ # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
1700
+ # ++
1701
+ #
1702
+ # source://uri//lib/uri/ldap.rb#23
1703
+ class URI::LDAP < ::URI::Generic
1704
+ # == Description
1705
+ #
1706
+ # Creates a new URI::LDAP object from generic URI components as per
1707
+ # RFC 2396. No LDAP-specific syntax checking is performed.
1708
+ #
1709
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
1710
+ # +opaque+, +query+, and +fragment+, in that order.
1711
+ #
1712
+ # Example:
1713
+ #
1714
+ # uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
1715
+ # "/dc=example;dc=com", nil, "query", nil)
1716
+ #
1717
+ # See also URI::Generic.new.
1718
+ #
1719
+ # @return [LDAP] a new instance of LDAP
1720
+ #
1721
+ # source://uri//lib/uri/ldap.rb#108
1722
+ def initialize(*arg); end
1723
+
1724
+ # Returns attributes.
1725
+ #
1726
+ # source://uri//lib/uri/ldap.rb#178
1727
+ def attributes; end
1728
+
1729
+ # Setter for attributes +val+.
1730
+ #
1731
+ # source://uri//lib/uri/ldap.rb#191
1732
+ def attributes=(val); end
1733
+
1734
+ # Returns dn.
1735
+ #
1736
+ # source://uri//lib/uri/ldap.rb#159
1737
+ def dn; end
1738
+
1739
+ # Setter for dn +val+.
1740
+ #
1741
+ # source://uri//lib/uri/ldap.rb#172
1742
+ def dn=(val); end
1743
+
1744
+ # Returns extensions.
1745
+ #
1746
+ # source://uri//lib/uri/ldap.rb#235
1747
+ def extensions; end
1748
+
1749
+ # Setter for extensions +val+.
1750
+ #
1751
+ # source://uri//lib/uri/ldap.rb#248
1752
+ def extensions=(val); end
1753
+
1754
+ # Returns filter.
1755
+ #
1756
+ # source://uri//lib/uri/ldap.rb#216
1757
+ def filter; end
1758
+
1759
+ # Setter for filter +val+.
1760
+ #
1761
+ # source://uri//lib/uri/ldap.rb#229
1762
+ def filter=(val); end
1763
+
1764
+ # Checks if URI has a path.
1765
+ # For URI::LDAP this will return +false+.
1766
+ #
1767
+ # @return [Boolean]
1768
+ #
1769
+ # source://uri//lib/uri/ldap.rb#255
1770
+ def hierarchical?; end
1771
+
1772
+ # Returns scope.
1773
+ #
1774
+ # source://uri//lib/uri/ldap.rb#197
1775
+ def scope; end
1776
+
1777
+ # Setter for scope +val+.
1778
+ #
1779
+ # source://uri//lib/uri/ldap.rb#210
1780
+ def scope=(val); end
1781
+
1782
+ protected
1783
+
1784
+ # Private setter for attributes +val+.
1785
+ #
1786
+ # source://uri//lib/uri/ldap.rb#183
1787
+ def set_attributes(val); end
1788
+
1789
+ # Private setter for dn +val+.
1790
+ #
1791
+ # source://uri//lib/uri/ldap.rb#164
1792
+ def set_dn(val); end
1793
+
1794
+ # Private setter for extensions +val+.
1795
+ #
1796
+ # source://uri//lib/uri/ldap.rb#240
1797
+ def set_extensions(val); end
1798
+
1799
+ # Private setter for filter +val+.
1800
+ #
1801
+ # source://uri//lib/uri/ldap.rb#221
1802
+ def set_filter(val); end
1803
+
1804
+ # Private setter for scope +val+.
1805
+ #
1806
+ # source://uri//lib/uri/ldap.rb#202
1807
+ def set_scope(val); end
1808
+
1809
+ private
1810
+
1811
+ # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+.
1812
+ #
1813
+ # source://uri//lib/uri/ldap.rb#146
1814
+ def build_path_query; end
1815
+
1816
+ # Private method to cleanup +dn+ from using the +path+ component attribute.
1817
+ #
1818
+ # @raise [InvalidURIError]
1819
+ #
1820
+ # source://uri//lib/uri/ldap.rb#120
1821
+ def parse_dn; end
1822
+
1823
+ # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+
1824
+ # from using the +query+ component attribute.
1825
+ #
1826
+ # source://uri//lib/uri/ldap.rb#128
1827
+ def parse_query; end
1828
+
1829
+ class << self
1830
+ # == Description
1831
+ #
1832
+ # Creates a new URI::LDAP object from components, with syntax checking.
1833
+ #
1834
+ # The components accepted are host, port, dn, attributes,
1835
+ # scope, filter, and extensions.
1836
+ #
1837
+ # The components should be provided either as an Array, or as a Hash
1838
+ # with keys formed by preceding the component names with a colon.
1839
+ #
1840
+ # If an Array is used, the components must be passed in the
1841
+ # order <code>[host, port, dn, attributes, scope, filter, extensions]</code>.
1842
+ #
1843
+ # Example:
1844
+ #
1845
+ # uri = URI::LDAP.build({:host => 'ldap.example.com',
1846
+ # :dn => '/dc=example'})
1847
+ #
1848
+ # uri = URI::LDAP.build(["ldap.example.com", nil,
1849
+ # "/dc=example;dc=com", "query", nil, nil, nil])
1850
+ #
1851
+ # source://uri//lib/uri/ldap.rb#74
1852
+ def build(args); end
1853
+ end
1854
+ end
1855
+
1856
+ # RFC6068, the mailto URL scheme.
1857
+ #
1858
+ # source://uri//lib/uri/mailto.rb#17
1859
+ class URI::MailTo < ::URI::Generic
1860
+ include ::URI::RFC2396_REGEXP
1861
+
1862
+ # == Description
1863
+ #
1864
+ # Creates a new URI::MailTo object from generic URL components with
1865
+ # no syntax checking.
1866
+ #
1867
+ # This method is usually called from URI::parse, which checks
1868
+ # the validity of each component.
1869
+ #
1870
+ # @return [MailTo] a new instance of MailTo
1871
+ #
1872
+ # source://uri//lib/uri/mailto.rb#132
1873
+ def initialize(*arg); end
1874
+
1875
+ # E-mail headers set by the URL, as an Array of Arrays.
1876
+ #
1877
+ # source://uri//lib/uri/mailto.rb#166
1878
+ def headers; end
1879
+
1880
+ # Setter for headers +v+.
1881
+ #
1882
+ # source://uri//lib/uri/mailto.rb#232
1883
+ def headers=(v); end
1884
+
1885
+ # The primary e-mail address of the URL, as a String.
1886
+ #
1887
+ # source://uri//lib/uri/mailto.rb#163
1888
+ def to; end
1889
+
1890
+ # Setter for to +v+.
1891
+ #
1892
+ # source://uri//lib/uri/mailto.rb#200
1893
+ def to=(v); end
1894
+
1895
+ # Returns the RFC822 e-mail text equivalent of the URL, as a String.
1896
+ #
1897
+ # Example:
1898
+ #
1899
+ # require 'uri'
1900
+ #
1901
+ # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr")
1902
+ # uri.to_mailtext
1903
+ # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
1904
+ #
1905
+ # source://uri//lib/uri/mailto.rb#268
1906
+ def to_mailtext; end
1907
+
1908
+ # Returns the RFC822 e-mail text equivalent of the URL, as a String.
1909
+ #
1910
+ # Example:
1911
+ #
1912
+ # require 'uri'
1913
+ #
1914
+ # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr")
1915
+ # uri.to_mailtext
1916
+ # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
1917
+ #
1918
+ # source://uri//lib/uri/mailto.rb#289
1919
+ def to_rfc822text; end
1920
+
1921
+ # Constructs String from URI.
1922
+ #
1923
+ # source://uri//lib/uri/mailto.rb#239
1924
+ def to_s; end
1925
+
1926
+ protected
1927
+
1928
+ # Private setter for headers +v+.
1929
+ #
1930
+ # source://uri//lib/uri/mailto.rb#221
1931
+ def set_headers(v); end
1932
+
1933
+ # Private setter for to +v+.
1934
+ #
1935
+ # source://uri//lib/uri/mailto.rb#194
1936
+ def set_to(v); end
1937
+
1938
+ private
1939
+
1940
+ # Checks the headers +v+ component against either
1941
+ # * HEADER_REGEXP
1942
+ #
1943
+ # source://uri//lib/uri/mailto.rb#208
1944
+ def check_headers(v); end
1945
+
1946
+ # Checks the to +v+ component.
1947
+ #
1948
+ # source://uri//lib/uri/mailto.rb#169
1949
+ def check_to(v); end
1950
+
1951
+ class << self
1952
+ # == Description
1953
+ #
1954
+ # Creates a new URI::MailTo object from components, with syntax checking.
1955
+ #
1956
+ # Components can be provided as an Array or Hash. If an Array is used,
1957
+ # the components must be supplied as <code>[to, headers]</code>.
1958
+ #
1959
+ # If a Hash is used, the keys are the component names preceded by colons.
1960
+ #
1961
+ # The headers can be supplied as a pre-encoded string, such as
1962
+ # <code>"subject=subscribe&cc=address"</code>, or as an Array of Arrays
1963
+ # like <code>[['subject', 'subscribe'], ['cc', 'address']]</code>.
1964
+ #
1965
+ # Examples:
1966
+ #
1967
+ # require 'uri'
1968
+ #
1969
+ # m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
1970
+ # m1.to_s # => "mailto:joe@example.com?subject=Ruby"
1971
+ #
1972
+ # m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
1973
+ # m2.to_s # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com"
1974
+ #
1975
+ # m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
1976
+ # m3.to_s # => "mailto:listman@example.com?subject=subscribe"
1977
+ #
1978
+ # source://uri//lib/uri/mailto.rb#85
1979
+ def build(args); end
1980
+ end
1981
+ end
1982
+
1983
+ # Class that parses String's into URI's.
1984
+ #
1985
+ # It contains a Hash set of patterns and Regexp's that match and validate.
1986
+ #
1987
+ # source://uri//lib/uri/rfc2396_parser.rb#64
1988
+ class URI::RFC2396_Parser
1989
+ include ::URI::RFC2396_REGEXP
1990
+
1991
+ # == Synopsis
1992
+ #
1993
+ # URI::Parser.new([opts])
1994
+ #
1995
+ # == Args
1996
+ #
1997
+ # The constructor accepts a hash as options for parser.
1998
+ # Keys of options are pattern names of URI components
1999
+ # and values of options are pattern strings.
2000
+ # The constructor generates set of regexps for parsing URIs.
2001
+ #
2002
+ # You can use the following keys:
2003
+ #
2004
+ # * :ESCAPED (URI::PATTERN::ESCAPED in default)
2005
+ # * :UNRESERVED (URI::PATTERN::UNRESERVED in default)
2006
+ # * :DOMLABEL (URI::PATTERN::DOMLABEL in default)
2007
+ # * :TOPLABEL (URI::PATTERN::TOPLABEL in default)
2008
+ # * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
2009
+ #
2010
+ # == Examples
2011
+ #
2012
+ # p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
2013
+ # u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD>
2014
+ # URI.parse(u.to_s) #=> raises URI::InvalidURIError
2015
+ #
2016
+ # s = "http://example.com/ABCD"
2017
+ # u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
2018
+ # u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD>
2019
+ # u1 == u2 #=> true
2020
+ # u1.eql?(u2) #=> false
2021
+ #
2022
+ # @return [RFC2396_Parser] a new instance of RFC2396_Parser
2023
+ #
2024
+ # source://uri//lib/uri/rfc2396_parser.rb#99
2025
+ def initialize(opts = T.unsafe(nil)); end
2026
+
2027
+ # :call-seq:
2028
+ # escape( str )
2029
+ # escape( str, unsafe )
2030
+ #
2031
+ # == Args
2032
+ #
2033
+ # +str+::
2034
+ # String to make safe
2035
+ # +unsafe+::
2036
+ # Regexp to apply. Defaults to +self.regexp[:UNSAFE]+
2037
+ #
2038
+ # == Description
2039
+ #
2040
+ # Constructs a safe String from +str+, removing unsafe characters,
2041
+ # replacing them with codes.
2042
+ #
2043
+ # source://uri//lib/uri/rfc2396_parser.rb#287
2044
+ def escape(str, unsafe = T.unsafe(nil)); end
2045
+
2046
+ # :call-seq:
2047
+ # extract( str )
2048
+ # extract( str, schemes )
2049
+ # extract( str, schemes ) {|item| block }
2050
+ #
2051
+ # == Args
2052
+ #
2053
+ # +str+::
2054
+ # String to search
2055
+ # +schemes+::
2056
+ # Patterns to apply to +str+
2057
+ #
2058
+ # == Description
2059
+ #
2060
+ # Attempts to parse and merge a set of URIs.
2061
+ # If no +block+ given, then returns the result,
2062
+ # else it calls +block+ for each element in result.
2063
+ #
2064
+ # See also URI::Parser.make_regexp.
2065
+ #
2066
+ # source://uri//lib/uri/rfc2396_parser.rb#249
2067
+ def extract(str, schemes = T.unsafe(nil)); end
2068
+
2069
+ # source://uri//lib/uri/rfc2396_parser.rb#326
2070
+ def inspect; end
2071
+
2072
+ # == Args
2073
+ #
2074
+ # +uris+::
2075
+ # an Array of Strings
2076
+ #
2077
+ # == Description
2078
+ #
2079
+ # Attempts to parse and merge a set of URIs.
2080
+ #
2081
+ # source://uri//lib/uri/rfc2396_parser.rb#223
2082
+ def join(*uris); end
2083
+
2084
+ # Returns Regexp that is default +self.regexp[:ABS_URI_REF]+,
2085
+ # unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+.
2086
+ #
2087
+ # source://uri//lib/uri/rfc2396_parser.rb#262
2088
+ def make_regexp(schemes = T.unsafe(nil)); end
2089
+
2090
+ # == Args
2091
+ #
2092
+ # +uri+::
2093
+ # String
2094
+ #
2095
+ # == Description
2096
+ #
2097
+ # Parses +uri+ and constructs either matching URI scheme object
2098
+ # (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic.
2099
+ #
2100
+ # == Usage
2101
+ #
2102
+ # p = URI::Parser.new
2103
+ # p.parse("ldap://ldap.example.com/dc=example?user=john")
2104
+ # #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
2105
+ #
2106
+ # source://uri//lib/uri/rfc2396_parser.rb#209
2107
+ def parse(uri); end
2108
+
2109
+ # The Hash of patterns.
2110
+ #
2111
+ # See also URI::Parser.initialize_pattern.
2112
+ #
2113
+ # source://uri//lib/uri/rfc2396_parser.rb#112
2114
+ def pattern; end
2115
+
2116
+ # The Hash of Regexp.
2117
+ #
2118
+ # See also URI::Parser.initialize_regexp.
2119
+ #
2120
+ # source://uri//lib/uri/rfc2396_parser.rb#117
2121
+ def regexp; end
2122
+
2123
+ # Returns a split URI against +regexp[:ABS_URI]+.
2124
+ #
2125
+ # source://uri//lib/uri/rfc2396_parser.rb#120
2126
+ def split(uri); end
2127
+
2128
+ # :call-seq:
2129
+ # unescape( str )
2130
+ # unescape( str, escaped )
2131
+ #
2132
+ # == Args
2133
+ #
2134
+ # +str+::
2135
+ # String to remove escapes from
2136
+ # +escaped+::
2137
+ # Regexp to apply. Defaults to +self.regexp[:ESCAPED]+
2138
+ #
2139
+ # == Description
2140
+ #
2141
+ # Removes escapes from +str+.
2142
+ #
2143
+ # source://uri//lib/uri/rfc2396_parser.rb#318
2144
+ def unescape(str, escaped = T.unsafe(nil)); end
2145
+
2146
+ private
2147
+
2148
+ # source://uri//lib/uri/rfc2396_parser.rb#527
2149
+ def convert_to_uri(uri); end
2150
+
2151
+ # Constructs the default Hash of patterns.
2152
+ #
2153
+ # source://uri//lib/uri/rfc2396_parser.rb#338
2154
+ def initialize_pattern(opts = T.unsafe(nil)); end
2155
+
2156
+ # Constructs the default Hash of Regexp's.
2157
+ #
2158
+ # source://uri//lib/uri/rfc2396_parser.rb#496
2159
+ def initialize_regexp(pattern); end
2160
+ end
2161
+
2162
+ # source://uri//lib/uri/rfc2396_parser.rb#324
2163
+ URI::RFC2396_Parser::TO_S = T.let(T.unsafe(nil), UnboundMethod)
2164
+
2165
+ # source://uri//lib/uri/rfc3986_parser.rb#3
2166
+ class URI::RFC3986_Parser
2167
+ # @return [RFC3986_Parser] a new instance of RFC3986_Parser
2168
+ #
2169
+ # source://uri//lib/uri/rfc3986_parser.rb#73
2170
+ def initialize; end
2171
+
2172
+ # Compatibility for RFC2396 parser
2173
+ #
2174
+ # source://uri//lib/uri/rfc3986_parser.rb#156
2175
+ def escape(str, unsafe = T.unsafe(nil)); end
2176
+
2177
+ # Compatibility for RFC2396 parser
2178
+ #
2179
+ # source://uri//lib/uri/rfc3986_parser.rb#144
2180
+ def extract(str, schemes = T.unsafe(nil), &block); end
2181
+
2182
+ # source://uri//lib/uri/rfc3986_parser.rb#169
2183
+ def inspect; end
2184
+
2185
+ # source://uri//lib/uri/rfc3986_parser.rb#138
2186
+ def join(*uris); end
2187
+
2188
+ # Compatibility for RFC2396 parser
2189
+ #
2190
+ # source://uri//lib/uri/rfc3986_parser.rb#150
2191
+ def make_regexp(schemes = T.unsafe(nil)); end
2192
+
2193
+ # source://uri//lib/uri/rfc3986_parser.rb#134
2194
+ def parse(uri); end
2195
+
2196
+ # Returns the value of attribute regexp.
2197
+ #
2198
+ # source://uri//lib/uri/rfc3986_parser.rb#71
2199
+ def regexp; end
2200
+
2201
+ # source://uri//lib/uri/rfc3986_parser.rb#77
2202
+ def split(uri); end
2203
+
2204
+ # Compatibility for RFC2396 parser
2205
+ #
2206
+ # source://uri//lib/uri/rfc3986_parser.rb#162
2207
+ def unescape(str, escaped = T.unsafe(nil)); end
2208
+
2209
+ private
2210
+
2211
+ # source://uri//lib/uri/rfc3986_parser.rb#194
2212
+ def convert_to_uri(uri); end
2213
+
2214
+ # source://uri//lib/uri/rfc3986_parser.rb#180
2215
+ def default_regexp; end
2216
+ end
2217
+
2218
+ # source://uri//lib/uri/rfc3986_parser.rb#33
2219
+ URI::RFC3986_Parser::FRAGMENT = T.let(T.unsafe(nil), String)
2220
+
2221
+ # URI defined in RFC3986
2222
+ #
2223
+ # source://uri//lib/uri/rfc3986_parser.rb#5
2224
+ URI::RFC3986_Parser::HOST = T.let(T.unsafe(nil), Regexp)
2225
+
2226
+ # source://uri//lib/uri/rfc3986_parser.rb#54
2227
+ URI::RFC3986_Parser::RFC3986_relative_ref = T.let(T.unsafe(nil), Regexp)
2228
+
2229
+ # source://uri//lib/uri/rfc3986_parser.rb#30
2230
+ URI::RFC3986_Parser::SCHEME = T.let(T.unsafe(nil), String)
2231
+
2232
+ # source://uri//lib/uri/rfc3986_parser.rb#31
2233
+ URI::RFC3986_Parser::SEG = T.let(T.unsafe(nil), String)
2234
+
2235
+ # source://uri//lib/uri/rfc3986_parser.rb#32
2236
+ URI::RFC3986_Parser::SEG_NC = T.let(T.unsafe(nil), String)
2237
+
2238
+ # source://uri//lib/uri/rfc3986_parser.rb#28
2239
+ URI::RFC3986_Parser::USERINFO = T.let(T.unsafe(nil), Regexp)
2240
+
2241
+ # source://uri//lib/uri/common.rb#94
2242
+ module URI::Schemes; end
2243
+
2244
+ # source://uri//lib/uri/common.rb#107
2245
+ URI::Schemes::FILE = URI::File
2246
+
2247
+ # source://uri//lib/uri/common.rb#107
2248
+ URI::Schemes::FTP = URI::FTP
2249
+
2250
+ # source://uri//lib/uri/common.rb#107
2251
+ URI::Schemes::GID = URI::GID
2252
+
2253
+ # source://uri//lib/uri/common.rb#107
2254
+ URI::Schemes::HTTP = URI::HTTP
2255
+
2256
+ # source://uri//lib/uri/common.rb#107
2257
+ URI::Schemes::HTTPS = URI::HTTPS
2258
+
2259
+ # source://uri//lib/uri/common.rb#107
2260
+ URI::Schemes::LDAP = URI::LDAP
2261
+
2262
+ # source://uri//lib/uri/common.rb#107
2263
+ URI::Schemes::LDAPS = URI::LDAPS
2264
+
2265
+ # source://uri//lib/uri/common.rb#107
2266
+ URI::Schemes::MAILTO = URI::MailTo
2267
+
2268
+ # source://uri//lib/uri/common.rb#107
2269
+ URI::Schemes::SOURCE = Tapioca::SourceURI
2270
+
2271
+ # source://uri//lib/uri/common.rb#107
2272
+ URI::Schemes::WS = URI::WS
2273
+
2274
+ # source://uri//lib/uri/common.rb#107
2275
+ URI::Schemes::WSS = URI::WSS
2276
+
2277
+ # source://uri//lib/uri/common.rb#312
2278
+ URI::TBLENCURICOMP_ = T.let(T.unsafe(nil), Hash)
2279
+
2280
+ # source://uri//lib/uri/common.rb#62
2281
+ module URI::Util
2282
+ private
2283
+
2284
+ # source://uri//lib/uri/common.rb#63
2285
+ def make_components_hash(klass, array_hash); end
2286
+
2287
+ class << self
2288
+ # source://uri//lib/uri/common.rb#91
2289
+ def make_components_hash(klass, array_hash); end
2290
+ end
2291
+ end
2292
+
2293
+ # The syntax of WS URIs is defined in RFC6455 section 3.
2294
+ #
2295
+ # Note that the Ruby URI library allows WS URLs containing usernames and
2296
+ # passwords. This is not legal as per the RFC, but used to be
2297
+ # supported in Internet Explorer 5 and 6, before the MS04-004 security
2298
+ # update. See <URL:http://support.microsoft.com/kb/834489>.
2299
+ #
2300
+ # source://uri//lib/uri/ws.rb#22
2301
+ class URI::WS < ::URI::Generic
2302
+ # == Description
2303
+ #
2304
+ # Returns the full path for a WS URI, as required by Net::HTTP::Get.
2305
+ #
2306
+ # If the URI contains a query, the full path is URI#path + '?' + URI#query.
2307
+ # Otherwise, the path is simply URI#path.
2308
+ #
2309
+ # Example:
2310
+ #
2311
+ # uri = URI::WS.build(path: '/foo/bar', query: 'test=true')
2312
+ # uri.request_uri # => "/foo/bar?test=true"
2313
+ #
2314
+ # source://uri//lib/uri/ws.rb#74
2315
+ def request_uri; end
2316
+
2317
+ class << self
2318
+ # == Description
2319
+ #
2320
+ # Creates a new URI::WS object from components, with syntax checking.
2321
+ #
2322
+ # The components accepted are userinfo, host, port, path, and query.
2323
+ #
2324
+ # The components should be provided either as an Array, or as a Hash
2325
+ # with keys formed by preceding the component names with a colon.
2326
+ #
2327
+ # If an Array is used, the components must be passed in the
2328
+ # order <code>[userinfo, host, port, path, query]</code>.
2329
+ #
2330
+ # Example:
2331
+ #
2332
+ # uri = URI::WS.build(host: 'www.example.com', path: '/foo/bar')
2333
+ #
2334
+ # uri = URI::WS.build([nil, "www.example.com", nil, "/path", "query"])
2335
+ #
2336
+ # Currently, if passed userinfo components this method generates
2337
+ # invalid WS URIs as per RFC 1738.
2338
+ #
2339
+ # source://uri//lib/uri/ws.rb#56
2340
+ def build(args); end
2341
+ end
2342
+ end
2343
+
2344
+ # The default port for WSS URIs is 443, and the scheme is 'wss:' rather
2345
+ # than 'ws:'. Other than that, WSS URIs are identical to WS URIs;
2346
+ # see URI::WS.
2347
+ #
2348
+ # source://uri//lib/uri/wss.rb#17
2349
+ class URI::WSS < ::URI::WS; end
2350
+
2351
+ # A Default port of 443 for URI::WSS
2352
+ #
2353
+ # source://uri//lib/uri/wss.rb#19
2354
+ URI::WSS::DEFAULT_PORT = T.let(T.unsafe(nil), Integer)