Class: AutotestNotification::Mac
- Inherits:
-
Object
- Object
- AutotestNotification::Mac
- Defined in:
- lib/autotest_notification/mac.rb
Class Method Summary collapse
Class Method Details
.notify(title, msg, img, failures = 0, pri = 0) ⇒ Object
6 7 8 9 |
# File 'lib/autotest_notification/mac.rb', line 6 def notify(title, msg, img, failures = 0, pri = 0) system "growlnotify -n autotest --image #{img} -p #{pri} -m '#{msg}' #{title}" say(failures) if SPEAKING end |
.say(failures) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/autotest_notification/mac.rb', line 11 def say(failures) if failures > 0 system("say #{failures} test#{'s' unless failures == 1} failed.") @last_test_failed = true elsif @last_test_failed system("say All tests passed successfully.") @last_test_failed = false end end |