Sha256: d993c42f4a52759cdd86bd6536b543e8a73f29457a10eee883e12e63747316d9

Contents?: true

Size: 529 Bytes

Versions: 8

Compression:

Stored size: 529 Bytes

Contents

class ColoredConsoleOutput < ConsoleOutput
  COLORS = {
    :red => 31,
    :green => 32,
    :yellow => 33,
    :cyan => 36
  }
  
  STATUS_COLORS = {
    :start => :cyan,
    :pass => :green,
    :fail => :red,
    :error => :red,
    :warning => :yellow,
    :issue => :yellow
  }
  
  def format(status, date, time, time_zone, msg)
    output = super
    output = colorize(output, STATUS_COLORS[status]) if STATUS_COLORS[status]
    output
  end
  
  def colorize(text, color)
    "\e[#{COLORS[color]}m#{text}\e[0m"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smart_monkey-0.5.0 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.4.2 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.4.1 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.3 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.2.1 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.2 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.1.2 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb
smart_monkey-0.1 lib/ui-auto-monkey/tuneup/test_runner/colored_console_output.rb