Sha256: d2281fe3e01dbaa21ae3d96e91cf96a25049a1f4837d36172e8d016f521ceb60

Contents?: true

Size: 498 Bytes

Versions: 13

Compression:

Stored size: 498 Bytes

Contents

class String
  
  def unindent
    gsub(/^\s*/,'')
  end
  
  def unindent!
    gsub!(/^\s*/,'')
  end
  
  def self.random_char
    case random_digit = rand(62)
      when  0...10 : random_digit.to_s
      when 10...36 : (random_digit + 55).chr
      when 36...62 : (random_digit + 61).chr
    end
  end

  def self.random(length_of_string=8)
    Array.new(length_of_string) { random_char }.join
  end
  
  def nameify() downcase.gsub(/[^\w]/, '') end
  def nameify!() replace nameify end
    
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
eric-adhearsion-0.8.0 lib/adhearsion/foundation/string.rb
jicksta-adhearsion-0.7.999 lib/adhearsion/foundation/string.rb
jicksta-adhearsion-0.8.0 lib/adhearsion/foundation/string.rb
jicksta-adhearsion-0.8.2 lib/adhearsion/foundation/string.rb
jicksta-adhearsion-0.8.3 lib/adhearsion/foundation/string.rb
kenwiesner-adhearsioncw-0.8.3 lib/adhearsion/foundation/string.rb
mtrudel-adhearsion-0.8.3 lib/adhearsion/foundation/string.rb
sant0sk1-adhearsion-0.7.999 lib/adhearsion/core_extensions/string.rb
sevenscale-adhearsion-0.8.0 lib/adhearsion/foundation/string.rb
adhearsion-0.8.3 lib/adhearsion/foundation/string.rb
adhearsion-0.8.0 lib/adhearsion/foundation/string.rb
adhearsion-0.8.2 lib/adhearsion/foundation/string.rb
adhearsion-0.8.1 lib/adhearsion/foundation/string.rb