module CorrectLink

Public Class Methods

convert(str) click to toggle source
# File lib/correct_link.rb, line 2
def self.convert str
  str.gsub(/(-|\s|\?|\!|\.|\,|\"|\'|\:|\#|\%|\&|\:|\;|\<|\>|\[|\]|\^|\`|\{|\}|\|)/, "_").gsub(/_+/, "_").gsub(/(^_|_$)/, "").downcase
end