Created
February 8, 2016 14:46
-
-
Save chris-roerig/d30415a4e036257d6e41 to your computer and use it in GitHub Desktop.
Simple puts-er logger
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
# prints a message in the console. | |
# ################## | |
# this is my message | |
# ################## | |
def info(message, char = "#" ) | |
len = `tput cols`.to_i | |
bar = -> { (len/ char.length).times { print char }; print "\n" } | |
(message.length / len).times { |n| message.insert(((n +1 ) * len), "\n") } | |
bar.call | |
puts message | |
bar.call | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment