Sha256: 3c8b863e5d877c39f07a9a0234d35636fb3d6721e3f8294f7ea355da104ccc06

Contents?: true

Size: 678 Bytes

Versions: 6

Compression:

Stored size: 678 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

# Extensions for String

class String

  {
    :reset          =>  0,
    :bold           =>  1,
    :dark           =>  2,
    :underline      =>  4,
    :blink          =>  5,
    :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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ramaze-0.1.1 lib/ramaze/snippets/string/color.rb
ramaze-0.1.4 lib/ramaze/snippets/string/color.rb
ramaze-0.1.2 lib/ramaze/snippets/string/color.rb
ramaze-0.1.3 lib/ramaze/snippets/string/color.rb
ramaze-0.2.0 lib/ramaze/snippets/string/color.rb
ramaze-0.2.1 lib/ramaze/snippets/string/color.rb