suggestion: banner
gurgeous opened this issue · 2 comments
gurgeous commented
piotrmurach commented
That sounds useful, I would be interested in the api, do you have any code examples to show?
gurgeous commented
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...")