Created
April 2, 2012 19:39
-
-
Save releu/2286634 to your computer and use it in GitHub Desktop.
Simple alarm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after = ARGV.join | |
def say(message) | |
system "say -v Zarvox #{message}" | |
end | |
begin | |
time = after.to_i | |
puts "You will be notified after #{time} hours" | |
sleep time * 60 * 60 | |
say('Wake up, Neo') | |
sleep 10 | |
loop do | |
say('Wake up!') | |
sleep 0.5 | |
end | |
rescue | |
puts "Invalid Time", "try to ruby alarm.rb 8" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment