class Raca::Util

Misc helper methods used across the codebase

Public Class Methods

url_encode(str) click to toggle source

CGI.escape, but without special treatment on spaces

  # File lib/raca/util.rb
5 def self.url_encode(str)
6   str.gsub(%r{([^a-zA-Z0-9_./-])}) do |match|
7     '%' + match.unpack('H*').first.scan(/../).join("%").upcase
8   end
9 end