Created
May 9, 2013 02:17
-
-
Save iorionda/5545107 to your computer and use it in GitHub Desktop.
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
| #!/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| # prowl_notification.rb | |
| require 'prowl' | |
| KEY_TITLE = 'PROWL_NOTICE_TITLE' | |
| KEY_DESC = 'PROWL_NOTICE_DESC' | |
| API_KEY = 'PROWL_API_KEY' | |
| class ProwlNotification | |
| def initialize | |
| @prowl = Prowl.new(apikey: API_KEY, | |
| application: 'ProwlNotification') | |
| end | |
| def do(title, description) | |
| title ||= ARGV[0] || '' | |
| description ||= ARGV[1] || 'process has been finished.' | |
| @prowl.add(event: title, description: description) | |
| end | |
| end | |
| if __FILE__ == $0 | |
| prowl_notification = ProwlNotification.new | |
| prowl_notification.do(ENV[KEY_TITLE],ENV[KEY_DESC]) | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prowl
ruby-prowl
gem install prowl