<?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>fnokd! &#187; Ruby</title>
	<atom:link href="http://www.fnokd.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fnokd.com</link>
	<description>Bob Blogs</description>
	<lastBuildDate>Mon, 18 May 2009 17:42:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Announcement: TorqueBox</title>
		<link>http://www.fnokd.com/2009/05/18/announcement-torquebox/</link>
		<comments>http://www.fnokd.com/2009/05/18/announcement-torquebox/#comments</comments>
		<pubDate>Mon, 18 May 2009 17:41:36 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=593</guid>
		<description><![CDATA[I announced the TorqueBox project today.

It&#8217;s the coolest platform for your Ruby applications, ever.  Really.
]]></description>
			<content:encoded><![CDATA[<p>I <a title="Announcing the TorqueBox project" href="http://torquebox.org/news/2009/05/announcing-the-torquebox-project">announced the TorqueBox project today</a>.</p>
<p><a title="The TorqueBox Project" href="http://torquebox.org/"><img class="aligncenter" title="TorqueBox" src="http://torquebox.org/images/torqueboxSmall.png" alt="" width="148" height="33" /></a></p>
<p>It&#8217;s the coolest platform for your Ruby applications, ever.  Really.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2009/05/18/announcement-torquebox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trip Report: Raleigh RubyCamp</title>
		<link>http://www.fnokd.com/2008/10/20/trip-report-raleigh-rubycamp/</link>
		<comments>http://www.fnokd.com/2008/10/20/trip-report-raleigh-rubycamp/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 13:26:42 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[37signals]]></category>
		<category><![CDATA[camp]]></category>
		<category><![CDATA[cobbler]]></category>
		<category><![CDATA[donuts]]></category>
		<category><![CDATA[genome]]></category>
		<category><![CDATA[raleigh]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=575</guid>
		<description><![CDATA[I did the round-trip from the land of cows to Raleigh to attend the Raleigh RubyCamp over the weekend.
I think I heard about 80 folks showed up, but I&#8217;m not certain on that.
Mark (root@37s) and James did a very nice job of organizing it.&#160; They provided good coffee and donuts to start the morning right.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I did the round-trip from the land of cows to Raleigh to attend the <a title="Raleigh RubyCamp" href="http://barcamp.pbwiki.com/RaleighRubyCamp" mce_href="http://barcamp.pbwiki.com/RaleighRubyCamp">Raleigh RubyCamp</a> over the weekend.</p>
<p>I think I heard about 80 folks showed up, but I&#8217;m not certain on that.</p>
<p>Mark (root@37s) and <a title="James's Blog" href="http://infozerk.com/averyblog/" mce_href="http://infozerk.com/averyblog/">James</a> did a very nice job of organizing it.&nbsp; They provided good coffee and donuts to start the morning right.&nbsp; Krispy Kreme is never a bad idea.</p>
<p>We gathered, and a handful of folks presented introductions about what they wanted to do a session on.&nbsp; We then figured out the slots, and got started.</p>
<p><a title="Brenton's Blog" href="http://exawkuser.blogspot.com/" mce_href="http://exawkuser.blogspot.com/">Brenton Leanhardt</a> talked about <a title="Genome" href="http://genome.et.redhat.com/" mce_href="http://genome.et.redhat.com/">Genome</a> and <a title="Cobbler" href="https://fedorahosted.org/cobbler" mce_href="https://fedorahosted.org/cobbler">Cobbler</a>, two <a title="Red Hat ET" href="http://et.redhat.com/page/Main_Page" mce_href="http://et.redhat.com/page/Main_Page">emerging technologies</a> at Red Hat.&nbsp; Cobbler helps to stitch together distributions, Kickstarts and repositories, while Genome helps manage the inventory of virtualization hardware and the guest instances running on them.</p>
<p>His use-case for the technologies is the fact that we&#8217;ve got Xen hosts running on machines scattered under desks and in closets, which have been donated to a virtual pool.</p>
<p>Where did you launch that instance last month?&nbsp; Where can you launch a new instance today?&nbsp; Genome helps answer those questions.&nbsp; Many of the Genome bits are Camping apps.</p>
<p>I presented my short slide-deck about JBoss-Rails.</p>
<p><a title="Mark's Twitter" href="http://twitter.com/markimbriaco" mce_href="http://twitter.com/markimbriaco">Mark Imbriaco</a> led an open discussion about Rails deployments.&nbsp; It ended up mostly being us asking how 37signals did things.&nbsp; He described their hosting environment, their occasional frustrations with Mongrel, along with some stories about running migrations against a 100gig database.</p>
<p><a title="Sean Cribbs" href="http://seancribbs.com/" mce_href="http://seancribbs.com/">Sean Cribbs</a> talked about his experience in joining and then leading open-source projects, particularly <a title="Radiant CMS" href="http://radiantcms.org/" mce_href="http://radiantcms.org/">Radiant CMS</a>.&nbsp; He discussed breaking up the core into <a title="Radiant on GitHub" href="http://github.com/radiant" mce_href="http://github.com/radiant">many plugins and modules</a>, and the uptick in community participation that followed.</p>
<p>Overall it was a great weekend, and I even got some nice t-shirts out of it.&nbsp; Not bad.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/10/20/trip-report-raleigh-rubycamp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preliminary slides for JBoss-Rails at RubyCamp</title>
		<link>http://www.fnokd.com/2008/10/18/preliminary-slides-rubycamp/</link>
		<comments>http://www.fnokd.com/2008/10/18/preliminary-slides-rubycamp/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 04:27:23 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rubycamp]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=569</guid>
		<description><![CDATA[Thanks to the typical demo demons, I&#8217;ve been unable to get everything functioning perfect for instantaneous clustering on EC2 by tomorrow.
Oh well.
But here&#8217;s the first draft of some slides I&#8217;m taking with me to the Raleigh RubyCamp.

It&#8217;s a BarCamp style event, so I anticipate the slides probably changing throughout the day.  I&#8217;ll published updates [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the typical <a title="Damn you, Amazon" href="http://www.fnokd.com/2008/10/17/run-level-run/">demo demons</a>, I&#8217;ve been unable to get everything functioning perfect for instantaneous clustering on EC2 by tomorrow.</p>
<p>Oh well.</p>
<p>But here&#8217;s the <a href="http://fnokd.com/~bob/jboss-rails-cloud-rubycamp.pdf">first draft of some slides</a> I&#8217;m taking with me to the Raleigh RubyCamp.</p>
<p><a href="http://fnokd.com/~bob/jboss-rails-cloud-rubycamp.pdf"><img class="aligncenter size-medium wp-image-570" title="slide1001" src="http://www.fnokd.com/wp-content/uploads/2008/10/slide1001-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>It&#8217;s a BarCamp style event, so I anticipate the slides probably changing throughout the day.  I&#8217;ll published updates if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/10/18/preliminary-slides-rubycamp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reminder: RaleighRubyCamp</title>
		<link>http://www.fnokd.com/2008/09/30/reminder-raleighrubycamp/</link>
		<comments>http://www.fnokd.com/2008/09/30/reminder-raleighrubycamp/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 13:23:17 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barcamp]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[raleigh]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=534</guid>
		<description><![CDATA[Don&#8217;t forget, in a few weeks at the Red Hat offices in Raleigh, there will be an unconference-style Ruby BarCamp on October 18th.

My plan is to put together a few clumps of slides, prepare a cluster on EC2, and see if anyone wants to hear about JBoss Rails.  I&#8217;ll of course put them online sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t forget, in a few weeks at the <a title="Red Hat in Raleigh" href="http://www.redhat.com/about/contact/ww/americas/raleigh.html">Red Hat offices in Raleigh</a>, there will be an unconference-style <a title="RaleighRubyCamp" href="http://barcamp.pbwiki.com/RaleighRubyCamp">Ruby BarCamp</a> on October 18th.</p>
<p style="text-align: center;"><a href="http://barcamp.pbwiki.com/RaleighRubyCamp"><img class="aligncenter size-medium wp-image-535" title="raleigh-rubycamp" src="http://www.fnokd.com/wp-content/uploads/2008/09/raleigh-rubycamp-300x106.png" alt="" width="300" height="106" /></a></p>
<p>My plan is to put together a few clumps of slides, prepare a cluster on EC2, and see if anyone wants to hear about JBoss Rails.  I&#8217;ll of course put them online sometimes before/during/after the camp, since that&#8217;s <a title="BarCamp rules" href="http://barcamp.pbwiki.com/TheRulesOfBarCamp">part of the rules</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/09/30/reminder-raleighrubycamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBoss on Rails</title>
		<link>http://www.fnokd.com/2008/09/22/jboss-on-rails/</link>
		<comments>http://www.fnokd.com/2008/09/22/jboss-on-rails/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 14:48:10 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[jbossas]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=481</guid>
		<description><![CDATA[Tomorrow is my first real status update call with my boss, Sacha Labourey.  I&#8217;ve been anxious to deliver something, to prove I hadn&#8217;t gone completely pudding-brained during my tenure as management.
This morning, it all finally came together in a pleasing fashion, causing me to hoot and holler loud enough to scare the cats and probably [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow is my first real status update call with my boss, <a title="Sacha's blog" href="http://sacha.labourey.com/">Sacha Labourey</a>.  I&#8217;ve been anxious to deliver something, to prove I hadn&#8217;t gone <em>completely</em> pudding-brained during my tenure as management.</p>
<p>This morning, it all finally came together in a pleasing fashion, causing me to hoot and holler loud enough to scare the cats and probably some cows.</p>
<p><a href="http://www.fnokd.com/wp-content/uploads/2008/09/picture-22.png"><img class="aligncenter size-full wp-image-485" title="Cows" src="http://www.fnokd.com/wp-content/uploads/2008/09/picture-22.png" alt="" width="229" height="134" /></a></p>
<p>I&#8217;ve just <a title="jboss-rails" href="http://github.com/bobmcwhirter/jboss-rails/tree/master">pushed an ugly-but-working deployer</a> targeting <a title="JBoss-AS" href="http://www.jboss.org/jbossas/downloads/">JBoss-AS 5.0.0.CR2</a> (the latest and greatest!)</p>
<p>It&#8217;s not very consumable at this point, as it&#8217;s just a deployer, not a nice Rails plugin with a set of Rake tasks.  Heck, it doesn&#8217;t even <em>undeploy</em> yet.</p>
<p>But adding the deployer to your server&#8217;s <code>deployers/</code> directory allows you symlink live <code>RAILS_ROOT</code>s into your <code>deploy/</code> directory, and be running on JBoss.</p>
<p>Live.  In-situ.  Edit your controllers or views as you like, and your changes are immediately reflected in the running instance.  Just like with <code>./script/server</code>.  It does not even have to redeploy your app.  The rails framework is handling the magic reloading.</p>
<p><a href="http://www.fnokd.com/wp-content/uploads/2008/09/picture-21.png"><img class="aligncenter size-full wp-image-484" title="Hello World" src="http://www.fnokd.com/wp-content/uploads/2008/09/picture-21.png" alt="" width="237" height="55" /></a></p>
<p>It&#8217;s taken me some time to dig through the innards of JBoss-Microcontainer, and a few false starts, but I finally figured out a super simple deployment process.</p>
<p>I&#8217;d previously been trying to manipulate a <code>RAILS_ROOT</code> into a synthetic Java WAR archive, and shoe-horn things around that.  But I have the freedom to go lower than that, so the jboss-rails deployer just sets up a Catalina context appropriately, without regard to <code>WEB-INF</code> or other non-Rails stuff.  There&#8217;s no need for that cruft.  Likewise, I can directly control and manipulate the classpath, so the <code>RAILS_ROOT</code> does not even have to have any JRuby bits in it.</p>
<p>The example application (<a title="ballast test application" href="http://github.com/bobmcwhirter/jboss-rails/tree/master/src/test/ballast">src/test/ballast</a>) is a virgin rails app with ActiveRecord disabled so I don&#8217;t have to deal with database-driver gems just yet.</p>
<p>Once deployed, a Rails app looks like pretty much any other web-app.  The jboss.rails.deployment domain contains deployment objects for each rails app.  And jboss.web contains all the webby bits floating around.</p>
<p><a href="http://www.fnokd.com/wp-content/uploads/2008/09/picture-20.png"><img class="aligncenter size-full wp-image-483" title="Deployment MBean" src="http://www.fnokd.com/wp-content/uploads/2008/09/picture-20.png" alt="" width="217" height="101" /></a>I need to go  back and remove the dead-end code I&#8217;ve left in my wake, and update the tests I&#8217;d disabled while in a coding flury (bad Bob!)  I plan to put together an easy-to-consume plugin gem which contains an nicely-configured AS along with the jboss-rails deployer pre-installed, along with rake tasks to start/stop AS, and deploy your app.  I&#8217;d also like to give clustering a whirl, and see what we can do.</p>
<p>It&#8217;s been an excellent 3 weeks back as an engineer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/09/22/jboss-on-rails/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>And now, something slightly different</title>
		<link>http://www.fnokd.com/2008/08/28/and-now-something-slightly-different/</link>
		<comments>http://www.fnokd.com/2008/08/28/and-now-something-slightly-different/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 21:19:08 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[JBoss.ORG]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=433</guid>
		<description><![CDATA[Back in May, I was a manager.
I feebly attempted to direct 8 great guys and gals to further the goals of JBoss.org.  After the Codehaus, you&#8217;d think I&#8217;d be able to help build an opensource community with fun and flair.  But I came to realize that it&#8217;s hard to build a community as an active [...]]]></description>
			<content:encoded><![CDATA[<p>Back in May, I was a manager.</p>
<p>I feebly attempted to direct 8 great guys and gals to further the goals of JBoss.org.  After the Codehaus, you&#8217;d think I&#8217;d be able to help build an opensource community with fun and flair.  But I came to realize that it&#8217;s hard to build a community as an active effort.  Instead, I think community develops as a by-product of a useful and well-run project.  And that&#8217;s under the control of the project leaders and contributors, not necessarily some external third party.</p>
<p>Back in May, I gave up being a manger.</p>
<p>Now, the day after Labor Day, fittingly enough, I&#8217;ll be jumping back into the world of JBoss.  But <strong>not as a manager</strong>. When I was burned out and felt like resigning, <a title="Proctor's Drools blog" href="http://blog.athico.com/">Mark Proctor</a> and <a title="Sacha's Blog" href="http://sacha.labourey.com/">Sacha Labourey</a> instead talked me into taking a sabbatical.  And I&#8217;m truly grateful to them.  Now, after unwinding for a few months, I asked to rejoin the team as an engineer.  Through Sacha&#8217;s patience and budget manipulation, I&#8217;m once again excited to go to work.  I think JBoss should definitely be held up as a company that takes care of its people.  They could&#8217;ve easily given me the boot, but instead they&#8217;ve been extremely kind and accommodating.</p>
<p>So, what will I be doing?</p>
<p>After talking to Java developers and Rubyists alike, my first goals are to look at Rails as just-another-way to write J2EE apps (or &#8220;JEE&#8221; I reckon, these days&#8230;).  Yes, I know about (and plan to use) things like <a title="Warbler" href="http://blog.nicksieger.com/articles/2007/09/04/warbler-a-little-birdie-to-introduce-your-rails-app-to-java">Warbler</a> and <a title="JRuby-Rack" href="http://blog.nicksieger.com/articles/2008/05/08/introducing-jruby-rack">JRuby-Rack</a>.  Both are good things.</p>
<p>But I also have full control of the deployment environment, to build a stack to make it happier than &#8220;build and deploy a WAR&#8221;.</p>
<p>Through the miracle of <a title="JBossAS" href="http://www.jboss.org/jbossas/">AS5</a> built on <a title="JBossMC" href="http://www.jboss.org/jbossmc/">JBossMicrocontainer</a>, along with the awesome <a title="JBossVFS" href="http://repository.jboss.org/maven2/org/jboss/jboss-vfs/">VFS</a> bits, it should be possible to deploy a Rails app in-situ, right from your working directory.  There should be no reason to have to build a WAR while you&#8217;re hacking a rails app.  And deployment to a server should still involve capistrano (in my opinion).  Stick to the Rails way of doing things, but make it Java under the covers.</p>
<p>Various blog posts have shown Rails apps on Glassfish in 12, 10, or 5 steps.  My goal is to get it down to 1 step. And you should magically be able to pick up and use all the wonderful JEE bits that maps to the Rails functionality the Railers of the world enjoy, without having to be aware of the JEE bits.</p>
<p>Speaking with Mark Newton (the guy who runs JBoss.org now), it seems sensible to view Rails as simply yet-another-programming-model for writing Java apps.  The idea is to avoid leaky abstractions, so we&#8217;re not having to write some psuedo RubyJava application.</p>
<p>Once we&#8217;ve got that base covered, then we can make fun and exciting Ruby bindings to all the powerful JBoss tools, such as Drools, ESB, Cache or MQ.</p>
<p>I expect to have a bit of fun with this.  More fun than being a manager, certainly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/08/28/and-now-something-slightly-different/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Raleigh RubyCamp</title>
		<link>http://www.fnokd.com/2008/08/25/raleigh-rubycamp/</link>
		<comments>http://www.fnokd.com/2008/08/25/raleigh-rubycamp/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 21:37:33 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[unconference]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=431</guid>
		<description><![CDATA[Oh, fortuna!
I&#8217;m rejoining the Red Hat/JBoss mothership, doing rubyish things, and what do you know, but there&#8217;s a RubyCamp at the RHT HQ in Raleigh on October 18th.
37signals and Ruby Row are sponsoring the event.

Space is limited to 200, but at the time of this posting only 57 have signed up.  It&#8217;s an unconference, so [...]]]></description>
			<content:encoded><![CDATA[<p>Oh, fortuna!</p>
<p>I&#8217;m rejoining the Red Hat/JBoss mothership, doing rubyish things, and what do you know, but there&#8217;s a <a title="Raleigh RubyCamp" href="http://barcamp.pbwiki.com/RaleighRubyCamp">RubyCamp</a> at the RHT HQ in Raleigh on October 18th.<a title="37signals" href="http://37signals.com/"></a></p>
<p><a title="37signals" href="http://37signals.com/">37signals</a> and <a title="Ruby Row" href="http://rubyrow.net/">Ruby Row</a> are sponsoring the event.<a title="Ruby Row" href="http://rubyrow.net/"><br />
</a></p>
<p>Space is limited to 200, but at the time of this posting only 57 have signed up.  It&#8217;s an unconference, so bring your own good ideas, and you can lead a session</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/08/25/raleigh-rubycamp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Be a smarter patch monkey</title>
		<link>http://www.fnokd.com/2008/08/24/be-a-smarter-patch-monkey/</link>
		<comments>http://www.fnokd.com/2008/08/24/be-a-smarter-patch-monkey/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 01:03:10 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/?p=426</guid>
		<description><![CDATA[A project I&#8217;m working on requires some hard-core monkey-patching of Rails internals.
Monkey-patching is a dangerous occupation, and liable to cause new and intriguing bugs into previously-tested sane code.
I&#8217;ve been working on a smarter patch-monkey, known as Lemur.
The goal is to allow monkey-patched methods (currently only instance methods are supported) to be written in modules that [...]]]></description>
			<content:encoded><![CDATA[<p>A project I&#8217;m working on requires some hard-core monkey-patching of Rails internals.</p>
<p>Monkey-patching is a dangerous occupation, and liable to cause new and intriguing bugs into previously-tested sane code.</p>
<p>I&#8217;ve been working on a smarter patch-monkey, known as <a title="Lemur: The smarter patch monkey" href="http://github.com/bobmcwhirter/lemur/tree/master">Lemur</a>.</p>
<p>The goal is to allow monkey-patched methods (currently only instance methods are supported) to be written in modules that are mixed in (as modules are) but allowing redefinition of methods in the patchee by the patcher module.</p>
<p>I may be ignorant of some Ruby to make it happen, but I&#8217;ve resorted to <strong>alias_method</strong> and <strong>remove_method</strong>, along with a handful of Ruby&#8217;s reflection methods to swap methods in a reasonable, clean, and auditable fashion.</p>
<p>The specs demonstrate how it works.  Assume a basic class:</p>
<pre><code>
class BasicClass
  def some_instance_method()
    # ...
  end
end
</code></pre>
<p>And a module to monkey-patch it</p>
<pre><code>
module PatchModule
  def some_instance_method()
    # ...
  end
end</code></pre>
<p>Normally, Ruby will prefer a locally-defined method over a module mix-in, so you can&#8217;t just <strong>include</strong> your patch module in, even using <strong>class_eval</strong>.</p>
<p>So, invite in the Lemur.</p>
<pre><code>
Lemur.patch_class(BasicClass, PatchModule)
</code></pre>
<p>And voila!  Your class is monkey-patched by the nicely self-contained module,  plus, it&#8217;s tracked.</p>
<pre><code>
Lemur.patched_classes # [ BasicClass ]
</code></pre>
<p>And even more cool, you can get some patch-audit information for each patched class:</p>
<pre><code>
Lemur.patch_records( BasicClass ) # [ array of PatchRecords ]
</code></pre>
<p>Each PatchRecord keeps up with the patched class, the patched method name, the actual replaced Method object, along with the patch module and the patch method.</p>
<p>A total of 40min has been spent writing the code so far.  The idea is to add better auditability, <strong>unpatching</strong>, and dealing with class methods, not just instance methods.</p>
<p>Now, when you encounter a weird bug, you can ask the Lemur where the oddness might&#8217;ve originated.</p>
<p>Want to pitch in and do some meta-programming to make future meta-programming less scary, <a href="http://github.com/bobmcwhirter/lemur/tree/master">fork my git repository</a> and send me some pull requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2008/08/24/be-a-smarter-patch-monkey/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Point of Use</title>
		<link>http://www.fnokd.com/2007/12/22/point-of-use/</link>
		<comments>http://www.fnokd.com/2007/12/22/point-of-use/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 07:26:27 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/2007/12/22/point-of-use/</guid>
		<description><![CDATA[When we moved from C to C++, we were overjoyed that we no longer had to declare all of our variables at the top of the function.

do_something() {
  int num = 0;
  int another_num = 0;
  num = get_a_num();
  another_num = get_a_num();
}
We could instead declare them near the point of use, [...]]]></description>
			<content:encoded><![CDATA[<p>When we moved from C to C++, we were overjoyed that we no longer had to declare all of our variables at the top of the function.</p>
<pre style="font-size: 10pt">
do_something() {
  int num = 0;
  int another_num = 0;
  num = get_a_num();
  another_num = get_a_num();
}</pre>
<p>We could instead declare them near the point of use, when needed.</p>
<pre style="font-size: 10pt">
do_something() {
  int num = 0;
  num = get_a_num();
  int another_num = 0;
  another_num = get_a_num();
}</pre>
<p>Ultimately, the rule intends to make things visible to the smallest necessary scope.  While technically &#8220;scope&#8221; is an entire block, actual scope for a given statement consists only of that statement and those that follow.  Defining variables at the top of a block unnecessarily extends their scope beyond the actual needs.</p>
<p>That&#8217;s great for variables.  What about expressions or statements or blocks of statements?</p>
<p>When we hack out straight code, perhaps a one-time chunk of Perl or Ruby or bash, we declare a statement exactly at its point of use.   If we don&#8217;t name it, it&#8217;s lost in the ether, immediately out of scope again.</p>
<pre style="font-size: 10pt">
rm -Rf path/to/stuff
mkdir other/path/to/stuff
cc -o google google.c</pre>
<p>We climb up into the world of &#8220;engineering&#8221; and we start to create functions, or classes and methods.  We give names to a chunk of statements and increase the visible scope of this code.</p>
<pre style="font-size: 10pt">
def turn_on_sprinkler()
  call_sprinkler_webservice( :on )
end</pre>
<p>But have we just moved our declarations too high, like our variable declarations in C at the top of the block?</p>
<p>We follow a rule that if you use the result of an expression more than once, you should stuff it into a variable.  A local variable.  Not a global variable.  More than likely not an instance variable.</p>
<p>How about if you use a statement more than once, you stuff it into a named block.  A local named block.  Not a global named block.  More than likely not a method on a class.</p>
<pre style="font-size: 10pt">
notify = Proc.new{|person,message|
  person.email.send( message )
  person.sms.send( message )
}

notify.call( person.wife, "I'll be home late" )
notify.call( person.mistress, "Motel 6 in 10" )</pre>
<p>Unless the functionality is required at any higher scope, declaring and defining named blocks locally prevents pollution of the namespaces.</p>
<p>With languages such as Ruby, instance methods can be defined upon instances that need them, instead of upon every instance of a given class.</p>
<pre style="font-size: 9pt">
def ship_via_cargo_container(item={})
  class &lt;&lt; item
    def cube
      (self[:height]||1) * (self[:width]||1) * (self[:length]||1)
    end
  end

  freight_cost  = item.cube * 100.dollars
  handling_cost = item.cube * 10.dollars * 2
end</pre>
<p>In effect, this view is one of macros.  When it&#8217;s convenient to create a short-hand notation, or a micro-DSL, do it where it has minimal impact on the rest of the system.</p>
<p>It could be argued that interpreters and compilers are not prepared to see and optimize for these types of blocks.  The Java world surely keeps debating closures.  I have no idea the impact on Ruby interpretation when you&#8217;re constantly defining new methods on individual objects.  But then again, there was a time we feared the overhead of managing objects instead of simply free functions and structs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2007/12/22/point-of-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unwind with Subversion</title>
		<link>http://www.fnokd.com/2007/10/15/unwind-with-subversion/</link>
		<comments>http://www.fnokd.com/2007/10/15/unwind-with-subversion/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 04:30:32 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Codehaus]]></category>
		<category><![CDATA[JBoss.ORG]]></category>
		<category><![CDATA[Opensource]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/2007/10/15/unwind-with-subversion/</guid>
		<description><![CDATA[At the Codehaus and at JBoss.org, I&#8217;ve continually come across Subversion repositories that needed to be split apart or merged, perhaps after converting from CVS.  One problem you continually hit, particularly if you&#8217;re merging repositories, is the &#8220;date order of revisions&#8221; bug.  Simply stated, if you create a new repository loaded from two [...]]]></description>
			<content:encoded><![CDATA[<p>At the <a title="Codehaus" href="http://codehaus.org/">Codehaus</a> and at <a title="JBoss" href="http://jboss.org/">JBoss.org</a>, I&#8217;ve continually come across Subversion repositories that needed to be split apart or merged, perhaps after converting from CVS.  One problem you continually hit, particularly if you&#8217;re merging repositories, is <a href="http://svn.haxx.se/dev/archive-2006-01/0381.shtml">the &#8220;date order of revisions&#8221; bug</a>.  Simply stated, if you create a new repository loaded from two other repositories, you can end up with a situation where revision N does not necessarily occur before revision N+1, in terms of the commit time-stamp.</p>
<p>When you do a date-based operation using Subversion, it does a binary search through the revision sequence to find the revisions matching the specified dates. This binary search assumes the revisions are indeed date-ordered.</p>
<p>With the acquisition of Mobicents by JBoss, we&#8217;re in the situation of having to merge about a dozen repositories. Some are CVS, some are SVN.  Good ol&#8217; <a title="cvs2svn" href="http://cvs2svn.tigris.org/cvs2svn.html">cvs2svn</a> works well for the first step, of converting a CVS repository into a SVN repository.  But now we have either oddly disjoint repositories, or conflicting paths overlaid one another.</p>
<p>I&#8217;ve always been a fan of <a title="mod_rewrite beginners guide" href="http://www.workingwith.me.uk/articles/scripting/mod_rewrite">mod_rewrite</a> for <a title="Apache httpd" href="http://httpd.apache.org/">Apache-httpd</a>, and a <a title="SVN dumpfile format" href="http://svn.collab.net/repos/svn/trunk/notes/dump-load-format.txt">SVN dumpfile</a> has a lot of paths just ripe for rewriting.  1000 lines of Ruby code later, I&#8217;m able to announce <a title="Unwind" href="http://svn.rubyhaus.org/unwind/trunk/">Unwind</a>.  Unwind is a Ruby library, along with a command-line tool, for performing mind-numbing feats of repository surgery.</p>
<p>Since a massive conversion and rewriting is something that requires a bit of trial-and-error, the command-line utility is ultimately driven by a configuration file.  Of course, with Ruby, it&#8217;s just a DSL created using <a title="Ruby instance_eval" href="http://www.ruby-doc.org/core/classes/Object.html#M000336">instance_eval</a> and blocks.</p>
<p><img width="461" height="389" id="image327" alt="Picture 5.png" src="http://www.fnokd.com/wp-content/uploads/2007/10/Picture%205.png" /></p>
<p>This configuration file will ultimate produce a single file (<code>merged-repo.svndump</code>) from multiple input dump files.  Each source file can <code>include()/exclude</code> paths (based upon the original paths in that particular dumpfile).  Each source can also use Rails-ish URL rewriting.  The <strong><code>:something</code></strong> syntax matches 1 segment of a path, and is available as a substitution value in the output path for the rule.</p>
<p>The rewrite engine tracks all existing paths, and creates parent directories when necessary.  SVN <strong><code>copy</code></strong> operations are fully adjusted both for the source and the destination paths.</p>
<p>Unwind automatically interleaves revisions to achieve total monotonically increasing time-ordering for the final repository.</p>
<p>Finally, before a revision is emitted to the output repository, addition <code>include()/exclude()</code> rules can be applied.  For repositories converted from CVS, you may end up with a bundle of <code>CVSROOT</code> directories attempting to live in the same location.  No reason to rewrite them to unique locations, as you can just exclude them before they get figured into the final output repository.</p>
<p>Unwind uses <a title="SQLite" href="http://www.sqlite.org/">SQLite</a> for organizing the meta-information about each repository and revision, while performing random-access seeks on the source dumpfiles to produce the final repository.   While merging may be the common use-case, Unwind&#8217;s rewriting also makes it useful just for extracting bits out of a repository.</p>
<p>At this point, this blog entry is the complete documentation for Unwind.  But feel free to <a title="Unwind repository" href="http://svn.rubyhaus.org/unwind/trunk/">browse the SVN repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2007/10/15/unwind-with-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Ruby Conference (erubycon)</title>
		<link>http://www.fnokd.com/2007/01/01/enterprise-ruby-conference-erubycon/</link>
		<comments>http://www.fnokd.com/2007/01/01/enterprise-ruby-conference-erubycon/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 18:13:38 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/2007/01/01/enterprise-ruby-conference-erubycon/</guid>
		<description><![CDATA[Maybe I&#8217;ve been living in a hole, but I just found out about erubycon, the enterprise ruby conference.  February 9-11, in Columbus, Ohio, of all places.  Seems to include some reputable speakers.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://erubycon.com/"><img width="133" height="40" align="right" alt="erubycon" id="image119" title="erubycon" src="http://www.fnokd.com/wp-content/uploads/2007/01/Picture%203.png" /></a>Maybe I&#8217;ve been living in a hole, but I just found out about erubycon, the enterprise ruby conference.  February 9-11, in Columbus, Ohio, of all places.  Seems to include <a href="http://erubycon.com/speakers">some reputable speakers</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2007/01/01/enterprise-ruby-conference-erubycon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annc: The Ruby Underground</title>
		<link>http://www.fnokd.com/2006/12/15/announcement-the-ruby-underground/</link>
		<comments>http://www.fnokd.com/2006/12/15/announcement-the-ruby-underground/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 02:56:21 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/2006/12/15/announcement-the-ruby-underground/</guid>
		<description><![CDATA[
Following on the heels of my last post, I&#8217;d like to announce the Ruby Underground.  It&#8217;s simply a selective aggregator of Ruby blogger content.  There&#8217;s already plenty of sources for generic ruby content.  Tons of 20-something youngsters (yes, I&#8217;m old) are out there talking about Ruby on Rails and such.
The Ruby Underground [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rubyunderground.org/"><img width="344" height="52" alt="ru_logo.png" id="image112" title="ru_logo.png" src="http://www.fnokd.com/wp-content/uploads/2006/12/ru_logo.png" /></a></p>
<p>Following on the heels of my <a href="http://www.fnokd.com/2006/12/15/karma-columnist/">last post</a>, I&#8217;d like to announce the <a href="http://rubyunderground.org/">Ruby Underground</a>.  It&#8217;s simply a selective aggregator of Ruby blogger content.  There&#8217;s already plenty of sources for generic ruby content.  Tons of 20-something youngsters (yes, I&#8217;m old) are out there talking about Ruby on Rails and such.</p>
<p>The Ruby Underground tries to address a slightly different audience.  Thus far, all contributors to the underground are either current or former Java hackers.  They&#8217;ve been around the block a time or two and feel squeamish watching all the SQL that ActiveRecord throws.  Yet, they have an affinity to the beauty of Ruby.</p>
<p>While &#8220;<strong>enterprisey</strong>&#8221; is typically a derisive term, I think the Ruby community could use some &#8220;<strong>enterpriseyness</strong>&#8221; to help bring it, um, to the enterprise.</p>
<p>Anyhow, the <a href="http://rubyunderground.org/">Ruby Underground</a>, as noted, is just an aggregator.  If you already read Bob, Brian, Dion, Kurt, Lance, Martin, Paul and Simon, it probably has nothing to offer you.  On the other hand, you&#8217;ll miss out when other bloggers are invited to be contributors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2006/12/15/announcement-the-ruby-underground/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>100% Pure Ruby(tm)</title>
		<link>http://www.fnokd.com/2006/09/26/100-pure-rubytm/</link>
		<comments>http://www.fnokd.com/2006/09/26/100-pure-rubytm/#comments</comments>
		<pubDate>Tue, 26 Sep 2006 06:08:16 +0000</pubDate>
		<dc:creator>Bob McWhirter</dc:creator>
				<category><![CDATA[Day Job]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.fnokd.com/2006/09/26/100-pure-rubytm/</guid>
		<description><![CDATA[Recently I&#8217;ve been doing a fair amount of work in Ruby.  And yes, I&#8217;ve felt super-productive.  Particularly compared to Java.
The downside of working in Java is the 100% Pure Java(tm) mentality.  In the search for a clean and cohesive system, we take the attitude that if it&#8217;s not pure Java, it&#8217;s crap. [...]]]></description>
			<content:encoded><![CDATA[<p><img width="187" height="86" align="left" title="Picture 34.png" id="image87" alt="Picture 34.png" src="http://www.fnokd.com/wp-content/uploads/2006/09/Picture%2034.png" />Recently I&#8217;ve been doing a fair amount of work in Ruby.  And yes, I&#8217;ve felt super-productive.  Particularly compared to Java.</p>
<p>The downside of working in Java is the <strong>100% Pure Java(tm)</strong> mentality.  In the search for a clean and cohesive system, we take the attitude that if it&#8217;s not pure Java, it&#8217;s crap.  In Java, if we need something to happen periodically, we might examine TimerTask, decide it&#8217;s insufficient and move on to Quartz.  So we add it to our build, figure out the API, realize it conflicts with some other dependency.  Well, damn.</p>
<p>With Ruby, it&#8217;s scripty enough to not feel the need to have a 100% Pure Ruby(tm) mentality.  A Ruby system needs something to occur periodically, we just open a pipe to crontab and hand that bit off to cron.</p>
<p><em>&#8220;But Windows doesn&#8217;t have cron!&#8221;</em></p>
<p>Too bad.</p>
<p>Use a better operating system.</p>
<p>The majority of systems deploy to Linux or some other Unix-alike.  Developing on a Unix-ish system only makes sense.  You wouldn&#8217;t prepare to drive an RV by tooling around in a Kia Sportage, now would you?</p>
<p>When you break free of the  JVM mentality and assume a sensible host operating system, you realize that the OS itself is your virtual machine to play in.  If it&#8217;s in your $PATH and can be expected to behave reasonably well on any sane Unix-like OS, by all means, use it.</p>
<p>Back to the premise&#8230; Since Ruby is indeed &#8220;scripty&#8221; you can accomplish a crapload just using a pair of backticks, effectively <em>not even using Ruby atÂ  all</em>.</p>
<p>And you can do it without guilt or complication.  Completely unlike punting to Runtime.exec(&#8230;).  That always makes you feel dirty.</p>
<p>Perhaps Groovy and JRuby will help break the never-escape-the-JVM attitude.  Give a developer backticks and easy pipes to subprocesses, and no telling what sort of nefarious things he might could do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnokd.com/2006/09/26/100-pure-rubytm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
