Sha256: 2029f1d25580fedf0c0f9af788f7597465f89eea7c557c8ecf64f9c04770a1e3
Contents?: true
Size: 481 Bytes
Versions: 10
Compression:
Stored size: 481 Bytes
Contents
require 'rack' unless Rack::Utils.respond_to?(:uri_escape) module Rack module Utils def uri_escape(s) s.to_s.gsub(/([^:\/?\[\]\-_~\.!\$&'\(\)\*\+,;=@a-zA-Z0-9]+)/n) { '%'<<$1.unpack('H2'*$1.size).join('%').upcase } end module_function :uri_escape def uri_unescape(s) gsub(/((?:%[0-9a-fA-F]{2})+)/n){ [$1.delete('%')].pack('H*') } end module_function :uri_unescape end end end
Version data entries
10 entries across 10 versions & 1 rubygems