Sha256: 732ee0dc424ee7a4650cfef54ae1e4e9d1dc7897c4c3202bec5033a410dd7523

Contents?: true

Size: 495 Bytes

Versions: 19

Compression:

Stored size: 495 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 then random_digit.to_s
      when 10...36 then (random_digit + 55).chr
      when 36...62 then (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

19 entries across 19 versions & 3 rubygems

Version Path
adhearsion-1.2.6 lib/adhearsion/foundation/string.rb
adhearsion-1.2.5 lib/adhearsion/foundation/string.rb
adhearsion-1.2.4 lib/adhearsion/foundation/string.rb
adhearsion-1.2.3 lib/adhearsion/foundation/string.rb
adhearsion-1.2.1 lib/adhearsion/foundation/string.rb
adhearsion-1.2.0 lib/adhearsion/foundation/string.rb
adhearsion-1.1.1 lib/adhearsion/foundation/string.rb
adhearsion-1.1.0 lib/adhearsion/foundation/string.rb
adhearsion-1.0.3 lib/adhearsion/foundation/string.rb
adhearsion-1.0.2 lib/adhearsion/foundation/string.rb
adhearsion-cw-1.0.2.3 lib/adhearsion/foundation/string.rb
adhearsion-cw-1.0.2.2 lib/adhearsion/foundation/string.rb
adhearsion-cw-1.0.2.1 lib/adhearsion/foundation/string.rb
adhearsion-1.0.1 lib/adhearsion/foundation/string.rb
adhearsion-1.0.0 lib/adhearsion/foundation/string.rb
rene-adhearsion-0.8.6 lib/adhearsion/foundation/string.rb
adhearsion-0.8.6 lib/adhearsion/foundation/string.rb
adhearsion-0.8.5 lib/adhearsion/foundation/string.rb
adhearsion-0.8.4 lib/adhearsion/foundation/string.rb