Skip to content

Instantly share code, notes, and snippets.

@tyru
Forked from jugyo/kurukuru.rb
Created May 13, 2010 12:49
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 tyru/399791 to your computer and use it in GitHub Desktop.
Save tyru/399791 to your computer and use it in GitHub Desktop.
Use "\r" to back to head of line.
t = Thread.start do
l = '/ - \ |'.split
loop do
c = l.shift
print "\r"
print c
STDOUT.flush
sleep 0.1
l.push c
end
end
begin
t.join
rescue Exception
print "\r"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment