Search
Categories
Ad

mw: printing variables to Growl using Meow

mw

mw

Today I uploaded a new Rubygem called “mw” (pronounced as [mi'u]).

mw is a tiny useful library to output the result of pp to Growl.The original idea of Growl printing comes from jugyo’s g. Though the concept is great, g does not work on my environment. I’ve got “connection errors” from Growl.
I suspect that “ruby-growl” library on my machine does not work well.

Anyway, to overcome this problem, I reinvented the same feature using Meow, a Growl notification wrapper for the rb-cocoa environment.

INSTALL

First, you need to be a Mac-user, and have installed rb-cocoa.

port install rb-cocoa

Sinece I uploaded mw.gem to gemcutter.org, installing mw is as easy as

gem install gemcutter
gem tumble
gem install mw

USAGE

require 'mw'
mw "message"
mw YourClass.new

To change priority, you can use mw1~5. (mw3 is normal, mw1 is the lowest, and mw5 is the highest. mw4 and mw5 will fire the sticky notes, so that the note will live on your screen persitently.

begin
do_dangerous_and_raise_some_exception
rescue => e
mw4 e
end

SOURCES

all the sources can be seen at http://github.com/tomoya55/mw.

NOTES

1. If you are still not sure what mw is, please take a look at jugyo’s presentation of g.

2. My mw requires rb-cocoa and meow. If you runs ruby on Linux or Windows, you cannot use this library. use g instead.

Tags: ,

Leave a Reply