System notifications using the [GrowlNotify](github.com/scottdavis/growl_notify) gem.
This gem is available for OS X and sends system notifications to [Growl](growl.info) through AppleScript.
@example Add the `growl_notify` gem to your `Gemfile`
group :development gem 'growl_notify' end
@example Add the `:growl_notify` notifier to your `Guardfile`
notification :growl_notify
@example Add the `:growl_notify` notifier with configuration options to your `Guardfile`
notification :growl_notify, sticky: true
Default options for the growl_notify notifications.
@private
# File lib/guard/notifiers/growl_notify.rb, line 67 def self._register!(options) if ::GrowlNotify.application_name != 'Guard' ::GrowlNotify.config do |c| c.notifications = %(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
Shows a system notification.
@param [String] message the notification message body @param [Hash] opts additional notification library options @option opts [String] type the notification type. Either 'success',
'pending', 'failed' or 'notify'
@option opts [String] title the notification title @option opts [String] image the path to the notification image @option opts [Boolean] sticky if the message should stick to the screen @option opts [Integer] priority the importance of message from -2 (very
low) to 2 (emergency)
# File lib/guard/notifiers/growl_notify.rb, line 51 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
Generated with the Darkfish Rdoc Generator 2.