11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/notifier/terminal_notifier.rb', line 11
def notify(options)
command = [
"terminal-notifier",
"-group", "notifier-rubygems",
"-title", options[:title].to_s,
"-appIcon", options.fetch(:image, "").to_s,
"-message", options[:message].to_s,
"-subtitle", options.fetch(:subtitle, "").to_s
]
if options[:sound]
command.concat([
"-sound",
options.fetch(:sound, "default").to_s
])
end
Thread.new do
Open3.popen3(*command) do |_stdin, _stdout, _stderr|
end
end.join
end
|