Module Guard::Notifier
In: lib/guard/notifier.rb
lib/guard/notifiers/gntp.rb
lib/guard/notifiers/growl.rb
lib/guard/notifiers/growl_notify.rb
lib/guard/notifiers/libnotify.rb
lib/guard/notifiers/notifysend.rb
lib/guard/notifiers/rb_notifu.rb

The notifier handles sending messages to different notifiers. Currently the following libraries are supported:

Please see the documentation of each notifier for more information about the requirements and configuration possibilities.

Guard knows four different notification types:

  • success
  • pending
  • failed
  • notify

The notification type selection is based on the image option that is sent to {notify}. Each image type has its own notification type, and notifications with custom images goes all sent as type `notify`. The `gntp` and `growl_notify` notifiers are able to register these types at Growl and allows customization of each notification type.

Guard can be configured to make use of more than one notifier at once, @see Guard::Dsl

Methods

Classes and Modules

Module Guard::Notifier::GNTP
Module Guard::Notifier::Growl
Module Guard::Notifier::GrowlNotify
Module Guard::Notifier::Libnotify
Module Guard::Notifier::Notifu
Module Guard::Notifier::NotifySend

Constants

NOTIFIERS = { :gntp => ::Guard::Notifier::GNTP, :growl => ::Guard::Notifier::Growl, :growl_notify => ::Guard::Notifier::GrowlNotify, :libnotify => ::Guard::Notifier::Libnotify, :notifysend => ::Guard::Notifier::NotifySend, :notifu => ::Guard::Notifier::Notifu   List of available notifiers.

Public Instance methods

Add a notification library to be used.

@param [Symbol] name the name of the notifier to use @param [Boolean] silent disable any error message @param [Hash] options the notifier options @return [Boolean] if the notification could be added

Test if the notifications are on.

@return [Boolean] whether the notifications are on

Get the available notifications.

@return [Hash] the notifications

Set the available notifications.

@param [Array<Hash>] notifications the notifications

Show a system notification with all configured notifiers.

@param [String] message the message to show @option options [Symbol, String] image the image symbol or path to an image @option options [String] title the notification title

Turn notifications on. If no notifications are defined in the `Guardfile` Guard auto detects the first available library.

[Validate]