Class: ActionDispatch::Journey::Router::Utils::UriEncoder
- Defined in:
- actionpack/lib/action_dispatch/journey/router/utils.rb
Overview
URI path and fragment escaping tools.ietf.org/html/rfc3986
Constant Summary collapse
- ENCODE =
:nodoc:
"%%%02X"
- US_ASCII =
Encoding::US_ASCII
- UTF_8 =
Encoding::UTF_8
- EMPTY =
(+"").force_encoding(US_ASCII).freeze
- DEC2HEX =
(0..255).map { |i| (ENCODE % i).force_encoding(US_ASCII) }
- ALPHA =
"a-zA-Z"
- DIGIT =
"0-9"
- UNRESERVED =
"#{ALPHA}#{DIGIT}\\-\\._~"
- SUB_DELIMS =
"!\\$&'\\(\\)\\*\\+,;="
- ESCAPED =
/%[a-zA-Z0-9]{2}/
- FRAGMENT =
/[^#{UNRESERVED}#{SUB_DELIMS}:@\/?]/
- SEGMENT =
/[^#{UNRESERVED}#{SUB_DELIMS}:@]/
- PATH =
/[^#{UNRESERVED}#{SUB_DELIMS}:@\/]/
Instance Method Summary collapse
- #escape_fragment(fragment) ⇒ Object
- #escape_path(path) ⇒ Object
- #escape_segment(segment) ⇒ Object
- #unescape_uri(uri) ⇒ Object
Instance Method Details
#escape_fragment(fragment) ⇒ Object
52 53 54 |
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 52 def escape_fragment(fragment) escape(fragment, FRAGMENT) end |
#escape_path(path) ⇒ Object
56 57 58 |
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 56 def escape_path(path) escape(path, PATH) end |