Module: Notifier::TerminalNotifier

Extended by:
TerminalNotifier
Included in:
TerminalNotifier
Defined in:
lib/notifier/terminal_notifier.rb

Instance Method Summary collapse

Instance Method Details

#notify(options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/notifier/terminal_notifier.rb', line 9

def notify(options)
  command = [
    "terminal-notifier",
    "-group", "notifier-rubygems",
    "-title", options[:title],
    "-appIcon", options.fetch(:image, ""),
    "-message", options[:message]
  ]

  Thread.new { system(*command) }
end

#supported?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/notifier/terminal_notifier.rb', line 5

def supported?
  Notifier.os?(/darwin/) && `which terminal-notifier` && $? == 0
end