Class: Travis::Tools::Notification::Growl

Inherits:
Object
  • Object
show all
Defined in:
lib/travis/tools/notification.rb

Direct Known Subclasses

LibNotify

Instance Method Summary collapse

Constructor Details

#initializeGrowl

Returns a new instance of Growl.



49
50
51
# File 'lib/travis/tools/notification.rb', line 49

def initialize
  @command = "growlnotify"
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/travis/tools/notification.rb', line 57

def available?
  system "which #{@command} >/dev/null 2>/dev/null" unless System.windows?
end

#notify(title, body) ⇒ Object



53
54
55
# File 'lib/travis/tools/notification.rb', line 53

def notify(title, body)
  system @command, '-n', 'Travis', '--image', ICON, '-m', body, title
end