Growl notifications from Ruby on OS X
source link: https://blog.chrislowis.co.uk/2010/07/06/growl-notifications-from-ruby-on-osx.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Growl notifications from Ruby on OS X
July 6, 2010
I wanted to generate Growl notifications from a Ruby script on OSX and had a bit of trouble getting it to work. To save you the same hassle, here's the steps I took:
Install growl
Install Growl if you haven't already. I used version 1.2.
Set some growl preferences
In the growl preference plane (find it under System Preferences)
- under network check "Listen for incoming notifications" and "Allow remote application registration"
- restart growl
Install the ruby-growl gem
There's a couple of different ruby bindings for Growl but ruby-growl seemed to work for me
gem install ruby-growl
Send a growl notification from your Ruby script
You can now send notifications from Ruby
require 'rubygems' require 'ruby-growl' g = Growl.new "127.0.0.1", "ruby-growl", ["ruby-growl Notification"] g.notify "ruby-growl Notification", "It Came From Ruby-Growl", "Greetings!"
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK