Sha256: 2127e02574f370c351e2358c5baf340b399f774b4c362e14b782922307764918

Contents?: true

Size: 292 Bytes

Versions: 13

Compression:

Stored size: 292 Bytes

Contents

class String
  def friendlish
    I18n.transliterate(self).
      downcase.
      gsub(/[^0-9a-z ]/, '').
      squish.
      gsub(' ', '-')
  end

  def markdown_paragraphs
    split(/\n\s*\n/)
  end

  def normalize_whitespaces
    gsub(/([^[:ascii:]])/) { $1.blank? ? ' ' : $1 }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mumuki-laboratory-5.0.12 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.11 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.10 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.9 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.8 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.7 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.6 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.5 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.4 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.3 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.2 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.1 lib/mumuki/laboratory/extensions/string.rb
mumuki-laboratory-5.0.0 lib/mumuki/laboratory/extensions/string.rb