Skip to content

Instantly share code, notes, and snippets.

@machty
Last active June 12, 2017 06:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machty/0818c1f72cc007caaa4547868662c6e2 to your computer and use it in GitHub Desktop.
Save machty/0818c1f72cc007caaa4547868662c6e2 to your computer and use it in GitHub Desktop.
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
# Actual example
#puts 'Importing categories [ ' + green('DONE') + ' ]'
#puts 'Importing tags [' + red('FAILED') + ']'
puts
puts "Randomized with seed 36543"
puts
10.times do
print green('.')
sleep 0.1
end
10.times do
print red('F')
sleep 0.1
end
10.times do
print red('U')
sleep 0.1
end
5.times do
print red('C')
sleep 0.1
end
2.times do
print red('K')
sleep 0.1
end
3.times do
print green('.')
sleep 0.1
end
6.times do
print red('Y')
sleep 0.1
end
6.times do
print red('O')
sleep 0.1
end
6.times do
print red('U')
sleep 0.1
end
5.times do
print green('.')
sleep 0.1
end
puts
puts
puts "Finished in 4.23 seconds (files took 558 minutes 36 seconds to load)"
puts red("64 examples, 46 failures, your parents hate you, and TDD is dead")
puts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment