module CLIHelpers
Public Instance Methods
animate()
click to toggle source
# File lib/cyrus-code-challenge/cli-helpers.rb, line 3 def animate sleep 0.01 end
clear()
click to toggle source
# File lib/cyrus-code-challenge/cli-helpers.rb, line 7 def clear print "\e[2J\e[f" end
colorize(text, color_code)
click to toggle source
# File lib/cyrus-code-challenge/cli-helpers.rb, line 11 def colorize(text, color_code) "\e[#{color_code}m#{text}\e[0m" end
green(text)
click to toggle source
# File lib/cyrus-code-challenge/cli-helpers.rb, line 16 def green(text); colorize(text, 32); end
red(text)
click to toggle source
# File lib/cyrus-code-challenge/cli-helpers.rb, line 15 def red(text); colorize(text, 31); end