class ActionDispatch::Journey::Router::Utils
:nodoc:
:nodoc:
:nodoc:
def self.escape_fragment(fragment)
def self.escape_fragment(fragment) ENCODER.escape_fragment(fragment.to_s) end
def self.escape_path(path)
def self.escape_path(path) ENCODER.escape_path(path.to_s) end
def self.escape_segment(segment)
def self.escape_segment(segment) ENCODER.escape_segment(segment.to_s) end
def self.normalize_path(path)
normalize_path("") # => "/"
normalize_path("foo") # => "/foo"
normalize_path("/foo/") # => "/foo"
normalize_path("/foo") # => "/foo"
Also converts downcase url encoded string to uppercase.
Strips off trailing slash and ensures there is a leading slash.
Normalizes URI path.
:nodoc:
:nodoc:
:nodoc:
def self.normalize_path(path) path = "/#{path}" path.squeeze!('/') path.sub!(%r{/+\Z}, '') path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase } path = '/' if path == '' path end
def self.unescape_uri(uri)
def self.unescape_uri(uri) ENCODER.unescape_uri(uri) end