Module: Guard::Notifier

Defined in:
lib/guard/notifier.rb

Class Method Summary collapse

Class Method Details

.notify(message, options = {}) ⇒ Object

Shows a notification.

Parameters:

  • message (String)

    the message to show in the notification

  • options (Hash) (defaults to: {})

    the Notiffany #notify options



33
34
35
36
37
38
39
40
# File 'lib/guard/notifier.rb', line 33

def self.notify(message, options = {})
  connect(notify: true) unless @notifier

  @notifier.notify(message, options)
rescue RuntimeError => e
  UI.error "Notification failed for #{@notifier.class.name}: #{e.message}"
  UI.debug e.backtrace.join("\n")
end

.turn_onObject



42
43
44
# File 'lib/guard/notifier.rb', line 42

def self.turn_on
  @notifier.turn_on
end