module Guard::Notifier::Growl

def available?(silent = false)

Returns:
  • (Boolean) - the availability status

Parameters:
  • silent (Boolean) -- true if no error messages should be shown
def available?(silent = false)
  if RbConfig::CONFIG['host_os'] =~ /darwin/
    require 'growl'
    if ::Growl.installed?
      true
    else
      ::Guard::UI.error "Please install the 'growlnotify' executable." unless silent
      false
    end
  else
    ::Guard::UI.error 'The :growl notifier runs only on Mac OS X.' unless silent
    false
  end
rescue LoadError, NameError
  ::Guard::UI.error "Please add \"gem 'growl'\" to your Gemfile and run Guard with \"bundle exec\"." unless silent
  false
end

def notify(type, title, message, image, options = { })

Options Hash: (**options)
  • password (String) -- the password used for remote notifications
  • host (String) -- the hostname or IP address to which to send a remote notification
  • priority (String, Integer) -- specify an int or named key (default is 0)
  • sticky (Boolean) -- make the notification sticky

Parameters:
  • options (Hash) -- additional notification library options
  • image (String) -- the path to the notification image
  • message (String) -- the notification message body
  • title (String) -- the notification title
  • type (String) -- the notification type. Either 'success', 'pending', 'failed' or 'notify'
def notify(type, title, message, image, options = { })
  require 'growl'
  ::Growl.notify(message, DEFAULTS.merge(options).merge({
      :name => 'Guard',
      :title => title,
      :image => image
  }))
end