Class: Nanoc::CLI::Commands::Watch::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/cli/commands/watch.rb

Overview

Allows sending user notifications in a cross-platform way.

Constant Summary

TOOLS =
%w( growlnotify notify-send )

Instance Method Summary (collapse)

Instance Method Details

- (Object) notify(message)

Send a notification. If no notifier is found, no notification will be created.

Parameters:

  • message (String)

    The message to include in the notification



108
109
110
111
112
113
114
115
# File 'lib/nanoc/cli/commands/watch.rb', line 108

def notify(message)
  return if tool.nil?
  if tool == 'growlnotify' && self.on_windows?
    growlnotify_windows(message)
  else
    send(tool.tr('-', '_'), message)
  end
end