Created
October 27, 2014 09:02
-
-
Save satooshi/78aab1a40148e09aebde to your computer and use it in GitHub Desktop.
Send a message to Mac OSX notification center.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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