Sha256: 84bb3e4093b01628a7cfc7c3a92d3f70698b858d7568908921e20034707db066

Contents?: true

Size: 258 Bytes

Versions: 8

Compression:

Stored size: 258 Bytes

Contents

class String
  RESET_KEY = "\033[0m".freeze
  {
    bold:   "\033[1m",
    green:  "\033[32m",
    red:    "\033[31m",
    yellow: "\033[33m",
  }.each do |name, color_key|
    define_method(name) do
      "#{color_key}#{self}#{RESET_KEY}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dirwatch-0.0.9 lib/dirwatch/string_extensions.rb
dirwatch-0.0.8 lib/dirwatch/string_extensions.rb
dirwatch-0.0.7 lib/dirwatch/string_extensions.rb
dirwatch-0.0.6 lib/dirwatch/string_extensions.rb
dirwatch-0.0.5 lib/dirwatch/string_extensions.rb
dirwatch-0.0.4 lib/dirwatch/string_extensions.rb
dirwatch-0.0.3 lib/dirwatch/string_extensions.rb
dirwatch-0.0.2 lib/dirwatch/string_extensions.rb