Module Guard::Notifier
In: lib/guard/notifiers/growl.rb
lib/guard/notifiers/libnotify.rb
lib/guard/notifiers/rb_notifu.rb
lib/guard/notifiers/gntp.rb
lib/guard/notifiers/file_notifier.rb
lib/guard/notifiers/terminal_notifier.rb
lib/guard/notifiers/notifysend.rb
lib/guard/notifiers/emacs.rb
lib/guard/notifiers/tmux.rb
lib/guard/notifiers/terminal_title.rb
lib/guard/notifiers/growl_notify.rb
lib/guard/notifier.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::Emacs
Module Guard::Notifier::FileNotifier
Module Guard::Notifier::GNTP
Module Guard::Notifier::Growl
Module Guard::Notifier::GrowlNotify
Module Guard::Notifier::Libnotify
Module Guard::Notifier::Notifu
Module Guard::Notifier::NotifySend
Module Guard::Notifier::TerminalNotifier
Module Guard::Notifier::TerminalTitle
Module Guard::Notifier::Tmux

Constants

NOTIFIERS = [ [ [:gntp, ::Guard::Notifier::GNTP], [:growl, ::Guard::Notifier::Growl], [:growl_notify, ::Guard::Notifier::GrowlNotify], [:terminal_notifier, ::Guard::Notifier::TerminalNotifier], [:libnotify, ::Guard::Notifier::Libnotify], [:notifysend, ::Guard::Notifier::NotifySend], [:notifu, ::Guard::Notifier::Notifu]   List of available notifiers, grouped by functionality. It needs to be a nested hash instead of a simpler Hash, because it maintains its order on Ruby 1.8.7 also.

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

Toggle the system notifications on/off

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

[Validate]