Sha256: 52d7a8aa20963350d469e00bd9aa61f47c17cef808d64363c9fc50ce7bed0ade

Contents?: true

Size: 313 Bytes

Versions: 12

Compression:

Stored size: 313 Bytes

Contents

require 'active_support/inflector/inflections'

class String
  def parameterize(sep = '-')
    value = Sunrise::Utils::Transliteration.transliterate(self)
    ActiveSupport::Inflector.parameterize(value, sep)
  end

  def self.randomize(length = 8)
    Array.new(length) { (rand(122-97) + 97).chr }.join
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sunrise-cms-1.0.6 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.5 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.4 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.3 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.2 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.1 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.0 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.0.rc3 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.0.rc2 lib/sunrise/core_ext/string.rb
sunrise-cms-1.0.0.rc1 lib/sunrise/core_ext/string.rb
sunrise-cms-0.7.0.rc2 lib/sunrise/core_ext/string.rb
sunrise-cms-0.7.0.rc1 lib/sunrise/core_ext/string.rb