Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 30 lines (28 sloc) 692 Bytes
#!/usr/bin/ruby
# encoding: UTF-8
# coding: UTF-8
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
#Uber simway to colorize outputin
class String
def color(c)
colors = {
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
:blue => 34,
:magenta => 35,
:cyan => 36,
:white => 37
}
return "\e[#{colors[c] || c}m#{self}\e[0m"
end
end
ARGF.each_with_index do |line, count|
line.gsub!(%r{(^.+)\s(\d{2}:\d{2})}, "#{'\\1'.color(:blue)} #{"\\2".color(:red)}")
line.gsub!(%r{(\<.+\>)(.+)}, "#{'\\1'.color(:magenta)} #{"\\2".color(:black)}")
print "#{line}"
end