Skip to content

Instantly share code, notes, and snippets.

@satooshi
Created October 27, 2014 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satooshi/78aab1a40148e09aebde to your computer and use it in GitHub Desktop.
Save satooshi/78aab1a40148e09aebde to your computer and use it in GitHub Desktop.
Send a message to Mac OSX notification center.
def changed(file_path)
notify File.open(file_path, "rb").read
end
def notify(result)
messages = result.split("\n")
title = messages.shift
group = messages.shift
info = messages.join("\n")
require 'rubygems'
require 'terminal-notifier'
TerminalNotifier.notify(info, :title => title, :group => group)
end
changed(ARGV[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment