Skip to content

Instantly share code, notes, and snippets.

@wvl
Created June 7, 2010 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvl/428083 to your computer and use it in GitHub Desktop.
Save wvl/428083 to your computer and use it in GitHub Desktop.
#!/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