System notifications using the [rb-notifu](github.com/stereobooster/rb-notifu) gem.
This gem is available for Windows and sends system notifications to [Notifu](www.paralint.com/projects/notifu/index.html):
@example Add the `rb-notifu` gem to your `Gemfile`
group :development gem 'rb-notifu' end
@example Add the `:notifu` notifier to your `Guardfile`
notification :notifu
@example Add the `:notifu` notifier with configuration options to your `Guardfile`
notification :notifu, :time => 5, :nosound => true, :xp => true
Default options for rb-notifu gem
Test if the notification library is available.
@param [Boolean] silent true if no error messages should be shown @param [Hash] options notifier options @return [Boolean] the availability status
# File lib/guard/notifiers/rb_notifu.rb, line 42 def available?(silent = false, options = {}) if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ require 'rb-notifu' true else ::Guard::UI.error 'The :notifu notifier runs only on Windows.' unless silent false end rescue LoadError ::Guard::UI.error "Please add \"gem 'rb-notifu'\" to your Gemfile and run Guard with \"bundle exec\"." unless silent false end
Show a system notification.
@param [String] type the notification type. Either 'success', 'pending', 'failed' or 'notify' @param [String] title the notification title @param [String] message the notification message body @param [String] image the path to the notification image @param [Hash] options additional notification library options @option options [Number] time the number of seconds to display (0 for infinit) @option options [Boolean] icon specify an icon to use ("parent" uses the icon of the parent process) @option options [Boolean] baloon enable ballon tips in the registry (for this user only) @option options [Boolean] nosound do not play a sound when the tooltip is displayed @option options [Boolean] noquiet show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up) @option options [Boolean] xp use IUserNotification interface event when IUserNotification2 is available
# File lib/guard/notifiers/rb_notifu.rb, line 72 def notify(type, title, message, image, options = { }) require 'rb-notifu' ::Notifu.show(DEFAULTS.merge(options).merge({ :type => notifu_type(type), :title => title, :message => message })) end
Generated with the Darkfish Rdoc Generator 2.