Created
June 7, 2010 01:01
-
-
Save wvl/428083 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def green(message); "\e[32m" + message + "\e[0m"; end | |
def red(message); "\e[31m" + message + "\e[0m"; end | |
def yellow(message); "\e[33m" + message + "\e[0m"; end | |
ARGF.each do |line| | |
if line =~ /^- / | |
if line =~ /FAILED/ | |
puts red(line.chop!) | |
else | |
puts green(line.chop!) | |
end | |
elsif line =~ /^\d+ specifications/ | |
if line.match(/(\d+) failures/)[1].to_i > 0 | |
puts red(line.chop!) | |
else | |
puts green(line.chop!) | |
end | |
else | |
puts line | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment