From 9a06bf47b96a393a95b3a5348368a79f9570121f Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 10 Jul 2008 00:05:21 +0000 Subject: added convenience makefile and nant-color script. I've had these on my laptop forever, and others might find them useful to be part of the main tree. --- nant-color | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 nant-color (limited to 'nant-color') diff --git a/nant-color b/nant-color new file mode 100755 index 0000000..ca5ea37 --- /dev/null +++ b/nant-color @@ -0,0 +1,52 @@ +#!/usr/bin/ruby + + +def main + IO.popen("nant #{ARGV.join(' ')}") { |pipe| + pipe.sync = true + while str = pipe.gets + str.sub!(/\n+/, '') + puts colorize(str) + end + } +end + +def clear + return "\e[0m" +end + +def red(str) + return "\e[31m" + str + clear +end + +def green(str) + return "\e[32m" + str + clear +end + +def yellow(str) + return "\e[33m" + str + clear +end + +def black + return "\e[30m" +end + +def hide + return "\e[8m" +end + +def bright + return "\e[1m" +end + +def colorize(str) + str.sub!(/(error \w+:.*)/, red('\1')) + str.sub!(/(warning \w+:.*)/, yellow('\1')) + + str.sub!(/(Build Succeeded)/i, green('\1')) + str.sub!(/(Compilation succeeded)/, green('\1')) + str.sub!(/(\d+ warning\(s\))/, yellow('\1')) + return str +end + +main() -- cgit v1.1 From 9c8e4d09143d8dfb0827fa251483b4e4fb9bdf9c Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sun, 2 Nov 2008 13:13:45 +0000 Subject: Added some more coloring to nant-color (especially for tests) --- nant-color | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nant-color') diff --git a/nant-color b/nant-color index ca5ea37..c4cebb0 100755 --- a/nant-color +++ b/nant-color @@ -46,6 +46,12 @@ def colorize(str) str.sub!(/(Build Succeeded)/i, green('\1')) str.sub!(/(Compilation succeeded)/, green('\1')) str.sub!(/(\d+ warning\(s\))/, yellow('\1')) + str.sub!(/(Build Failed)/i, red('\1')) + + str.sub!(/(Tests run: \d+, Failures: 0, Not run: 0,.*)/, green('\1')) + str.sub!(/(Tests run: \d+, Failures: 0, Not run: [1-9].*)/, yellow('\1')) + str.sub!(/(Tests run: \d+, Failures: [1-9].*)/, red('\1')) + str.sub!(/(Test Case Failures:)/, red('\1')) return str end -- cgit v1.1 From a3183b20253e90e63152e99370c2e6e4ce61abb8 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 3 Sep 2009 15:00:53 -0400 Subject: in case ruby is somewhere else in the path (just used for coloring output) --- nant-color | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nant-color') diff --git a/nant-color b/nant-color index c4cebb0..b368986 100755 --- a/nant-color +++ b/nant-color @@ -1,5 +1,4 @@ -#!/usr/bin/ruby - +#!/usr/bin/env ruby def main IO.popen("nant #{ARGV.join(' ')}") { |pipe| -- cgit v1.1