Class: Nanoc3::CLI::Commands::Watch::Notifier

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

Overview

Allows sending user notifications in a cross-platform way.

Constant Summary collapse

TOOLS =

A list of commandline tool names that can be used to send notifications

%w( growlnotify notify-send )

Instance Method Summary collapse

Instance Method Details

#notify(message) ⇒ Object

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

Parameters:

  • message (String)

    The message to include in the notification



102
103
104
105
# File 'lib/nanoc3/cli/commands/watch.rb', line 102

def notify(message)
  return if tool.nil?
  send(tool.tr('-', '_'), message)
end