Sha256: 3d698a944ea8662b09edef4cfc9e4fe65c65f2c83cae5a3804e913e5bc4e1563

Contents?: true

Size: 141 Bytes

Versions: 2

Compression:

Stored size: 141 Bytes

Contents

class String
  def to_slug
    self.downcase.gsub( /[^-a-z0-9~\s\.:;+=_]/, '').gsub(/[\s\.:;=_+]+/, '-').gsub(/[\-]{2,}/, '-').to_s
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bloggit-1.0.3 lib/bloggit/etc/string.rb
bloggit-1.0.7 lib/bloggit/etc/string.rb