Open gurgeous opened 8 years ago
That sounds useful, I would be interested in the api, do you have any code examples to show?
Sure - note that the ANSI colors are defined as constants. I'd be happy to wrap this up as a PR that uses pastel
if you give me a bit of direction. :)
def banner(str, color: GREEN)
now = Time.new.strftime("%H:%M:%S")
s = "#{str} ".ljust(72, " ")
puts "#{color}[#{now}] #{s}#{RESET}"
end
and usage:
banner("Factoring primes...")
It would be great to support banners. We use this a lot in our scripts.