<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NiceCabbage Blog &#187; rubygems</title>
	<atom:link href="http://www.nicecabbage.com/category/rubygems/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicecabbage.com</link>
	<description>Life, Design, Web Application</description>
	<lastBuildDate>Mon, 07 Jun 2010 02:03:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>mw: printing variables to Growl using Meow</title>
		<link>http://www.nicecabbage.com/2009/11/mw-printing-variables-to-growl-using-meow/</link>
		<comments>http://www.nicecabbage.com/2009/11/mw-printing-variables-to-growl-using-meow/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 02:57:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[rubygems]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.nicecabbage.com/?p=184</guid>
		<description><![CDATA[Today I uploaded a new Rubygem called &#8220;mw&#8221; (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&#8217;s g. Though the concept is great, g does not work on my environment. I&#8217;ve got &#8220;connection errors&#8221; from Growl.
I suspect that &#8220;ruby-growl&#8221; library [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_185" class="wp-caption alignnone" style="width: 465px"><a href="http://www.nicecabbage.com/wp-content/uploads/2009/11/091129-0002.png"><img class="size-full wp-image-185   " title="mw-image" src="http://www.nicecabbage.com/wp-content/uploads/2009/11/091129-0002.png" alt="mw" width="455" height="135" /></a><p class="wp-caption-text">mw</p></div>
<p>Today I uploaded a new Rubygem called &#8220;mw&#8221; (pronounced as [<span>mi'u</span>]).</p>
<p>mw is a tiny useful library to output the result of pp to <a href="http://growl.info/">Growl</a>.The original idea of Growl printing comes from <a href="http://jugyo.org/">jugyo</a>&#8217;s <a href="http://www.slideshare.net/jugyo/g-is-very-useful">g</a>. Though the concept is great, g does not work on my environment. I&#8217;ve got &#8220;connection errors&#8221; from Growl.<br />
I suspect that &#8220;ruby-growl&#8221; library on my machine does not work well.</p>
<p>Anyway, to overcome this problem, I reinvented the same feature using Meow, a Growl notification wrapper for the rb-cocoa environment.</p>
<h2>INSTALL</h2>
<p>First, you need to be a Mac-user, and have installed rb-cocoa.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">port <span style="color: #c20cb9; font-weight: bold;">install</span> rb-cocoa</pre></div></div>

<p>Sinece I uploaded <a href="http://gemcutter.org/gems/mw">mw.gem</a> to <a href="http://gemcutter.org/">gemcutter.org</a>, installing mw is as easy as</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> gemcutter
gem tumble
gem <span style="color: #c20cb9; font-weight: bold;">install</span> mw</pre></div></div>

<h2>USAGE</h2>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'mw'</span>
mw <span style="color:#996600;">&quot;message&quot;</span>
mw YourClass.<span style="color:#9900CC;">new</span></pre></div></div>

<p>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.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">begin</span>
do_dangerous_and_raise_some_exception
<span style="color:#9966CC; font-weight:bold;">rescue</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; e
mw4 e
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h2>SOURCES</h2>
<p>all the sources can be seen at <a href="http://github.com/tomoya55/mw">http://github.com/tomoya55/mw</a>.</p>
<h2>NOTES</h2>
<p>1. If you are still not sure what mw is, please take a look at <a href="http://www.slideshare.net/jugyo/g-is-very-useful">jugyo&#8217;s presentation of g</a>.</p>
<p>2. My mw requires rb-cocoa and meow. If you runs ruby on Linux or Windows, you cannot use this library. use g instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicecabbage.com/2009/11/mw-printing-variables-to-growl-using-meow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
