Sha256: 33f0e8bc7cc83de8266207d98765496196ccff6a187f109a4bc0db6784ffbfbf
Contents?: true
Size: 577 Bytes
Versions: 8
Compression:
Stored size: 577 Bytes
Contents
module Inkling module Slugs #copied from enki see http://www.enkiblog.com/ def sluggerize(slug) text = slug.dup text.downcase! text.gsub!(/&(\d)+;/, '') # Ditch Entities text.gsub!('&', 'and') # Replace & with 'and' text.gsub!(/['"]/, '') # replace quotes by nothing text.gsub!(/\ +/, '-') # replace all white space sections with a dash text.gsub!(/(-)$/, '') # trim dashes text.gsub!(/^(-)/, '') # trim dashes text.gsub!(/[^\/a-zA-Z0-9\-]/, '-') # Get rid of anything we don't like text end end end
Version data entries
8 entries across 8 versions & 1 rubygems