Skip to content

Instantly share code, notes, and snippets.

@pete
Created September 8, 2010 00:16
Show Gist options
  • Select an option

  • Save pete/569372 to your computer and use it in GitHub Desktop.

Select an option

Save pete/569372 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
def handle_input str
if str.nil?
puts "Bye."
exit
end
puts "REVERSO: #{str.reverse}"
end
$stdout.sync = true # This forces the buffer to be flushed after every write.
loop {
print "prompt> "
input = $stdin.gets
handle_input input
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment