Skip to content

Instantly share code, notes, and snippets.

@jashmenn
Created December 24, 2008 17:45
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 jashmenn/39729 to your computer and use it in GitHub Desktop.
Save jashmenn/39729 to your computer and use it in GitHub Desktop.
# runs ARGV and puts the output
#
# Example:
# ruby poller.rb date
#
# http://gist.github.com/39729
module Screen
def self.clear
print "\e[H\e[2J"
end
end
trap("INT") { puts "Goodbye"; exit }
cmd = ARGV.join(" ")
poll_time = 1
while(true)
Screen.clear
puts `#{cmd}`
sleep poll_time
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment