class Guard::Notifier::GrowlNotify
notification :growl_notify, sticky: true
@example Add the ‘:growl_notify` notifier with configuration options to your `Guardfile`
notification :growl_notify
@example Add the `:growl_notify` notifier to your `Guardfile`
end
gem ’growl_notify’
group :development
@example Add the ‘growl_notify` gem to your `Gemfile`<br><br>(growl.info) through AppleScript.
This gem is available for OS X and sends system notifications to
System notifications using the [GrowlNotify](github.com/scottdavis/growl_notify) gem.
def self._register!(options)
-
(Boolean)- whether or not GrowlNotify is available
Other tags:
- Private: -
def self._register!(options) if ::GrowlNotify.application_name != 'Guard' ::GrowlNotify.config do |c| c.notifications = %w(success pending failed notify) c.default_notifications = 'notify' c.application_name = 'Guard' end end true rescue ::GrowlNotify::GrowlNotFound unless options[:silent] ::Guard::UI.error 'Please install Growl from http://growl.info' end false end
def self.available?(opts = {})
def self.available?(opts = {}) super and require_gem_safely(opts) and _register!(opts) end
def self.supported_hosts
def self.supported_hosts %w[darwin] end
def notify(message, opts = {})
(**opts)-
priority(Integer) -- the importance of message from -2 (very -
sticky(Boolean) -- if the message should stick to the screen -
image(String) -- the path to the notification image -
title(String) -- the notification title -
type(String) -- the notification type. Either 'success',
Parameters:
-
opts(Hash) -- additional notification library options -
message(String) -- the notification message body
def notify(message, opts = {}) super self.class.require_gem_safely opts = DEFAULTS.merge( application_name: 'Guard', with_name: opts.delete(:type).to_s, description: message, icon: opts.delete(:image) ).merge(opts) ::GrowlNotify.send_notification(opts) end