Use TerminalNotifier.notify to send notifications to the macOS Notification Center (macOS 10.10+). You can pass a message string as the first argument, followed by an optional hash of configuration options.
Supported options include:
:title: The title of the notification.:subtitle: A subtitle for the notification.:activate: An application bundle ID to activate when the notification is clicked.:open: A URL or file path to open.:execute: A shell command to execute.:group: A group identifier (e.g., Process.pid) to group notifications.:sender: The bundle ID of the sender.:sound: The sound to play (e.g., 'default').
TerminalNotifier.notify('Hello World')
TerminalNotifier.notify('Hello World', :title => 'Ruby', :subtitle => 'Programming Language')
TerminalNotifier.notify('Hello World', :activate => 'com.apple.Safari')
TerminalNotifier.notify('Hello World', :open => 'http://twitter.com/julienXX')
TerminalNotifier.notify('Hello World', :execute => 'say "OMG"')
TerminalNotifier.notify('Hello World', :group => Process.pid)
TerminalNotifier.notify('Hello World', :sender => 'com.apple.Safari')
TerminalNotifier.notify('Hello World', :sound => 'default')