module Guard::Notifier::GNTP
def notify(type, title, message, image, options = { })
(**options)
-
sticky
(Boolean
) -- make the notification sticky -
port
(Integer
) -- the port to send a remote notification -
password
(String
) -- the password used for remote notifications -
host
(String
) -- the hostname or IP address to which to send a remote notification
Parameters:
-
options
(Hash
) -- additional notification library options -
image
(String
) -- the path to the notification image -
message
(String
) -- the notification message body -
title
(String
) -- the notification title -
type
(String
) -- the notification type. Either 'success', 'pending', 'failed' or 'notify'
def notify(type, title, message, image, options = { }) require 'ruby_gntp' options = DEFAULTS.merge(options) gntp = ::GNTP.new('Guard', options.delete(:host), options.delete(:password), options.delete(:port)) unless registered? gntp.register(:notifications => [ { :name => 'notify', :enabled => true }, { :name => 'failed', :enabled => true }, { :name => 'pending', :enabled => true }, { :name => 'success', :enabled => true } ]) registered! end gntp.notify(options.merge({ :name => type, :title => title, :text => message, :icon => "file://#{ image }" })) end