module AWS::Core::UriEscape
def escape value
-
(String)
- Returns a URI escaped string.
Parameters:
-
value
(String
) --
def escape value value = value.encode("UTF-8") if value.respond_to?(:encode) CGI::escape(value.to_s).gsub('+', '%20').gsub('%7E', '~') end
def escape_path value
-
(String)
- Returns a URI-escaped path without escaping the
Parameters:
-
value
(String
) --
def escape_path value escaped = "" value.scan(%r{(/*)([^/]*)(/*)}) do |(leading, part, trailing)| escaped << leading + escape(part) + trailing end escaped end