module Jeff::Utils

Because Ruby's CGI escapes tilde, use a custom escape.

Constants

UNRESERVED

Public Class Methods

escape(val) click to toggle source
# File lib/jeff.rb, line 83
def self.escape(val)
  val.to_s.gsub(UNRESERVED) do
    match = Regexp.last_match[1]
    "%#{match.unpack('H2' * match.bytesize).join('%')}".upcase
  end
end