Sha256: 8708f293c1e4f4be885e02512401d51018b85c9c65b5ae84f4be3640b528e6e0

Contents?: true

Size: 717 Bytes

Versions: 6

Compression:

Stored size: 717 Bytes

Contents

begin
  require 'terminal-notifier'
rescue LoadError
  # NOOP - "TerminalNotifier" is optional
  # will only be used if it is installed!
end

def notify(message, options = {}, verbose = false)
  # print the given message to STDERR, if the
  # script is running with "--verbose" option
  subtitle = options[:subtitle]
  warn(subtitle ? "#{subtitle}: #{message}" : message) if $VERBOSE
  # send a given message to the Mac OS X Notification Center
  # but only if the git-multi script is running interactively
  # and if the "terminal-notifier" gem has been installed...
  if $INTERACTIVE && defined?(TerminalNotifier)
    options[:title] ||= 'git-multi'
    TerminalNotifier.notify(message, options, verbose)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
git-multi-1.0.5 lib/ext/notify.rb
git-multi-1.0.4 lib/ext/notify.rb
git-multi-1.0.3 lib/ext/notify.rb
git-multi-1.0.2 lib/ext/notify.rb
git-multi-1.0.1 lib/ext/notify.rb
git-multi-1.0.0 lib/ext/notify.rb