Sha256: b5e29f9f16a4ec0c8821e2500c6baa39ee2c9f71de9c8b88f16ab25048e7f943

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

class String
  { reset:  0,
    bold:  1,
    dark:  2,
    underline:  4,
    blink:  5,
    orange:  6,
    negative:  7,
    black: 30,
    red: 31,
    green: 32,
    yellow: 33,
    blue: 34,
    magenta: 35,
    cyan: 36,
    white: 37,
  }.each do |key, value|
    define_method key do
      "\e[#{value}m" + self + "\e[0m"
    end
  end

  def resembles_base64?
    self.chomp.length % 4 == 0 && self.chomp =~ /^[A-Za-z0-9+\/=]+\Z/
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
azurex-0.6.7 lib/core_ext/string.rb