Module: Tilia::Http::UrlUtil
- Defined in:
- lib/tilia/http/url_util.rb
Overview
URL utility class
Note: this class is deprecated. All its functionality moved to functions.php or sabreuri.
Class Method Summary collapse
-
.decode_path(path) ⇒ String
deprecated
Deprecated.
use SabreHTTPdecodePath
-
.decode_path_segment(path) ⇒ String
deprecated
Deprecated.
use SabreHTTPdecode_path_segment
-
.encode_path(path) ⇒ String
deprecated
Deprecated.
use SabreHTTPencode_path
-
.encode_path_segment(path_segment) ⇒ String
deprecated
Deprecated.
use SabreHTTPencode_path_segment
-
.resolve(base_path, new_path) ⇒ String
deprecated
Deprecated.
Use SabreUriresolve.
-
.split_path(path) ⇒ Object
deprecated
Deprecated.
Use SabreUrisplit.
Class Method Details
.decode_path(path) ⇒ String
Deprecated.
use SabreHTTPdecodePath
Decodes a url-encoded path
37 38 39 |
# File 'lib/tilia/http/url_util.rb', line 37 def self.decode_path(path) Tilia::Http.decode_path(path) end |
.decode_path_segment(path) ⇒ String
Deprecated.
use SabreHTTPdecode_path_segment
Decodes a url-encoded path segment
46 47 48 |
# File 'lib/tilia/http/url_util.rb', line 46 def self.decode_path_segment(path) Tilia::Http.decode_path_segment(path) end |
.encode_path(path) ⇒ String
Deprecated.
use SabreHTTPencode_path
Encodes the path of a url.
slashes (/) are treated as path-separators.
17 18 19 |
# File 'lib/tilia/http/url_util.rb', line 17 def self.encode_path(path) Tilia::Http.encode_path(path) end |
.encode_path_segment(path_segment) ⇒ String
Deprecated.
use SabreHTTPencode_path_segment
Encodes a 1 segment of a path
Slashes are considered part of the name, and are encoded as %2f
28 29 30 |
# File 'lib/tilia/http/url_util.rb', line 28 def self.encode_path_segment(path_segment) Tilia::Http.encode_path_segment(path_segment) end |
.resolve(base_path, new_path) ⇒ String
Deprecated.
Use SabreUriresolve.
Resolves relative urls, like a browser would.
65 66 67 |
# File 'lib/tilia/http/url_util.rb', line 65 def self.resolve(base_path, new_path) Tilia::Uri.resolve(base_path, new_path) end |
.split_path(path) ⇒ Object
Deprecated.
Use SabreUrisplit.
Returns the ‘dirname’ and ‘basename’ for a path.
55 56 57 |
# File 'lib/tilia/http/url_util.rb', line 55 def self.split_path(path) Tilia::Uri.split(path) end |