Module: Retab::Util
- Defined in:
- lib/retab/util.rb
Class Method Summary collapse
-
.encode_path(value) ⇒ Object
URL-encode a path segment.
Class Method Details
.encode_path(value) ⇒ Object
URL-encode a path segment.
Mirrors Python’s ‘urllib.parse.quote(value, safe=”)` and Go’s ‘url.PathEscape` — encodes every reserved character so the path interpolation is safe for arbitrary IDs (including slashes).
17 18 19 |
# File 'lib/retab/util.rb', line 17 def self.encode_path(value) URI.encode_www_form_component(value.to_s).gsub('+', '%20') end |