ruby-growl

What is Growl?

Growl is a global notification system for Mac OS X. Applications can register messages which Growl displays on the screen in a variety of ways depending upon your preferences.

Why ruby-growl?

Growl's existing Ruby bindings only work on Macs, and I wanted my non-Mac machines to be able to send Growl notifications. I peeked inside Growl's remote-notification capabilities and wrote up some code that uses UDP to send Growl notifications across the network.

What Do I Need?

You need a Mac with Growl installed to recieve Growl notifications, Ruby and a kind of network connection between the two machines.

What Do I Get?

ruby-growl features a library you can use to add Growl notifications to your Ruby applications and a command-line tool that is almost option-compatible with growlnotify. (All except for -p is supported, use --priority instead.)

How Do I Use It?

First you need to enable "Listen for incoming notifications" and "Allow remote application registration" on the Network tab of the Growl Preference Panel to send Growl Notifications from ruby-growl. You'll probably also want to set a "UDP password" as well.

From Your Ruby App


require 'ruby-growl'

g = Growl.new "localhost", "ruby-growl",
              ["ruby-growl Notification"]
g.notify "ruby-growl Notification", "It Came From Ruby-Growl",
         "Greetings!"

From the Command Line

echo "message" | growl -H localhost

or:

growl -H localhost -m "message"

Download

TypeDownload
ruby-growl gemruby-growl-1.0.1.gem
ruby-growl tgzruby-growl-1.0.1.tgz

RDoc?

Yep! There's RDoc for ruby-growl.