Sha256: 2252b967caf546b72c54da8adfcadff73b8476af6911da5ae2fc4e7116897ccc

Contents?: true

Size: 212 Bytes

Versions: 1

Compression:

Stored size: 212 Bytes

Contents

class String
  def to_permalink
    str = self.de_2_int
    str.gsub!(/'/, "")
    str.gsub!(/[^-\w\d]+/sim, "-")
    str.gsub!(/-+/sm, "-")
    str.gsub!(/^-?(.*?)-?$/, '\1')
    str.downcase!
    str
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
permalinker-1.0.0 lib/permalinker/string_ext.rb