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