Sha256: 76fce94cfd95f274f8bf4ec5de67492ed9ced4ab32a138e380393d125e182c32

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

module Notifier
  module TerminalNotifier
    extend self

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

    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
      ]

      Thread.new { system(*command) }.join
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
notifier-0.5.1 lib/notifier/terminal_notifier.rb