Module: Guard::Notifier::Notifu
Overview
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):
Constant Summary
- DEFAULTS =
Default options for rb-notifu gem
{ :time => 3, :icon => false, :baloon => false, :nosound => false, :noquiet => false, :xp => false }
Instance Method Summary (collapse)
-
- (Boolean) available?(silent = false)
Test if the notification library is available.
-
- (Object) notify(type, title, message, image, options = { })
Show a system notification.
Instance Method Details
- (Boolean) available?(silent = false)
Test if the notification library is available.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/guard/notifiers/rb_notifu.rb', line 40 def available?(silent = false) 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 |
- (Object) notify(type, title, message, image, options = { })
Show a system notification.
70 71 72 73 74 75 76 77 78 |
# File 'lib/guard/notifiers/rb_notifu.rb', line 70 def notify(type, title, , image, = { }) require 'rb-notifu' ::Notifu.show(DEFAULTS.merge().merge({ :type => notifu_type(type), :title => title, :message => })) end |