lib/guard/notifier.rb
# 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
#
Show a system notification with all configured notifiers.
Show a system notification with all configured notifiers .
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
            get_notifier_module(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
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 get_notifier_module ( 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
Show a system notification with all configured notifiers.
Show a system notification with all configured notifiers .
message
options
title the notification title
title the notification title
message the message to show
message the message to show