Skip to content

Instantly share code, notes, and snippets.

@releu
Created April 2, 2012 19:39
Show Gist options
  • Save releu/2286634 to your computer and use it in GitHub Desktop.
Save releu/2286634 to your computer and use it in GitHub Desktop.
Simple alarm
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