Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (10 sloc) 172 Bytes
class String
def sanitize_for_url
s = String.new self
s.gsub! /[[:punct:]]*$/, ''
s.gsub! /_+/, ' '
s.gsub! /[[:punct:]]+/, '-'
s.gsub! /\s/, '_'
s
end
end