lib/travis/tools/notification.rb in travis-1.6.3.travis.373.4 vs lib/travis/tools/notification.rb in travis-1.6.3.travis.374.4
- old
+ new
@@ -39,16 +39,12 @@
def notify(title, body)
system BIN_PATH, '-message', body.to_s, '-title', title.to_s, '-sender', 'org.travis-ci.Travis-CI'
end
def available?
- System.mac? and System.os_version.to_s >= '10.8' and nc_running?
+ System.mac? and System.os_version.to_s >= '10.8' and System.running? "NotificationCenter"
end
-
- def nc_running?
- system 'pgrep -u $(whoami) NotificationCenter >/dev/null'
- end
end
class Growl
def initialize
@command = "growlnotify"
@@ -57,10 +53,10 @@
def notify(title, body)
system @command, '-n', 'Travis', '--image', ICON, '-m', body, title
end
def available?
- System.has? @command
+ System.has? @command and System.running? "Growl"
end
end
class LibNotify < Growl
def initialize