2022-05-02 20:59:59 +01:00
|
|
|
# typed: true
|
|
|
|
|
2021-04-02 06:02:30 +00:00
|
|
|
# DO NOT EDIT MANUALLY
|
|
|
|
# This is an autogenerated file for types exported from the `addressable` gem.
|
2021-09-17 19:28:50 +01:00
|
|
|
# Please instead update this file by running `bin/tapioca gem addressable`.
|
2021-04-02 06:02:30 +00:00
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Addressable is a library for processing links and URIs.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/version.rb#22
|
2021-07-05 18:07:09 +00:00
|
|
|
module Addressable; end
|
2021-04-02 06:02:30 +00:00
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#21
|
2021-04-02 06:02:30 +00:00
|
|
|
module Addressable::IDNA
|
|
|
|
class << self
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#117
|
2023-04-10 19:10:20 +00:00
|
|
|
def _deprecated_unicode_normalize_kc(value); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts from a Unicode internationalized domain name to an ASCII
|
|
|
|
# domain name as described in RFC 3490.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#67
|
2021-04-02 06:02:30 +00:00
|
|
|
def to_ascii(input); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts from an ASCII domain name to a Unicode internationalized
|
|
|
|
# domain name as described in RFC 3490.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#93
|
2021-04-02 06:02:30 +00:00
|
|
|
def to_unicode(input); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @deprecated Use {String#unicode_normalize(:nfkc)} instead
|
2023-12-10 17:57:45 +00:00
|
|
|
def unicode_normalize_kc(*args, **_arg1, &block); end
|
2021-04-02 06:02:30 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#140
|
2021-04-02 06:02:30 +00:00
|
|
|
def lookup_unicode_lowercase(codepoint); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Bias adaptation method
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#488
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_adapt(delta, numpoints, firsttime); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Boolean]
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#456
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_basic?(codepoint); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#334
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_decode(punycode); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the numeric value of a basic codepoint
|
|
|
|
# (for use in representing integers) in the range 0 to
|
|
|
|
# base - 1, or PUNYCODE_BASE if codepoint does not represent a value.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#474
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_decode_digit(codepoint); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Boolean]
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#461
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_delimiter?(codepoint); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#213
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_encode(unicode); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#466
|
2021-04-02 06:02:30 +00:00
|
|
|
def punycode_encode_digit(d); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Unicode aware downcase method.
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
# @param input [String] The input string.
|
|
|
|
# @return [String] The downcased result.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#132
|
2021-04-02 06:02:30 +00:00
|
|
|
def unicode_downcase(input); end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#183
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#40
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#172
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#185
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#189
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#192
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#190
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#191
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#194
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#196
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#188
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#187
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#186
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Input is invalid.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#207
|
2021-07-05 18:07:09 +00:00
|
|
|
class Addressable::IDNA::PunycodeBadInput < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Output would exceed the space provided.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#209
|
2021-07-05 18:07:09 +00:00
|
|
|
class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Input needs wider integers to process.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#211
|
2021-07-05 18:07:09 +00:00
|
|
|
class Addressable::IDNA::PunycodeOverflow < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#163
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#150
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#148
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#151
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#149
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#153
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#154
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#152
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#182
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#36
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#42
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/idna/pure.rb#53
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp)
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# This is an implementation of a URI template based on
|
|
|
|
# RFC 6570 (http://tools.ietf.org/html/rfc6570).
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#27
|
2021-09-10 21:21:17 +01:00
|
|
|
class Addressable::Template
|
2023-12-14 15:34:15 +00:00
|
|
|
# Creates a new <tt>Addressable::Template</tt> object.
|
|
|
|
#
|
|
|
|
# @param pattern [#to_str] The URI Template pattern.
|
|
|
|
# @return [Addressable::Template] The initialized Template object.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#234
|
2021-09-10 21:21:17 +01:00
|
|
|
def initialize(pattern); end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Returns <code>true</code> if the Template objects are equal. This method
|
|
|
|
# does NOT normalize either Template before doing the comparison.
|
|
|
|
#
|
|
|
|
# @param template [Object] The Template to compare.
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the Templates are equivalent, <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#274
|
2021-09-10 21:21:17 +01:00
|
|
|
def ==(template); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns <code>true</code> if the Template objects are equal. This method
|
|
|
|
# does NOT normalize either Template before doing the comparison.
|
|
|
|
# Addressable::Template makes no distinction between `==` and `eql?`.
|
|
|
|
#
|
|
|
|
# @param template [Object] The Template to compare.
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the Templates are equivalent, <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
# @see #==
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#274
|
2021-09-10 21:21:17 +01:00
|
|
|
def eql?(template); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Expands a URI template into a full URI.
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>validate</tt> or
|
|
|
|
# <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
|
|
|
|
# <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
|
|
|
|
# <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
|
|
|
|
# or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
|
|
|
|
# <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt>
|
|
|
|
# exception will be raised if the value is invalid. The <tt>transform</tt>
|
|
|
|
# method should return the transformed variable value as a <tt>String</tt>.
|
|
|
|
# If a <tt>transform</tt> method is used, the value will not be percent
|
|
|
|
# encoded automatically. Unicode normalization will be performed both
|
|
|
|
# before and after sending the value to the transform method.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# class ExampleProcessor
|
|
|
|
# def self.validate(name, value)
|
|
|
|
# return !!(value =~ /^[\w ]+$/) if name == "query"
|
|
|
|
# return true
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# def self.transform(name, value)
|
|
|
|
# return value.gsub(/ /, "+") if name == "query"
|
|
|
|
# return value
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/search/{query}/"
|
|
|
|
# ).expand(
|
|
|
|
# {"query" => "an example search query"},
|
|
|
|
# ExampleProcessor
|
|
|
|
# ).to_str
|
|
|
|
# #=> "http://example.com/search/an+example+search+query/"
|
|
|
|
#
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/search/{query}/"
|
|
|
|
# ).expand(
|
|
|
|
# {"query" => "an example search query"}
|
|
|
|
# ).to_str
|
|
|
|
# #=> "http://example.com/search/an%20example%20search%20query/"
|
|
|
|
#
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/search/{query}/"
|
|
|
|
# ).expand(
|
|
|
|
# {"query" => "bogus!"},
|
|
|
|
# ExampleProcessor
|
|
|
|
# ).to_str
|
|
|
|
# #=> Addressable::Template::InvalidTemplateValueError
|
|
|
|
# @param mapping [Hash] The mapping that corresponds to the pattern.
|
|
|
|
# @param processor [#validate, #transform] An optional processor object may be supplied.
|
|
|
|
# @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
|
|
|
|
# @return [Addressable::URI] The expanded URI template.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#591
|
2021-09-10 21:21:17 +01:00
|
|
|
def expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Extracts a mapping from the URI using a URI Template pattern.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# class ExampleProcessor
|
|
|
|
# def self.restore(name, value)
|
|
|
|
# return value.gsub(/\+/, " ") if name == "query"
|
|
|
|
# return value
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# def self.match(name)
|
|
|
|
# return ".*?" if name == "first"
|
|
|
|
# return ".*"
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse(
|
|
|
|
# "http://example.com/search/an+example+search+query/"
|
|
|
|
# )
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/search/{query}/"
|
|
|
|
# ).extract(uri, ExampleProcessor)
|
|
|
|
# #=> {"query" => "an example search query"}
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse("http://example.com/a/b/c/")
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/{first}/{second}/"
|
|
|
|
# ).extract(uri, ExampleProcessor)
|
|
|
|
# #=> {"first" => "a", "second" => "b/c"}
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse("http://example.com/a/b/c/")
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/{first}/{-list|/|second}/"
|
|
|
|
# ).extract(uri)
|
|
|
|
# #=> {"first" => "a", "second" => ["b", "c"]}
|
|
|
|
# @param uri [Addressable::URI, #to_str] The URI to extract from.
|
|
|
|
# @param processor [#restore, #match] A template processor object may optionally be supplied.
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>restore</tt> or
|
|
|
|
# <tt>match</tt> messages or both. The <tt>restore</tt> method should
|
|
|
|
# take two parameters: `[String] name` and `[String] value`.
|
|
|
|
# The <tt>restore</tt> method should reverse any transformations that
|
|
|
|
# have been performed on the value to ensure a valid URI.
|
|
|
|
# The <tt>match</tt> method should take a single
|
|
|
|
# parameter: `[String] name`. The <tt>match</tt> method should return
|
|
|
|
# a <tt>String</tt> containing a regular expression capture group for
|
|
|
|
# matching on that particular variable. The default value is `".*?"`.
|
|
|
|
# The <tt>match</tt> method has no effect on multivariate operator
|
|
|
|
# expansions.
|
|
|
|
# @return [Hash, NilClass] The <tt>Hash</tt> mapping that was extracted from the URI, or
|
|
|
|
# <tt>nil</tt> if the URI didn't match the template.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#342
|
2021-09-10 21:21:17 +01:00
|
|
|
def extract(uri, processor = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Freeze URI, initializing instance variables.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] The frozen URI object.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#245
|
2021-09-10 21:21:17 +01:00
|
|
|
def freeze; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a <tt>String</tt> representation of the Template object's state.
|
|
|
|
#
|
|
|
|
# @return [String] The Template object's state, as a <tt>String</tt>.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#260
|
2021-09-10 21:21:17 +01:00
|
|
|
def inspect; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns an Array of variables used within the template pattern.
|
|
|
|
# The variables are listed in the Array in the order they appear within
|
|
|
|
# the pattern. Multiple occurrences of a variable within a pattern are
|
|
|
|
# not represented in this Array.
|
|
|
|
#
|
|
|
|
# @return [Array] The variables present in the template's pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#607
|
2021-09-10 21:21:17 +01:00
|
|
|
def keys; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Extracts match data from the URI using a URI Template pattern.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# class ExampleProcessor
|
|
|
|
# def self.restore(name, value)
|
|
|
|
# return value.gsub(/\+/, " ") if name == "query"
|
|
|
|
# return value
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# def self.match(name)
|
|
|
|
# return ".*?" if name == "first"
|
|
|
|
# return ".*"
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse(
|
|
|
|
# "http://example.com/search/an+example+search+query/"
|
|
|
|
# )
|
|
|
|
# match = Addressable::Template.new(
|
|
|
|
# "http://example.com/search/{query}/"
|
|
|
|
# ).match(uri, ExampleProcessor)
|
|
|
|
# match.variables
|
|
|
|
# #=> ["query"]
|
|
|
|
# match.captures
|
|
|
|
# #=> ["an example search query"]
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse("http://example.com/a/b/c/")
|
|
|
|
# match = Addressable::Template.new(
|
|
|
|
# "http://example.com/{first}/{+second}/"
|
|
|
|
# ).match(uri, ExampleProcessor)
|
|
|
|
# match.variables
|
|
|
|
# #=> ["first", "second"]
|
|
|
|
# match.captures
|
|
|
|
# #=> ["a", "b/c"]
|
|
|
|
#
|
|
|
|
# uri = Addressable::URI.parse("http://example.com/a/b/c/")
|
|
|
|
# match = Addressable::Template.new(
|
|
|
|
# "http://example.com/{first}{/second*}/"
|
|
|
|
# ).match(uri)
|
|
|
|
# match.variables
|
|
|
|
# #=> ["first", "second"]
|
|
|
|
# match.captures
|
|
|
|
# #=> ["a", ["b", "c"]]
|
|
|
|
# @param uri [Addressable::URI, #to_str] The URI to extract from.
|
|
|
|
# @param processor [#restore, #match] A template processor object may optionally be supplied.
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>restore</tt> or
|
|
|
|
# <tt>match</tt> messages or both. The <tt>restore</tt> method should
|
|
|
|
# take two parameters: `[String] name` and `[String] value`.
|
|
|
|
# The <tt>restore</tt> method should reverse any transformations that
|
|
|
|
# have been performed on the value to ensure a valid URI.
|
|
|
|
# The <tt>match</tt> method should take a single
|
|
|
|
# parameter: `[String] name`. The <tt>match</tt> method should return
|
|
|
|
# a <tt>String</tt> containing a regular expression capture group for
|
|
|
|
# matching on that particular variable. The default value is `".*?"`.
|
|
|
|
# The <tt>match</tt> method has no effect on multivariate operator
|
|
|
|
# expansions.
|
|
|
|
# @return [Hash, NilClass] The <tt>Hash</tt> mapping that was extracted from the URI, or
|
|
|
|
# <tt>nil</tt> if the URI didn't match the template.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#413
|
2021-09-10 21:21:17 +01:00
|
|
|
def match(uri, processor = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the named captures of the coerced `Regexp`.
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
# @return [Hash] The named captures of the `Regexp` given by {#to_regexp}.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#651
|
2021-09-10 21:21:17 +01:00
|
|
|
def named_captures; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns an Array of variables used within the template pattern.
|
|
|
|
# The variables are listed in the Array in the order they appear within
|
|
|
|
# the pattern. Multiple occurrences of a variable within a pattern are
|
|
|
|
# not represented in this Array.
|
|
|
|
#
|
|
|
|
# @return [Array] The variables present in the template's pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#607
|
2021-09-10 21:21:17 +01:00
|
|
|
def names; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Expands a URI template into another URI template.
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>validate</tt> or
|
|
|
|
# <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
|
|
|
|
# <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
|
|
|
|
# <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
|
|
|
|
# or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
|
|
|
|
# <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt>
|
|
|
|
# exception will be raised if the value is invalid. The <tt>transform</tt>
|
|
|
|
# method should return the transformed variable value as a <tt>String</tt>.
|
|
|
|
# If a <tt>transform</tt> method is used, the value will not be percent
|
|
|
|
# encoded automatically. Unicode normalization will be performed both
|
|
|
|
# before and after sending the value to the transform method.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/{one}/{two}/"
|
|
|
|
# ).partial_expand({"one" => "1"}).pattern
|
|
|
|
# #=> "http://example.com/1/{two}/"
|
|
|
|
#
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/{?one,two}/"
|
|
|
|
# ).partial_expand({"one" => "1"}).pattern
|
|
|
|
# #=> "http://example.com/?one=1{&two}/"
|
|
|
|
#
|
|
|
|
# Addressable::Template.new(
|
|
|
|
# "http://example.com/{?one,two,three}/"
|
|
|
|
# ).partial_expand({"one" => "1", "three" => 3}).pattern
|
|
|
|
# #=> "http://example.com/?one=1{&two}&three=3"
|
|
|
|
# @param mapping [Hash] The mapping that corresponds to the pattern.
|
|
|
|
# @param processor [#validate, #transform] An optional processor object may be supplied.
|
|
|
|
# @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
|
|
|
|
# @return [Addressable::Template] The partially expanded URI template.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#524
|
2021-09-10 21:21:17 +01:00
|
|
|
def partial_expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [String] The Template object's pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#254
|
2021-09-10 21:21:17 +01:00
|
|
|
def pattern; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the source of the coerced `Regexp`.
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
# @return [String] The source of the `Regexp` given by {#to_regexp}.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#641
|
2021-09-10 21:21:17 +01:00
|
|
|
def source; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Coerces a template into a `Regexp` object. This regular expression will
|
|
|
|
# behave very similarly to the actual template, and should match the same
|
|
|
|
# URI values, but it cannot fully handle, for example, values that would
|
|
|
|
# extract to an `Array`.
|
|
|
|
#
|
|
|
|
# @return [Regexp] A regular expression which should match the template.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#630
|
2021-09-10 21:21:17 +01:00
|
|
|
def to_regexp; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a mapping of variables to their default values specified
|
|
|
|
# in the template. Variables without defaults are not returned.
|
|
|
|
#
|
|
|
|
# @return [Hash] Mapping of template variables to their defaults
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#618
|
2021-09-10 21:21:17 +01:00
|
|
|
def variable_defaults; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns an Array of variables used within the template pattern.
|
|
|
|
# The variables are listed in the Array in the order they appear within
|
|
|
|
# the pattern. Multiple occurrences of a variable within a pattern are
|
|
|
|
# not represented in this Array.
|
|
|
|
#
|
|
|
|
# @return [Array] The variables present in the template's pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#607
|
2021-09-10 21:21:17 +01:00
|
|
|
def variables; end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Takes a set of values, and joins them together based on the
|
|
|
|
# operator.
|
|
|
|
#
|
|
|
|
# @param operator [String, Nil] One of the operators from the set
|
|
|
|
# (?,&,+,#,;,/,.), or nil if there wasn't one.
|
|
|
|
# @param return_value [Array] The set of return values (as [variable_name, value] tuples) that will
|
|
|
|
# be joined together.
|
|
|
|
# @return [String] The transformed mapped value
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#861
|
2021-09-10 21:21:17 +01:00
|
|
|
def join_values(operator, return_value); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Generates a hash with string keys
|
|
|
|
#
|
|
|
|
# @param mapping [Hash] A mapping hash to normalize
|
|
|
|
# @return [Hash] A hash with stringified keys
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#924
|
2021-09-10 21:21:17 +01:00
|
|
|
def normalize_keys(mapping); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Takes a set of values, and joins them together based on the
|
|
|
|
# operator.
|
|
|
|
#
|
|
|
|
# @param value [Hash, Array, String] Normalizes unicode keys and values with String#unicode_normalize (NFC)
|
|
|
|
# @return [Hash, Array, String] The normalized values
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#898
|
2021-09-10 21:21:17 +01:00
|
|
|
def normalize_value(value); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#656
|
2021-09-10 21:21:17 +01:00
|
|
|
def ordered_variable_defaults; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Generates the <tt>Regexp</tt> that parses a template pattern.
|
|
|
|
#
|
|
|
|
# @param pattern [String] The URI template pattern.
|
|
|
|
# @param processor [#match] The template processor to use.
|
|
|
|
# @return [Array, Regexp] An array of expansion variables nad a regular expression which may be
|
|
|
|
# used to parse a template pattern
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#968
|
2021-09-10 21:21:17 +01:00
|
|
|
def parse_new_template_pattern(pattern, processor = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Generates the <tt>Regexp</tt> that parses a template pattern. Memoizes the
|
|
|
|
# value if template processor not set (processors may not be deterministic)
|
|
|
|
#
|
|
|
|
# @param pattern [String] The URI template pattern.
|
|
|
|
# @param processor [#match] The template processor to use.
|
|
|
|
# @return [Array, Regexp] An array of expansion variables nad a regular expression which may be
|
|
|
|
# used to parse a template pattern
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#950
|
2021-09-10 21:21:17 +01:00
|
|
|
def parse_template_pattern(pattern, processor = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Transforms a mapped value so that values can be substituted into the
|
|
|
|
# template.
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>validate</tt> or
|
|
|
|
# <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
|
|
|
|
# <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
|
|
|
|
# <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
|
|
|
|
# or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
|
|
|
|
# <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt> exception
|
|
|
|
# will be raised if the value is invalid. The <tt>transform</tt> method
|
|
|
|
# should return the transformed variable value as a <tt>String</tt>. If a
|
|
|
|
# <tt>transform</tt> method is used, the value will not be percent encoded
|
|
|
|
# automatically. Unicode normalization will be performed both before and
|
|
|
|
# after sending the value to the transform method.
|
|
|
|
#
|
|
|
|
# @param mapping [Hash] The mapping to replace captures
|
|
|
|
# @param capture [String] The expression to replace
|
|
|
|
# @param processor [#validate, #transform] An optional processor object may be supplied.
|
|
|
|
# @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
|
|
|
|
# @return [String] The expanded expression
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#753
|
2021-09-10 21:21:17 +01:00
|
|
|
def transform_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Loops through each capture and expands any values available in mapping
|
|
|
|
#
|
|
|
|
# The object should respond to either the <tt>validate</tt> or
|
|
|
|
# <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
|
|
|
|
# <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
|
|
|
|
# <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
|
|
|
|
# or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
|
|
|
|
# <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt> exception
|
|
|
|
# will be raised if the value is invalid. The <tt>transform</tt> method
|
|
|
|
# should return the transformed variable value as a <tt>String</tt>. If a
|
|
|
|
# <tt>transform</tt> method is used, the value will not be percent encoded
|
|
|
|
# automatically. Unicode normalization will be performed both before and
|
|
|
|
# after sending the value to the transform method.
|
|
|
|
#
|
|
|
|
# @param mapping [Hash] Set of keys to expand
|
|
|
|
# @param capture [String] The expression to expand
|
|
|
|
# @param processor [#validate, #transform] An optional processor object may be supplied.
|
|
|
|
# @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
|
|
|
|
# @return [String] The expanded expression
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#694
|
2021-09-10 21:21:17 +01:00
|
|
|
def transform_partial_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
|
|
|
|
end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/template.rb#58
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::EXPRESSION = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Raised if an invalid template operator is used in a pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#85
|
2021-09-10 21:21:17 +01:00
|
|
|
class Addressable::Template::InvalidTemplateOperatorError < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Raised if an invalid template value is supplied.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#80
|
2021-09-10 21:21:17 +01:00
|
|
|
class Addressable::Template::InvalidTemplateValueError < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#70
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::JOINERS = T.let(T.unsafe(nil), Hash)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#62
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::LEADERS = T.let(T.unsafe(nil), Hash)
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# This class represents the data that is extracted when a Template
|
|
|
|
# is matched against a URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#96
|
2021-09-10 21:21:17 +01:00
|
|
|
class Addressable::Template::MatchData
|
2023-12-14 15:34:15 +00:00
|
|
|
# Creates a new MatchData object.
|
|
|
|
# MatchData objects should never be instantiated directly.
|
|
|
|
#
|
|
|
|
# @param uri [Addressable::URI] The URI that the template was matched against.
|
|
|
|
# @return [MatchData] a new instance of MatchData
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#103
|
2021-09-10 21:21:17 +01:00
|
|
|
def initialize(uri, template, mapping); end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Accesses captured values by name or by index.
|
|
|
|
#
|
|
|
|
# @param key [String, Symbol, Fixnum] Capture index or name. Note that when accessing by with index
|
|
|
|
# of 0, the full URI will be returned. The intention is to mimic
|
|
|
|
# the ::MatchData#[] behavior.
|
|
|
|
# @param len [#to_int, nil] If provided, an array of values will be returend with the given
|
|
|
|
# parameter used as length.
|
|
|
|
# @return [Array, String, nil] The captured value corresponding to the index or name. If the
|
|
|
|
# value was not provided or the key is unknown, nil will be
|
|
|
|
# returned.
|
|
|
|
#
|
|
|
|
# If the second parameter is provided, an array of that length will
|
|
|
|
# be returned instead.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#170
|
2021-09-10 21:21:17 +01:00
|
|
|
def [](key, len = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] The list of values that were captured by the Template.
|
|
|
|
# Note that this list will include nils for any variables which
|
|
|
|
# were in the Template, but did not appear in the URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#143
|
2021-09-10 21:21:17 +01:00
|
|
|
def captures; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a <tt>String</tt> representation of the MatchData's state.
|
|
|
|
#
|
|
|
|
# @return [String] The MatchData's state, as a <tt>String</tt>.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#213
|
2021-09-10 21:21:17 +01:00
|
|
|
def inspect; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] The list of variables that were present in the Template.
|
|
|
|
# Note that this list will include variables which do not appear
|
|
|
|
# in the mapping because they were not present in URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#132
|
2021-09-10 21:21:17 +01:00
|
|
|
def keys; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Hash] The mapping that resulted from the match.
|
|
|
|
# Note that this mapping does not include keys or values for
|
|
|
|
# variables that appear in the Template, but are not present
|
|
|
|
# in the URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#125
|
2021-09-10 21:21:17 +01:00
|
|
|
def mapping; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] The list of variables that were present in the Template.
|
|
|
|
# Note that this list will include variables which do not appear
|
|
|
|
# in the mapping because they were not present in URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#132
|
2021-09-10 21:21:17 +01:00
|
|
|
def names; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Dummy method for code expecting a ::MatchData instance
|
|
|
|
#
|
|
|
|
# @return [String] An empty string.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#222
|
2021-09-10 21:21:17 +01:00
|
|
|
def post_match; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Dummy method for code expecting a ::MatchData instance
|
|
|
|
#
|
|
|
|
# @return [String] An empty string.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#222
|
2021-09-10 21:21:17 +01:00
|
|
|
def pre_match; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [String] The matched URI as String.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#191
|
2021-09-10 21:21:17 +01:00
|
|
|
def string; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Addressable::Template] The Template used for the match.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#117
|
2021-09-10 21:21:17 +01:00
|
|
|
def template; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] Array with the matched URI as first element followed by the captured
|
|
|
|
# values.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#184
|
2021-09-10 21:21:17 +01:00
|
|
|
def to_a; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [String] The matched URI as String.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#191
|
2021-09-10 21:21:17 +01:00
|
|
|
def to_s; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Addressable::URI] The URI that the Template was matched against.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#112
|
2021-09-10 21:21:17 +01:00
|
|
|
def uri; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] The list of values that were captured by the Template.
|
|
|
|
# Note that this list will include nils for any variables which
|
|
|
|
# were in the Template, but did not appear in the URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#143
|
2021-09-10 21:21:17 +01:00
|
|
|
def values; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns multiple captured values at once.
|
|
|
|
#
|
|
|
|
# @param *indexes [String, Symbol, Fixnum] Indices of the captures to be returned
|
|
|
|
# @return [Array] Values corresponding to given indices.
|
|
|
|
# @see Addressable::Template::MatchData#[]
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#205
|
2021-09-10 21:21:17 +01:00
|
|
|
def values_at(*indexes); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# @return [Array] The list of variables that were present in the Template.
|
|
|
|
# Note that this list will include variables which do not appear
|
|
|
|
# in the mapping because they were not present in URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#132
|
2021-09-10 21:21:17 +01:00
|
|
|
def variables; end
|
|
|
|
end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# source://addressable//lib/addressable/template.rb#40
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::RESERVED = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Raised if an invalid template operator is used in a pattern.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/template.rb#90
|
2021-09-10 21:21:17 +01:00
|
|
|
class Addressable::Template::TemplateOperatorAbortedError < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#42
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::UNRESERVED = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#54
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::VARIABLE_LIST = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#50
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::VARNAME = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/template.rb#52
|
2021-09-10 21:21:17 +01:00
|
|
|
Addressable::Template::VARSPEC = T.let(T.unsafe(nil), Regexp)
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# This is an implementation of a URI parser based on
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>,
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3987.txt">RFC 3987</a>.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#31
|
2021-04-02 06:02:30 +00:00
|
|
|
class Addressable::URI
|
2023-12-14 15:34:15 +00:00
|
|
|
# Creates a new uri object from component parts.
|
|
|
|
#
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @option [String,
|
|
|
|
# @param [String, [Hash] a customizable set of options
|
|
|
|
# @return [Addressable::URI] The constructed URI object.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#830
|
2021-04-02 06:02:30 +00:00
|
|
|
def initialize(options = T.unsafe(nil)); end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Joins two URIs together.
|
|
|
|
#
|
|
|
|
# @param The [String, Addressable::URI, #to_str] URI to join with.
|
|
|
|
# @return [Addressable::URI] The joined URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1889
|
2021-04-02 06:02:30 +00:00
|
|
|
def +(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns <code>true</code> if the URI objects are equal. This method
|
|
|
|
# normalizes both URIs before doing the comparison.
|
|
|
|
#
|
|
|
|
# @param uri [Object] The URI to compare.
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2239
|
2021-04-02 06:02:30 +00:00
|
|
|
def ==(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns <code>true</code> if the URI objects are equal. This method
|
|
|
|
# normalizes both URIs before doing the comparison, and allows comparison
|
|
|
|
# against <code>Strings</code>.
|
|
|
|
#
|
|
|
|
# @param uri [Object] The URI to compare.
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2217
|
2021-04-02 06:02:30 +00:00
|
|
|
def ===(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Determines if the URI is absolute.
|
|
|
|
#
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the URI is absolute. <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1879
|
2021-04-02 06:02:30 +00:00
|
|
|
def absolute?; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The authority component for this URI.
|
|
|
|
# Combines the user, password, host, and port components.
|
|
|
|
#
|
|
|
|
# @return [String] The authority component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1234
|
2021-04-02 06:02:30 +00:00
|
|
|
def authority; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the authority component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_authority [String, #to_str] The new authority component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1274
|
2021-04-02 06:02:30 +00:00
|
|
|
def authority=(new_authority); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The basename, if any, of the file in the path component.
|
|
|
|
#
|
|
|
|
# @return [String] The path's basename.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1588
|
2021-04-02 06:02:30 +00:00
|
|
|
def basename; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The default port for this URI's scheme.
|
|
|
|
# This method will always returns the default port for the URI's scheme
|
|
|
|
# regardless of the presence of an explicit port in the URI.
|
|
|
|
#
|
|
|
|
# @return [Integer] The default port.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1454
|
2021-04-02 06:02:30 +00:00
|
|
|
def default_port; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# This method allows you to make several changes to a URI simultaneously,
|
|
|
|
# which separately would cause validation errors, but in conjunction,
|
|
|
|
# are valid. The URI will be revalidated as soon as the entire block has
|
|
|
|
# been executed.
|
|
|
|
#
|
|
|
|
# @param block [Proc] A set of operations to perform on a given URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2396
|
2021-04-02 06:02:30 +00:00
|
|
|
def defer_validation; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Creates a URI suitable for display to users. If semantic attacks are
|
|
|
|
# likely, the application should try to detect these and warn the user.
|
|
|
|
# See <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>,
|
|
|
|
# section 7.6 for more information.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] A URI suitable for display purposes.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2201
|
2021-04-02 06:02:30 +00:00
|
|
|
def display_uri; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the public suffix domain for this host.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk"
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1225
|
2021-04-02 06:02:30 +00:00
|
|
|
def domain; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Clones the URI object.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] The cloned URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2271
|
2021-04-02 06:02:30 +00:00
|
|
|
def dup; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Determines if the URI is an empty string.
|
|
|
|
#
|
|
|
|
# @return [TrueClass, FalseClass] Returns <code>true</code> if empty, <code>false</code> otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2333
|
2021-04-02 06:02:30 +00:00
|
|
|
def empty?; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2406
|
2023-08-03 18:17:42 +00:00
|
|
|
def encode_with(coder); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns <code>true</code> if the URI objects are equal. This method
|
|
|
|
# does NOT normalize either URI before doing the comparison.
|
|
|
|
#
|
|
|
|
# @param uri [Object] The URI to compare.
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2253
|
2021-04-02 06:02:30 +00:00
|
|
|
def eql?(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The extname, if any, of the file in the path component.
|
|
|
|
# Empty string if there is no extension.
|
|
|
|
#
|
|
|
|
# @return [String] The path's extname.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1598
|
2021-04-02 06:02:30 +00:00
|
|
|
def extname; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The fragment component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The fragment component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1810
|
2021-04-02 06:02:30 +00:00
|
|
|
def fragment; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the fragment component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_fragment [String, #to_str] The new fragment component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1835
|
2021-04-02 06:02:30 +00:00
|
|
|
def fragment=(new_fragment); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Freeze URI, initializing instance variables.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] The frozen URI object.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#870
|
2021-04-02 06:02:30 +00:00
|
|
|
def freeze; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# A hash value that will make a URI equivalent to its normalized
|
|
|
|
# form.
|
|
|
|
#
|
|
|
|
# @return [Integer] A hash of the URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2263
|
2021-04-02 06:02:30 +00:00
|
|
|
def hash; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The host component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The host component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1120
|
2021-04-02 06:02:30 +00:00
|
|
|
def host; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the host component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_host [String, #to_str] The new host component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1156
|
2021-04-02 06:02:30 +00:00
|
|
|
def host=(new_host); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# This method is same as URI::Generic#host except
|
|
|
|
# brackets for IPv6 (and 'IPvFuture') addresses are removed.
|
|
|
|
#
|
|
|
|
# @return [String] The hostname for this URI.
|
|
|
|
# @see Addressable::URI#host
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1178
|
2021-04-02 06:02:30 +00:00
|
|
|
def hostname; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# This method is same as URI::Generic#host= except
|
|
|
|
# the argument can be a bare IPv6 address (or 'IPvFuture').
|
|
|
|
#
|
|
|
|
# @param new_hostname [String, #to_str] The new hostname for this URI.
|
|
|
|
# @see Addressable::URI#host=
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1190
|
2021-04-02 06:02:30 +00:00
|
|
|
def hostname=(new_hostname); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The inferred port component for this URI.
|
|
|
|
# This method will normalize to the default port for the URI's scheme if
|
|
|
|
# the port isn't explicitly specified in the URI.
|
|
|
|
#
|
|
|
|
# @return [Integer] The inferred port component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1440
|
2021-04-02 06:02:30 +00:00
|
|
|
def inferred_port; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2417
|
2023-08-03 18:17:42 +00:00
|
|
|
def init_with(coder); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a <code>String</code> representation of the URI object's state.
|
|
|
|
#
|
|
|
|
# @return [String] The URI object's state, as a <code>String</code>.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2384
|
2021-04-02 06:02:30 +00:00
|
|
|
def inspect; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Determines if the scheme indicates an IP-based protocol.
|
|
|
|
#
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the scheme indicates an IP-based protocol.
|
|
|
|
# <code>false</code> otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1855
|
2021-04-02 06:02:30 +00:00
|
|
|
def ip_based?; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Joins two URIs together.
|
|
|
|
#
|
|
|
|
# @param The [String, Addressable::URI, #to_str] URI to join with.
|
|
|
|
# @return [Addressable::URI] The joined URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1889
|
2021-04-02 06:02:30 +00:00
|
|
|
def join(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Destructive form of <code>join</code>.
|
|
|
|
#
|
|
|
|
# @param The [String, Addressable::URI, #to_str] URI to join with.
|
|
|
|
# @return [Addressable::URI] The joined URI.
|
|
|
|
# @see Addressable::URI#join
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1992
|
2021-04-02 06:02:30 +00:00
|
|
|
def join!(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Merges a URI with a <code>Hash</code> of components.
|
|
|
|
# This method has different behavior from <code>join</code>. Any
|
|
|
|
# components present in the <code>hash</code> parameter will override the
|
|
|
|
# original components. The path component is not treated specially.
|
|
|
|
#
|
|
|
|
# @param The [Hash, Addressable::URI, #to_hash] components to merge with.
|
|
|
|
# @return [Addressable::URI] The merged URI.
|
|
|
|
# @see Hash#merge
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2007
|
2021-04-02 06:02:30 +00:00
|
|
|
def merge(hash); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Destructive form of <code>merge</code>.
|
|
|
|
#
|
|
|
|
# @param The [Hash, Addressable::URI, #to_hash] components to merge with.
|
|
|
|
# @return [Addressable::URI] The merged URI.
|
|
|
|
# @see Addressable::URI#merge
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2072
|
2021-04-02 06:02:30 +00:00
|
|
|
def merge!(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a normalized URI object.
|
|
|
|
#
|
|
|
|
# NOTE: This method does not attempt to fully conform to specifications.
|
|
|
|
# It exists largely to correct other people's failures to read the
|
|
|
|
# specifications, and also to deal with caching issues since several
|
|
|
|
# different URIs may represent the same resource and should not be
|
|
|
|
# cached multiple times.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] The normalized URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2164
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalize; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Destructively normalizes this URI object.
|
|
|
|
#
|
|
|
|
# @return [Addressable::URI] The normalized URI.
|
|
|
|
# @see Addressable::URI#normalize
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2190
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalize!; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The authority component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The authority component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1252
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_authority; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The fragment component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The fragment component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1816
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_fragment; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The host component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The host component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1126
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_host; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The password component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The password component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1002
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_password; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The path component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The path component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1535
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_path; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The port component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [Integer] The port component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1392
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_port; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The query component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The query component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1613
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_query(*flags); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The scheme component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The scheme component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#896
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_scheme; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The normalized combination of components that represent a site.
|
|
|
|
# Combines the scheme, user, password, host, and port components.
|
|
|
|
# Primarily useful for HTTP and HTTPS.
|
|
|
|
#
|
|
|
|
# For example, <code>"http://example.com/path?query"</code> would have a
|
|
|
|
# <code>site</code> value of <code>"http://example.com"</code>.
|
|
|
|
#
|
|
|
|
# @return [String] The normalized components that identify a site.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1485
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_site; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The user component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The user component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#947
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_user; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The userinfo component for this URI, normalized.
|
|
|
|
#
|
|
|
|
# @return [String] The userinfo component, normalized.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1068
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_userinfo; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Omits components from a URI.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# uri = Addressable::URI.parse("http://example.com/path?query")
|
|
|
|
# #=> #<Addressable::URI:0xcc5e7a URI:http://example.com/path?query>
|
|
|
|
# uri.omit(:scheme, :authority)
|
|
|
|
# #=> #<Addressable::URI:0xcc4d86 URI:/path?query>
|
|
|
|
# @param *components [Symbol] The components to be omitted.
|
|
|
|
# @return [Addressable::URI] The URI with components omitted.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2297
|
2021-04-02 06:02:30 +00:00
|
|
|
def omit(*components); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Destructive form of omit.
|
|
|
|
#
|
|
|
|
# @param *components [Symbol] The components to be omitted.
|
|
|
|
# @return [Addressable::URI] The URI with components omitted.
|
|
|
|
# @see Addressable::URI#omit
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2324
|
2021-04-02 06:02:30 +00:00
|
|
|
def omit!(*components); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The origin for this URI, serialized to ASCII, as per
|
|
|
|
# RFC 6454, section 6.2.
|
|
|
|
#
|
|
|
|
# @return [String] The serialized origin.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1314
|
2021-04-02 06:02:30 +00:00
|
|
|
def origin; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the origin for this URI, serialized to ASCII, as per
|
|
|
|
# RFC 6454, section 6.2. This assignment will reset the `userinfo`
|
|
|
|
# component.
|
|
|
|
#
|
|
|
|
# @param new_origin [String, #to_str] The new origin component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1333
|
2021-04-02 06:02:30 +00:00
|
|
|
def origin=(new_origin); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The password component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The password component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#996
|
2021-04-02 06:02:30 +00:00
|
|
|
def password; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the password component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_password [String, #to_str] The new password component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1025
|
2021-04-02 06:02:30 +00:00
|
|
|
def password=(new_password); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The path component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The path component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1528
|
2021-04-02 06:02:30 +00:00
|
|
|
def path; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the path component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_path [String, #to_str] The new path component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1567
|
2021-04-02 06:02:30 +00:00
|
|
|
def path=(new_path); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The port component for this URI.
|
|
|
|
# This is the port number actually given in the URI. This does not
|
|
|
|
# infer port numbers from default values.
|
|
|
|
#
|
|
|
|
# @return [Integer] The port component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1386
|
2021-04-02 06:02:30 +00:00
|
|
|
def port; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the port component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_port [String, Integer, #to_s] The new port component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1408
|
2021-04-02 06:02:30 +00:00
|
|
|
def port=(new_port); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The query component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The query component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1607
|
2021-04-02 06:02:30 +00:00
|
|
|
def query; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the query component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_query [String, #to_str] The new query component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1641
|
2021-04-02 06:02:30 +00:00
|
|
|
def query=(new_query); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts the query component to a Hash value.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.parse("?one=1&two=2&three=3").query_values
|
|
|
|
# #=> {"one" => "1", "two" => "2", "three" => "3"}
|
|
|
|
# Addressable::URI.parse("?one=two&one=three").query_values(Array)
|
|
|
|
# #=> [["one", "two"], ["one", "three"]]
|
|
|
|
# Addressable::URI.parse("?one=two&one=three").query_values(Hash)
|
|
|
|
# #=> {"one" => "three"}
|
|
|
|
# Addressable::URI.parse("?").query_values
|
|
|
|
# #=> {}
|
|
|
|
# Addressable::URI.parse("").query_values
|
|
|
|
# #=> nil
|
|
|
|
# @param return_type [Class] The return type desired. Value must be either
|
|
|
|
# `Hash` or `Array`.
|
|
|
|
# @return [Hash, Array, nil] The query string parsed as a Hash or Array
|
|
|
|
# or nil if the query string is blank.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1672
|
2021-04-02 06:02:30 +00:00
|
|
|
def query_values(return_type = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the query component for this URI from a Hash object.
|
|
|
|
# An empty Hash or Array will result in an empty query string.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# uri.query_values = {:a => "a", :b => ["c", "d", "e"]}
|
|
|
|
# uri.query
|
|
|
|
# # => "a=a&b=c&b=d&b=e"
|
|
|
|
# uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']]
|
|
|
|
# uri.query
|
|
|
|
# # => "a=a&b=c&b=d&b=e"
|
|
|
|
# uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]]
|
|
|
|
# uri.query
|
|
|
|
# # => "a=a&b=c&b=d&b=e"
|
|
|
|
# uri.query_values = [['flag'], ['key', 'value']]
|
|
|
|
# uri.query
|
|
|
|
# # => "flag&key=value"
|
|
|
|
# @param new_query_values [Hash, #to_hash, Array] The new query values.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1723
|
2021-04-02 06:02:30 +00:00
|
|
|
def query_values=(new_query_values); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Determines if the URI is relative.
|
|
|
|
#
|
|
|
|
# @return [TrueClass, FalseClass] <code>true</code> if the URI is relative. <code>false</code>
|
|
|
|
# otherwise.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1869
|
2021-04-02 06:02:30 +00:00
|
|
|
def relative?; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The HTTP request URI for this URI. This is the path and the
|
|
|
|
# query string.
|
|
|
|
#
|
|
|
|
# @return [String] The request URI required for an HTTP request.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1774
|
2021-04-02 06:02:30 +00:00
|
|
|
def request_uri; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the HTTP request URI for this URI.
|
|
|
|
#
|
|
|
|
# @param new_request_uri [String, #to_str] The new HTTP request URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1786
|
2021-04-02 06:02:30 +00:00
|
|
|
def request_uri=(new_request_uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the shortest normalized relative form of this URI that uses the
|
|
|
|
# supplied URI as a base for resolution. Returns an absolute URI if
|
|
|
|
# necessary. This is effectively the opposite of <code>route_to</code>.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI to route from.
|
|
|
|
# @return [Addressable::URI] The normalized relative URI that is equivalent to the original URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2085
|
2021-04-02 06:02:30 +00:00
|
|
|
def route_from(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the shortest normalized relative form of the supplied URI that
|
|
|
|
# uses this URI as a base for resolution. Returns an absolute URI if
|
|
|
|
# necessary. This is effectively the opposite of <code>route_from</code>.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI to route to.
|
|
|
|
# @return [Addressable::URI] The normalized relative URI that is equivalent to the supplied URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2150
|
2021-04-02 06:02:30 +00:00
|
|
|
def route_to(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The scheme component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The scheme component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#890
|
2021-04-02 06:02:30 +00:00
|
|
|
def scheme; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the scheme component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_scheme [String, #to_str] The new scheme component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#917
|
2021-04-02 06:02:30 +00:00
|
|
|
def scheme=(new_scheme); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The combination of components that represent a site.
|
|
|
|
# Combines the scheme, user, password, host, and port components.
|
|
|
|
# Primarily useful for HTTP and HTTPS.
|
|
|
|
#
|
|
|
|
# For example, <code>"http://example.com/path?query"</code> would have a
|
|
|
|
# <code>site</code> value of <code>"http://example.com"</code>.
|
|
|
|
#
|
|
|
|
# @return [String] The components that identify a site.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1467
|
2021-04-02 06:02:30 +00:00
|
|
|
def site; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the site value for this URI.
|
|
|
|
#
|
|
|
|
# @param new_site [String, #to_str] The new site value.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1506
|
2021-04-02 06:02:30 +00:00
|
|
|
def site=(new_site); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns the top-level domain for this host.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk"
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1207
|
2021-04-02 06:02:30 +00:00
|
|
|
def tld; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the top-level domain for this URI.
|
|
|
|
#
|
|
|
|
# @param new_tld [String, #to_str] The new top-level domain.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1215
|
2021-04-02 06:02:30 +00:00
|
|
|
def tld=(new_tld); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a Hash of the URI components.
|
|
|
|
#
|
|
|
|
# @return [Hash] The URI as a <code>Hash</code> of components.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2367
|
2021-04-02 06:02:30 +00:00
|
|
|
def to_hash; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts the URI to a <code>String</code>.
|
|
|
|
#
|
|
|
|
# @return [String] The URI's <code>String</code> representation.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2341
|
2021-04-02 06:02:30 +00:00
|
|
|
def to_s; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts the URI to a <code>String</code>.
|
|
|
|
# URI's are glorified <code>Strings</code>. Allow implicit conversion.
|
|
|
|
#
|
|
|
|
# @return [String] The URI's <code>String</code> representation.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2341
|
2021-04-02 06:02:30 +00:00
|
|
|
def to_str; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The user component for this URI.
|
|
|
|
#
|
|
|
|
# @return [String] The user component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#941
|
2021-04-02 06:02:30 +00:00
|
|
|
def user; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the user component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_user [String, #to_str] The new user component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#970
|
2021-04-02 06:02:30 +00:00
|
|
|
def user=(new_user); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# The userinfo component for this URI.
|
|
|
|
# Combines the user and password components.
|
|
|
|
#
|
|
|
|
# @return [String] The userinfo component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1052
|
2021-04-02 06:02:30 +00:00
|
|
|
def userinfo; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Sets the userinfo component for this URI.
|
|
|
|
#
|
|
|
|
# @param new_userinfo [String, #to_str] The new userinfo component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1091
|
2021-04-02 06:02:30 +00:00
|
|
|
def userinfo=(new_userinfo); end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Converts the string to be UTF-8 if it is not already UTF-8
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2561
|
2022-09-08 01:40:44 +01:00
|
|
|
def force_utf8_encoding_if_needed(str); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Resets composite values for the entire URI
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2552
|
2021-04-02 06:02:30 +00:00
|
|
|
def remove_composite_values; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Replaces the internal state of self with the specified URI's state.
|
|
|
|
# Used in destructive operations to avoid massive code repetition.
|
|
|
|
#
|
|
|
|
# @param uri [Addressable::URI] The URI to replace <code>self</code> with.
|
|
|
|
# @return [Addressable::URI] <code>self</code>.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2519
|
2021-04-02 06:02:30 +00:00
|
|
|
def replace_self(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Splits path string with "/" (slash).
|
|
|
|
# It is considered that there is empty string after last slash when
|
|
|
|
# path ends with slash.
|
|
|
|
#
|
|
|
|
# @param path [String] The path to split.
|
|
|
|
# @return [Array<String>] An array of parts of path.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2542
|
2021-04-02 06:02:30 +00:00
|
|
|
def split_path(path); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Ensures that the URI is valid.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2476
|
2021-04-02 06:02:30 +00:00
|
|
|
def validate; end
|
|
|
|
|
2023-04-04 09:32:44 +00:00
|
|
|
private
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Resets instance variables
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2573
|
2023-04-04 09:32:44 +00:00
|
|
|
def reset_ivs; end
|
|
|
|
|
2021-04-02 06:02:30 +00:00
|
|
|
class << self
|
2023-12-14 15:34:15 +00:00
|
|
|
# Converts a path to a file scheme URI. If the path supplied is
|
|
|
|
# relative, it will be returned as a relative URI. If the path supplied
|
|
|
|
# is actually a non-file URI, it will parse the URI as if it had been
|
|
|
|
# parsed with <code>Addressable::URI.parse</code>. Handles all of the
|
|
|
|
# various Microsoft-specific formats for specifying paths.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# base = Addressable::URI.convert_path("/absolute/path/")
|
|
|
|
# uri = Addressable::URI.convert_path("relative/path")
|
|
|
|
# (base + uri).to_s
|
|
|
|
# #=> "file:///absolute/path/relative/path"
|
|
|
|
#
|
|
|
|
# Addressable::URI.convert_path(
|
|
|
|
# "c:\\windows\\My Documents 100%20\\foo.txt"
|
|
|
|
# ).to_s
|
|
|
|
# #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt"
|
|
|
|
#
|
|
|
|
# Addressable::URI.convert_path("http://example.com/").to_s
|
|
|
|
# #=> "http://example.com/"
|
|
|
|
# @param path [String, Addressable::URI, #to_str] Typically a <code>String</code> path to a file or directory, but
|
|
|
|
# will return a sensible return value if an absolute URI is supplied
|
|
|
|
# instead.
|
|
|
|
# @return [Addressable::URI] The parsed file scheme URI or the original URI if some other URI
|
|
|
|
# scheme was provided.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#292
|
2021-04-02 06:02:30 +00:00
|
|
|
def convert_path(path); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Percent encodes any special characters in the URI.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI to encode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @return [String, Addressable::URI] The encoded URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#616
|
2021-04-02 06:02:30 +00:00
|
|
|
def encode(uri, return_type = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Percent encodes a URI component.
|
|
|
|
#
|
|
|
|
# '9' to be percent encoded. If a <code>Regexp</code> is passed, the
|
|
|
|
# value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A set of
|
|
|
|
# useful <code>String</code> values may be found in the
|
|
|
|
# <code>Addressable::URI::CharacterClasses</code> module. The default
|
|
|
|
# value is the reserved plus unreserved character classes specified in
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.encode_component("simple/example", "b-zB-Z0-9")
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/)
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.encode_component(
|
|
|
|
# "simple/example", Addressable::URI::CharacterClasses::UNRESERVED
|
|
|
|
# )
|
|
|
|
# => "simple%2Fexample"
|
|
|
|
# @param component [String, #to_str] The URI component to encode.
|
|
|
|
# @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
|
|
|
|
# is passed, the <code>String</code> must be formatted as a regular
|
|
|
|
# expression character class. (Do not include the surrounding square
|
|
|
|
# brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
|
|
|
|
# everything but the letters 'b' through 'z' and the numbers '0' through
|
|
|
|
# @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose
|
|
|
|
# encodings should be upcased. This allows normalization of percent
|
|
|
|
# encodings for characters not included in the
|
|
|
|
# <code>character_class</code>.
|
|
|
|
# @return [String] The encoded component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#403
|
2021-04-02 06:02:30 +00:00
|
|
|
def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Percent encodes any special characters in the URI.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI to encode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @return [String, Addressable::URI] The encoded URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#616
|
2021-04-02 06:02:30 +00:00
|
|
|
def escape(uri, return_type = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Percent encodes a URI component.
|
|
|
|
#
|
|
|
|
# '9' to be percent encoded. If a <code>Regexp</code> is passed, the
|
|
|
|
# value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A set of
|
|
|
|
# useful <code>String</code> values may be found in the
|
|
|
|
# <code>Addressable::URI::CharacterClasses</code> module. The default
|
|
|
|
# value is the reserved plus unreserved character classes specified in
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.encode_component("simple/example", "b-zB-Z0-9")
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/)
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.encode_component(
|
|
|
|
# "simple/example", Addressable::URI::CharacterClasses::UNRESERVED
|
|
|
|
# )
|
|
|
|
# => "simple%2Fexample"
|
|
|
|
# @param component [String, #to_str] The URI component to encode.
|
|
|
|
# @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
|
|
|
|
# is passed, the <code>String</code> must be formatted as a regular
|
|
|
|
# expression character class. (Do not include the surrounding square
|
|
|
|
# brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
|
|
|
|
# everything but the letters 'b' through 'z' and the numbers '0' through
|
|
|
|
# @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose
|
|
|
|
# encodings should be upcased. This allows normalization of percent
|
|
|
|
# encodings for characters not included in the
|
|
|
|
# <code>character_class</code>.
|
|
|
|
# @return [String] The encoded component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#403
|
2021-07-05 18:07:09 +00:00
|
|
|
def escape_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Encodes a set of key/value pairs according to the rules for the
|
|
|
|
# <code>application/x-www-form-urlencoded</code> MIME type.
|
|
|
|
#
|
|
|
|
# @param form_values [#to_hash, #to_ary] The form values to encode.
|
|
|
|
# @param sort [TrueClass, FalseClass] Sort the key/value pairs prior to encoding.
|
|
|
|
# Defaults to <code>false</code>.
|
|
|
|
# @return [String] The encoded value.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#740
|
2021-04-02 06:02:30 +00:00
|
|
|
def form_encode(form_values, sort = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Decodes a <code>String</code> according to the rules for the
|
|
|
|
# <code>application/x-www-form-urlencoded</code> MIME type.
|
|
|
|
#
|
|
|
|
# @param encoded_value [String, #to_str] The form values to decode.
|
|
|
|
# @return [Array] The decoded values.
|
|
|
|
# This is not a <code>Hash</code> because of the possibility for
|
|
|
|
# duplicate keys.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#793
|
2021-04-02 06:02:30 +00:00
|
|
|
def form_unencode(encoded_value); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Converts an input to a URI. The input does not have to be a valid
|
|
|
|
# URI — the method will use heuristics to guess what URI was intended.
|
|
|
|
# This is not standards-compliant, merely user-friendly.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI string to parse.
|
|
|
|
# No parsing is performed if the object is already an
|
|
|
|
# <code>Addressable::URI</code>.
|
|
|
|
# @param hints [Hash] A <code>Hash</code> of hints to the heuristic parser.
|
|
|
|
# Defaults to <code>{:scheme => "http"}</code>.
|
|
|
|
# @return [Addressable::URI] The parsed URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#191
|
2021-04-02 06:02:30 +00:00
|
|
|
def heuristic_parse(uri, hints = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns an array of known ip-based schemes. These schemes typically
|
|
|
|
# use a similar URI form:
|
|
|
|
# <code>//<user>:<password>@<host>:<port>/<url-path></code>
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1369
|
2021-04-02 06:02:30 +00:00
|
|
|
def ip_based_schemes; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Joins several URIs together.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# base = "http://example.com/"
|
|
|
|
# uri = Addressable::URI.parse("relative/path")
|
|
|
|
# Addressable::URI.join(base, uri)
|
|
|
|
# #=> #<Addressable::URI:0xcab390 URI:http://example.com/relative/path>
|
|
|
|
# @param *uris [String, Addressable::URI, #to_str] The URIs to join.
|
|
|
|
# @return [Addressable::URI] The joined URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#343
|
2021-04-02 06:02:30 +00:00
|
|
|
def join(*uris); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Normalizes the encoding of a URI component.
|
|
|
|
#
|
|
|
|
# @example
|
|
|
|
# Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z")
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.normalize_component(
|
|
|
|
# "simpl%65/%65xampl%65", /[^b-zB-Z]/
|
|
|
|
# )
|
|
|
|
# => "simple%2Fex%61mple"
|
|
|
|
# Addressable::URI.normalize_component(
|
|
|
|
# "simpl%65/%65xampl%65",
|
|
|
|
# Addressable::URI::CharacterClasses::UNRESERVED
|
|
|
|
# )
|
|
|
|
# => "simple%2Fexample"
|
|
|
|
# Addressable::URI.normalize_component(
|
|
|
|
# "one%20two%2fthree%26four",
|
|
|
|
# "0-9a-zA-Z &/",
|
|
|
|
# "/"
|
|
|
|
# )
|
|
|
|
# => "one two%2Fthree&four"
|
|
|
|
# @param component [String, #to_str] The URI component to encode.
|
|
|
|
# @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
|
|
|
|
# is passed, the <code>String</code> must be formatted as a regular
|
|
|
|
# expression character class. (Do not include the surrounding square
|
|
|
|
# brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
|
|
|
|
# everything but the letters 'b' through 'z' and the numbers '0'
|
|
|
|
# through '9' to be percent encoded. If a <code>Regexp</code> is passed,
|
|
|
|
# the value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A
|
|
|
|
# set of useful <code>String</code> values may be found in the
|
|
|
|
# <code>Addressable::URI::CharacterClasses</code> module. The default
|
|
|
|
# value is the reserved plus unreserved character classes specified in
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
|
|
|
|
# @param leave_encoded [String] When <code>character_class</code> is a <code>String</code> then
|
|
|
|
# <code>leave_encoded</code> is a string of characters that should remain
|
|
|
|
# percent encoded while normalizing the component; if they appear percent
|
|
|
|
# encoded in the original component, then they will be upcased ("%2f"
|
|
|
|
# normalized to "%2F") but otherwise left alone.
|
|
|
|
# @return [String] The normalized component.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#552
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Resolves paths to their simplest form.
|
|
|
|
#
|
|
|
|
# @param path [String] The path to normalize.
|
|
|
|
# @return [String] The normalized path.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2440
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalize_path(path); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Normalizes the encoding of a URI. Characters within a hostname are
|
|
|
|
# not percent encoded to allow for internationalized domain names.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI to encode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @return [String, Addressable::URI] The encoded URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#671
|
2021-04-02 06:02:30 +00:00
|
|
|
def normalized_encode(uri, return_type = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a URI object based on the parsed string.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI string to parse.
|
|
|
|
# No parsing is performed if the object is already an
|
|
|
|
# <code>Addressable::URI</code>.
|
|
|
|
# @return [Addressable::URI] The parsed URI.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#114
|
2021-04-02 06:02:30 +00:00
|
|
|
def parse(uri); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Returns a hash of common IP-based schemes and their default port
|
|
|
|
# numbers. Adding new schemes to this hash, as necessary, will allow
|
|
|
|
# for better URI normalization.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1376
|
2021-04-02 06:02:30 +00:00
|
|
|
def port_mapping; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Unencodes any percent encoded characters within a URI component.
|
|
|
|
# This method may be used for unencoding either components or full URIs,
|
|
|
|
# however, it is recommended to use the <code>unencode_component</code>
|
|
|
|
# alias when unencoding components.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
|
|
|
|
# in this list is encountered then it will remain percent encoded.
|
|
|
|
# @return [String, Addressable::URI] The unencoded component or URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#472
|
2021-04-02 06:02:30 +00:00
|
|
|
def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Unencodes any percent encoded characters within a URI component.
|
|
|
|
# This method may be used for unencoding either components or full URIs,
|
|
|
|
# however, it is recommended to use the <code>unencode_component</code>
|
|
|
|
# alias when unencoding components.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
|
|
|
|
# in this list is encountered then it will remain percent encoded.
|
|
|
|
# @return [String, Addressable::URI] The unencoded component or URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#472
|
2021-04-02 06:02:30 +00:00
|
|
|
def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Unencodes any percent encoded characters within a URI component.
|
|
|
|
# This method may be used for unencoding either components or full URIs,
|
|
|
|
# however, it is recommended to use the <code>unencode_component</code>
|
|
|
|
# alias when unencoding components.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
|
|
|
|
# in this list is encountered then it will remain percent encoded.
|
|
|
|
# @return [String, Addressable::URI] The unencoded component or URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#472
|
2021-04-02 06:02:30 +00:00
|
|
|
def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Unencodes any percent encoded characters within a URI component.
|
|
|
|
# This method may be used for unencoding either components or full URIs,
|
|
|
|
# however, it is recommended to use the <code>unencode_component</code>
|
|
|
|
# alias when unencoding components.
|
|
|
|
#
|
|
|
|
# @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
|
|
|
|
# @param return_type [Class] The type of object to return.
|
|
|
|
# This value may only be set to <code>String</code> or
|
|
|
|
# <code>Addressable::URI</code>. All other values are invalid. Defaults
|
|
|
|
# to <code>String</code>.
|
|
|
|
# @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
|
|
|
|
# in this list is encountered then it will remain percent encoded.
|
|
|
|
# @return [String, Addressable::URI] The unencoded component or URI.
|
|
|
|
# The return type is determined by the <code>return_type</code>
|
|
|
|
# parameter.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#472
|
2021-04-02 06:02:30 +00:00
|
|
|
def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-12-14 15:34:15 +00:00
|
|
|
# Container for the character classes specified in
|
|
|
|
# <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
|
|
|
|
#
|
|
|
|
# Note: Concatenated and interpolated `String`s are not affected by the
|
|
|
|
# `frozen_string_literal` directive and must be frozen explicitly.
|
|
|
|
#
|
|
|
|
# Interpolated `String`s *were* frozen this way before Ruby 3.0:
|
|
|
|
# https://bugs.ruby-lang.org/issues/17104
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#46
|
2021-07-05 18:07:09 +00:00
|
|
|
module Addressable::URI::CharacterClasses; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#47
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#57
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#48
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#60
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#49
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#56
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#58
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#54
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#59
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#51
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#53
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClasses::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#55
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#50
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#52
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#72
|
2023-12-10 17:57:45 +00:00
|
|
|
module Addressable::URI::CharacterClassesRegexps; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#73
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::AUTHORITY = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#74
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::FRAGMENT = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#75
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::HOST = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#76
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::PATH = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#77
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::QUERY = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#78
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::RESERVED = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#79
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#80
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::SCHEME = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#81
|
2023-12-10 17:57:45 +00:00
|
|
|
Addressable::URI::CharacterClassesRegexps::UNRESERVED = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#85
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Raised if something other than a uri is supplied.
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#34
|
2021-07-05 18:07:09 +00:00
|
|
|
class Addressable::URI::InvalidURIError < ::StandardError; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2598
|
2023-08-03 18:17:42 +00:00
|
|
|
module Addressable::URI::NONE; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#1530
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#63
|
2021-07-05 18:07:09 +00:00
|
|
|
module Addressable::URI::NormalizeCharacterClasses; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#68
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#64
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#66
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#69
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#67
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#65
|
2021-07-05 18:07:09 +00:00
|
|
|
Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2427
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::PARENT = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#89
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2429
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2430
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2431
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2432
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#2426
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# Tables used to optimize encoding operations in `self.encode_component`
|
|
|
|
# and `self.normalize_component`
|
|
|
|
#
|
|
|
|
# source://addressable//lib/addressable/uri.rb#360
|
2023-08-03 18:17:42 +00:00
|
|
|
Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Array)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#364
|
2023-08-03 18:17:42 +00:00
|
|
|
Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Array)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#84
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::SLASH = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/uri.rb#87
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/version.rb#23
|
2021-07-05 18:07:09 +00:00
|
|
|
module Addressable::VERSION; end
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/version.rb#24
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/version.rb#25
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/version.rb#28
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::VERSION::STRING = T.let(T.unsafe(nil), String)
|
2023-12-14 15:34:15 +00:00
|
|
|
|
|
|
|
# source://addressable//lib/addressable/version.rb#26
|
2021-04-02 06:02:30 +00:00
|
|
|
Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer)
|