Skip to content

Instantly share code, notes, and snippets.

@chris-roerig
Created February 8, 2016 14:46
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 chris-roerig/d30415a4e036257d6e41 to your computer and use it in GitHub Desktop.
Save chris-roerig/d30415a4e036257d6e41 to your computer and use it in GitHub Desktop.
Simple puts-er logger
# 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