aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nant-color
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 11:43:07 +0100
committerUbitUmarov2015-09-01 11:43:07 +0100
commitfb78b182520fc9bb0f971afd0322029c70278ea6 (patch)
treeb4e30d383938fdeef8c92d1d1c2f44bb61d329bd /nant-color
parentlixo (diff)
parentMantis #7713: fixed bug introduced by 1st MOSES patch. (diff)
downloadopensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.zip
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.gz
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.bz2
opensim-SC_OLD-fb78b182520fc9bb0f971afd0322029c70278ea6.tar.xz
Merge remote-tracking branch 'os/master'
Diffstat (limited to 'nant-color')
-rwxr-xr-xnant-color57
1 files changed, 57 insertions, 0 deletions
diff --git a/nant-color b/nant-color
new file mode 100755
index 0000000..b368986
--- /dev/null
+++ b/nant-color
@@ -0,0 +1,57 @@
1#!/usr/bin/env ruby
2
3def main
4 IO.popen("nant #{ARGV.join(' ')}") { |pipe|
5 pipe.sync = true
6 while str = pipe.gets
7 str.sub!(/\n+/, '')
8 puts colorize(str)
9 end
10 }
11end
12
13def clear
14 return "\e[0m"
15end
16
17def red(str)
18 return "\e[31m" + str + clear
19end
20
21def green(str)
22 return "\e[32m" + str + clear
23end
24
25def yellow(str)
26 return "\e[33m" + str + clear
27end
28
29def black
30 return "\e[30m"
31end
32
33def hide
34 return "\e[8m"
35end
36
37def bright
38 return "\e[1m"
39end
40
41def colorize(str)
42 str.sub!(/(error \w+:.*)/, red('\1'))
43 str.sub!(/(warning \w+:.*)/, yellow('\1'))
44
45 str.sub!(/(Build Succeeded)/i, green('\1'))
46 str.sub!(/(Compilation succeeded)/, green('\1'))
47 str.sub!(/(\d+ warning\(s\))/, yellow('\1'))
48 str.sub!(/(Build Failed)/i, red('\1'))
49
50 str.sub!(/(Tests run: \d+, Failures: 0, Not run: 0,.*)/, green('\1'))
51 str.sub!(/(Tests run: \d+, Failures: 0, Not run: [1-9].*)/, yellow('\1'))
52 str.sub!(/(Tests run: \d+, Failures: [1-9].*)/, red('\1'))
53 str.sub!(/(Test Case Failures:)/, red('\1'))
54 return str
55end
56
57main()