lib/matheus/alert_me.rb in matheus-0.3.0 vs lib/matheus/alert_me.rb in matheus-0.4.0
- old
+ new
@@ -1,12 +1,11 @@
module Matheus
class AlertMe < Command
# Usage:
- # $ alert-me sleep 1 && echo 'Done!'
+ # $ alert-me "sleep 1 && echo 'Done!'"
# Runs the command and plays a sound based on its success or failure after it finishes.
def call(*args)
- command = args.join(" ")
- if system(command)
+ if system(args.join(" "))
system("afplay /System/Library/Sounds/Glass.aiff")
else
system("afplay /System/Library/Sounds/Sosumi.aiff")
end
rescue => e