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 20 21 22 23 24 |
# File 'lib/notifier/terminal_notifier.rb', line 9 def notify() command = [ "terminal-notifier", "-group", "notifier-rubygems", "-title", [:title].to_s, "-appIcon", .fetch(:image, "").to_s, "-message", [:message].to_s, "-subtitle", .fetch(:subtitle, "").to_s ] # -sound with an empty string (e.g., "") will trigger the # default sound so we need to check for it. command.concat(["-sound", .fetch(:sound, "default").to_s] ) if [:sound] Thread.new { system(*command) }.join end |