module Guard::Notifier

def notify(message, options = { })

Options Hash: (**options)
  • title (String) -- the notification title
  • image (Symbol, String) -- the image symbol or path to an image

Parameters:
  • message (String) -- the message to show
def notify(message, options = { })
  if enabled?
    type  = notification_type(options[:image] || :success)
    image = image_path(options.delete(:image) || :success)
    title = options.delete(:title) || 'Guard'
    notifications.each do |notification|
      begin
        NOTIFIERS[notification[:name]].notify(type, title, message, image, options.merge(notification[:options]))
      rescue Exception => e
        ::Guard::UI.error "Error sending notification with #{ notification[:name] }: #{ e.message }"
      end
    end
  end
end