<?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>xambr::blog</title>
	<atom:link href="http://blog.xambr.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xambr.com</link>
	<description>crafting my thoughts</description>
	<lastBuildDate>Tue, 20 Jul 2010 18:57:28 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ramaze Error Handling</title>
		<link>http://blog.xambr.com/2010/07/19/ramaze-error-handling/</link>
		<comments>http://blog.xambr.com/2010/07/19/ramaze-error-handling/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 02:39:37 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[handling 404]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=281</guid>
		<description><![CDATA[I recently had to build custom 404 &#38; exception handlers for a Ramaze application. There are several useful discussions on the Ramaze Google Group regarding this topic but I thought I&#8217;d synthesize the solution here for the sake of convenience.
Handling 404 Errors
Ramaze has a built-in controller action to handle 404 errors; it presents a vanilla page [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to build custom 404 &amp; exception handlers for a Ramaze application. There are several useful discussions on the <a href="http://groups.google.com/group/ramaze" target="_blank">Ramaze Google Group</a> regarding this topic but I thought I&#8217;d synthesize the solution here for the sake of convenience.</p>
<h2>Handling 404 Errors</h2>
<p><a href="http://ramaze.net/" target="_blank">Ramaze</a> has a built-in controller action to handle 404 errors; it presents a vanilla page stating &#8216;No action found at: <code>/xyz</code>&#8216;. Overriding this action is easy and <a href="http://doc.rubyists.com/ramaze%2binnate/Innate/Node.html#action_missing-instance_method" target="_blank">well documented</a> but there are a couple of things that might want to consider.</p>
<p>First, if you would like all 404 errors across your application to be handled by a single action, you will need to add your handling code to the base controller.</p>
<p>Second, using a view file corresponding to the controller action does not quite work. While the view is correctly rendered when the 404 occurs directly under a path mapped to the 404 handler&#8217;s controller (eg. <code>/my_missing_action</code>) it is not rendered for 404 errors occurring under paths mapped to other controllers (eg. <code>/users/my_missing_action</code>).</p>
<p>A workaround for this is to use the <code><a href="http://doc.rubyists.com/ramaze%2binnate/Innate/Helper/Render.html#render_file-instance_method" target="_blank">render_file</a></code> method to manually render a view you&#8217;ve created. I have not done due diligence on this problem so I cannot tell you why it occurs &#8211; maybe it is a bug or maybe (likely) I&#8217;m missing something. If anyone has an explanation or a better work around I&#8217;d love to hear it.</p>
<h3>Source for a Custom 404 Handler</h3>
<p><script src="http://gist.github.com/482339.js"> </script></p>
<h2>Handling Exceptions</h2>
<h3>Routing Exceptions</h3>
<p><a href="http://ramaze.net/" target="_blank">Ramaze</a> also has a built-in exception handler which presents a developer-friendly stack trace (one which I&#8217;m sure you will want to hide for the end-users). The <a href="http://groups.google.com/group/ramaze" target="_blank">Ramaze Google Group</a> discussions <a href="http://groups.google.com/group/ramaze/browse_thread/thread/7d90b3f24b80d01e/c92b7eaae3ab73b3?lnk=gst&amp;q=exception+handling#c92b7eaae3ab73b3" target="_blank">here</a> and <a href="http://groups.google.com/group/ramaze/browse_thread/thread/66f7246c29b1a20c/8d0fc5300ebdc34f?lnk=gst&amp;q=exception+handling#8d0fc5300ebdc34f" target="_blank">here</a> talk about how to override this default handler. It boils down to using <code><a href="http://doc.rubyists.com/ramaze%2binnate/Rack/RouteExceptions.html#route-class_method" target="_blank">Rack::RouteExceptions.route(exception, to)</a>;</code> a method that takes the type of exception to route and the path of the action to route it to.</p>
<p>For example, to route all exceptions to the same controller you could use (as stated by Lars Olsson <a href="http://groups.google.com/group/ramaze/browse_thread/thread/7d90b3f24b80d01e/c92b7eaae3ab73b3?lnk=gst&amp;q=exception+handling#c92b7eaae3ab73b3" target="_blank">here</a>):</p>
<pre>Rack::RouteExceptions.route(Exception, MyController.r(:error))</pre>
<p>Alternatively, to handle all IOError exceptions separately you could use:</p>
<pre>Rack::RouteExceptions.route(IOError, MyController.r(:io_error))
Rack::RouteExceptions.route(Exception, MyController.r(:error))</pre>
<p>Note the order of the calls to route is important. You must route the most specific exceptions first or they will be routed to more general handlers specified before them.</p>
<p>Unlike the 404 error handler, using a standard view file <strong>does </strong>work here.</p>
<h3>The Exception Object</h3>
<p>To obtain the exception object within the controller action you can call:</p>
<pre>@error = request.env[Rack::RouteExceptions::EXCEPTION]</pre>
<h3>Source for a Custom Exception Handler</h3>
<p><script src="http://gist.github.com/482348.js"> </script></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Ramaze Error Handling&amp;url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&title=Ramaze Error Handling' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2010/07/19/ramaze-error-handling/&amp;title=Ramaze Error Handling' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Ramaze Error Handling+http://blog.xambr.com/2010/07/19/ramaze-error-handling/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2010/07/19/ramaze-error-handling/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=281&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2010/07/19/ramaze-error-handling/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mellow Musings by Hugo RB for Free</title>
		<link>http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/</link>
		<comments>http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 05:05:36 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[hugo rb]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=271</guid>
		<description><![CDATA[Perhaps not a post pertinent to the software development world but one which I hope you&#8217;ll enjoy nonetheless. My brother, Hugo RB released his debut album in late 2009 to a local audience in Port Perry, Ontario. The album consists of six original &#8216;folk/jazz&#8217; songs written and performed by himself and recorded/mixed by Theo Posthumus.
While [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps not a post pertinent to the software development world but one which I hope you&#8217;ll enjoy nonetheless. My brother, <a title="Hugo's Blog" href="http://www.hugorb.com" target="_blank">Hugo RB</a> released his debut album in late 2009 to a local audience in Port Perry, Ontario. The album consists of six original &#8216;folk/jazz&#8217; songs written and performed by himself and recorded/mixed by <a href="http://www.facebook.com/soundslikearecord">Theo Posthumus</a>.</p>
<p>While I do enjoy the album, I&#8217;ll leave its review to those less biased than myself &#8211; a segment which should grow thanks to Hugo having recently released it for free on <a title="Mellow Musings on Sound Cloud" href="http://soundcloud.com/hugorb/sets/mellow-musings" target="_blank">Sound Cloud</a>. Check it out there or hit play bellow!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowscriptaccess" value="always" /><param name="src" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fhugorb%2Fsets%2Fmellow-musings&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=true&amp;show_artwork=true&amp;color=000120" /><embed type="application/x-shockwave-flash" width="100%" height="225" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fhugorb%2Fsets%2Fmellow-musings&amp;show_comments=true&amp;auto_play=false&amp;show_playcount=true&amp;show_artwork=true&amp;color=000120" allowscriptaccess="always"></embed></object> <span><a href="http://soundcloud.com/hugorb/sets/mellow-musings">Mellow Musings</a> by <a href="http://soundcloud.com/hugorb">Hugorb</a></span></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Mellow Musings by Hugo RB for Free&amp;url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&title=Mellow Musings by Hugo RB for Free' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/&amp;title=Mellow Musings by Hugo RB for Free' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Mellow Musings by Hugo RB for Free+http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=271&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2010/07/11/free-mellow-musings-hugo-rb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Podcasts &amp; Big Ideas</title>
		<link>http://blog.xambr.com/2010/01/20/podcasts-big-ideas/</link>
		<comments>http://blog.xambr.com/2010/01/20/podcasts-big-ideas/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 05:12:37 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Podcasts]]></category>
		<category><![CDATA[big ideas]]></category>
		<category><![CDATA[interesting]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=260</guid>
		<description><![CDATA[Lately I&#8217;ve started listening to a lot of podcasts &#8211; I&#8217;ve always enjoyed good talk radio but its never on when I want it to be and I have no control over what the topic is. For me, podcasts solve both of those problems. While I&#8217;m not going to start reviewing podcasts on a regular [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve started listening to a lot of podcasts &#8211; I&#8217;ve always enjoyed good talk radio but its never on when I want it to be and I have no control over what the topic is. For me, podcasts solve both of those problems. While I&#8217;m not going to start reviewing podcasts on a regular basis, I am going to add a links on the right to my favorite ones in the hopes that you might find something that appeals to you.</p>
<p>There is one podcast that I do want to single out though because its so consistently enjoyable. It is <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=129166905&amp;subMediaType=Audio" target="_blank">TVO&#8217;s Big Ideas</a>, a Canadian production which presents a weekly public lecture delivered by (generally) great speakers on all sorts of topics. It is a veritable gold mine of interesting ideas, perspectives and history that I otherwise would not come across under normal circumstances. You can find more information about it <a href="http://www.tvo.org/TVOsites/WebObjects/TvoMicrosite.woa?bigideas_about" target="_blank">here</a> or subscribe to it <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=129166905&amp;subMediaType=Audio" target="_blank">here</a></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Podcasts &#038; Big Ideas&amp;url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&title=Podcasts &#038; Big Ideas' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2010/01/20/podcasts-big-ideas/&amp;title=Podcasts &#038; Big Ideas' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Podcasts &#038; Big Ideas+http://blog.xambr.com/2010/01/20/podcasts-big-ideas/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2010/01/20/podcasts-big-ideas/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=260&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2010/01/20/podcasts-big-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Ramaze with Unicorn, Nginx and God</title>
		<link>http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/</link>
		<comments>http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 01:19:15 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[god]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[unicorn]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=205</guid>
		<description><![CDATA[I&#8217;ve been meaning to write a post about running a Ramaze website under a reasonable setup for a long time now so I&#8217;m happy to finally get to it. I&#8217;m going to focus my attention on the configuration of the setup vs the installation of the software - RACK, Ramaze, Unicorn and God are ruby gems and there are plenty of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to write a post about running a <a href="http://ramaze.net/" target="_blank">Ramaze</a> website under a reasonable setup for a long time now so I&#8217;m happy to finally get to it. I&#8217;m going to focus my attention on the configuration of the setup vs the installation of the software - <a href="http://rack.rubyforge.org/" target="_blank">RACK</a>, <a href="http://ramaze.net/" target="_blank">Ramaze</a>, <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> and <a href="http://god.rubyforge.org/" target="_blank">God</a> are ruby gems and there are plenty of good articles about installing <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> out there already.</p>
<h2>What You Need</h2>
<p>I&#8217;ve included the version number of the software I&#8217;ve tested this setup with but I suspect this configuration will work with newer versions as well (and probably older versions too).</p>
<ol>
<li><a href="http://rack.rubyforge.org/" target="_blank">RACK</a> (web server interface)
<ul>
<li>1.0.1</li>
</ul>
</li>
<li><a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> (http server)
<ul>
<li>0.95.2</li>
</ul>
</li>
<li><a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> (front end reverse proxy server)
<ul>
<li>0.6.36</li>
</ul>
</li>
<li><a href="http://god.rubyforge.org/" target="_blank">God</a> (process monitoring)
<ul>
<li>0.7.13</li>
</ul>
</li>
<li><a href="http://ramaze.net/" target="_blank">Ramaze</a> (web framework)
<ul>
<li>2009-05</li>
</ul>
</li>
</ol>
<h2>Some Assumptions</h2>
<p>While the config files below make the following assumptions you should be able to handle any discrepancies by altering the paths or changing the run user.</p>
<ol>
<li>Nginx is configured to read configuration files from its <code>conf/sites-enabled</code> directory
<ul>
<li>Add <code>include &lt;path to nginx install&gt;/conf/sites-enabled/*;</code> to the <code>http</code> section of your primary <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> config file to enable this</li>
</ul>
</li>
<li>Your website will run under the www-data user</li>
<li>The <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a>, <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> and <a href="http://god.rubyforge.org/" target="_blank">God</a> config files exist within the <code>config</code> directory of your <a href="http://ramaze.net/" target="_blank">Ramaze</a> website</li>
<li>The <a href="http://rack.rubyforge.org/" target="_blank">RACK</a> config file (config.ru) is in the root of your website</li>
<li>You&#8217;ve created the <code>log</code> and <code>tmp/pids</code> directories underneath the root of your website</li>
</ol>
<h2>Configuring the Pieces</h2>
<h3>1. <a href="http://rack.rubyforge.org/">RACK</a></h3>
<p>This config file is actually a very simple ruby file, its main purpose in this situation is to load your website&#8217;s <code>app.rb</code> via the require statement. This in turn loads the rest of your site.<br />
<script src="http://gist.github.com/278861.js?file=config.ru"></script></p>
<h3>3. <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a></h3>
<p>While I&#8217;ve commented the major parts of the configuration file inline, I highly recommend checking out the <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn website</a> and this <a href="http://unicorn.bogomips.org/examples/unicorn.conf.rb" target="_blank">sample configuration file</a> for more details/features.  <script src="http://gist.github.com/278861.js?file=unicorn.conf"></script></p>
<h3>2. <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a></h3>
<p>You can find more info about configuring Nginx <a href="http://wiki.nginx.org/NginxConfiguration">here</a>.  If assumptions #2 &amp; #4 are true then you&#8217;ll need to create a symlink in the <code>&lt;path-to-nginx-install&gt;/conf/sites-enabled/*</code> directory to your <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> config in the config directory under the root of your website. You can do this by executing</p>
<pre class="code">ln -s /var/www/apps/my.domain.com/config/nginx.conf &lt;path-to-nginx-install&gt;/conf/sites-enabled/my.domain.com</pre>
<p><script src="http://gist.github.com/278861.js?file=nginx.conf"></script></p>
<h3>4. God</h3>
<p>As with the RACK and Unicorn config files, this one is also written in Ruby. The God home page has a much more detailed breakdown of the config file and is definitely worth a read. <script src="http://gist.github.com/278861.js?file=god.conf"></script></p>
<h2>Flicking the Switch</h2>
<p>Once you have your configuration files in place and your website on your target server you&#8217;re going to need to turn it all on. The first step is to tell <a href="http://god.rubyforge.org/" target="_blank">God</a> to keep an eye on your <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> process and the second step is to cycle <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> forcing it to pickup your new website&#8217;s config file.</p>
<h3>Alerting <a href="http://god.rubyforge.org/" target="_blank">God</a></h3>
<p>The first thing to do is start <a href="http://god.rubyforge.org/" target="_blank">God</a> and have it monitor your master <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> process for your new website.  If <a href="http://god.rubyforge.org/" target="_blank">God</a> is not already running you can start it using:</p>
<pre class="code">god --log-level=debug</pre>
<p>To have it start monitoring your <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> process, execute the following:</p>
<pre class="code">sudo god load /var/www/apps/my.domain.com/config/god.conf</pre>
<h3>Cycling <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a></h3>
<p>Cycling <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> is something that cries out for a script so here is a simple one:<br />
<script src="http://gist.github.com/278905.js?file=cycle-nginx.sh"></script></p>
<h2>Dealing with Errors</h2>
<p>After flicking the switch for the first time under this setup I&#8217;ve run into a 502 bad gateway error multiple times. Each time it was because I had forgotten to create the required <code>tmp/pids</code> or <code>log</code> directories under the website root. If you do run into a 502 its probably because <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> had trouble starting up or <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a> is not pointing to the right spot.</p>
<h4>Debugging</h4>
<p>Check the <a href="http://god.rubyforge.org/" target="_blank">God</a> logs for your website by executing:</p>
<pre class="code">god --log-level debug log my.domain.com</pre>
<p>That will tell you if <a href="http://god.rubyforge.org/" target="_blank">God</a> has managed to start the <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> process successfully. If it has then checkout the <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> error logs in the log directory of your website. If it cannot start the process and doesn&#8217;t indicate why then try executing the <a href="http://unicorn.bogomips.org/" target="_blank">Unicorn</a> startup command in a shell directly (that should at least give you the error message Unicorn is generating).</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Running Ramaze with Unicorn, Nginx and God&amp;url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&title=Running Ramaze with Unicorn, Nginx and God' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/&amp;title=Running Ramaze with Unicorn, Nginx and God' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Running Ramaze with Unicorn, Nginx and God+http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=205&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2010/01/16/running-ramaze-with-unicorn-nginx-and-god/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ramaze Partials with Etanni</title>
		<link>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/</link>
		<comments>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 06:14:32 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[etanni]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=176</guid>
		<description><![CDATA[Innate/Ramaze Version: 2009-10
Template Engine: Etanni
The title of this blog post is a little inaccurate as what I&#8217;m actually going to describe are Etanni partials but considering Etanni is the default template engine in Innate/Ramaze 2009-10 I figured &#8220;Ramaze Partials&#8221; was a fair generalization.
Etanni partials are easy to work with and as Pistos points out below [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Innate/Ramaze Version:</strong> 2009-10<br />
<strong>Template Engine:</strong> Etanni</p>
<p>The title of this blog post is a little inaccurate as what I&#8217;m actually going to describe are Etanni partials but considering Etanni is the default template engine in Innate/Ramaze 2009-10 I figured &#8220;Ramaze Partials&#8221; was a fair generalization.</p>
<p>Etanni partials are easy to work with and as Pistos points out below they are documented in the <a href="http://doc.rubyists.com/ramaze+innate/Innate/Helper/Render.html#render_partial-instance_method">rdocs</a>. That said, when I went about looking for info on them (using Google) I missed the rdocs and could only find brief mentions of a &#8220;render helper&#8221; in the blogosphere. My hope is that this post will make it easier to find this information.</p>
<h2>The Render Helper</h2>
<p>This <a href="http://github.com/manveru/innate/blob/master/lib/innate/helper/render.rb" target="_blank">render helper</a> can be found in the <a href="http://github.com/manveru/innate">Innate code base</a> &#8211; it is clearly commented and worth a look if you&#8217;ve got a few minutes. There are 3 methods that this helper provides to aid you in the creation of your partials:</p>
<ol>
<li><span style="font-family: monospace; ">render_partial</span></li>
<li><span style="font-family: monospace;">render_view</span></li>
<li><span style="font-family: monospace;">render_file</span></li>
</ol>
<p>I will only cover <code>render_partial</code> as it is the only one that I&#8217;ve needed to use thus far.</p>
<h2>render_partial</h2>
<p><code>render_partial(action_name, variables = {})</code></p>
<p>The <code>action_name</code> parameter references a controller method and the <code>variables</code> parameter is a hash which is turned into members which are locally accessible within that method. Note that <code>action_name</code> doesn&#8217;t have to actually have a method declaration within a controller &#8211; it can simply be the name of a view.</p>
<h3>Example</h3>
<p>Here is the example code for a rendering contact information via an Etanni partial:</p>
<p><script src="http://gist.github.com/243258.js"></script></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Ramaze Partials with Etanni&amp;url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&title=Ramaze Partials with Etanni' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/&amp;title=Ramaze Partials with Etanni' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Ramaze Partials with Etanni+http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=176&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rails Alternatives: Merb, Sinatra &amp; Ramaze</title>
		<link>http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/</link>
		<comments>http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/#comments</comments>
		<pubDate>Thu, 28 May 2009 05:35:53 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Discoveries]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[web framework]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=132</guid>
		<description><![CDATA[Over the past few months I&#8217;ve been on the hunt for a Ruby web framework to replace Rails as my weapon of choice when building an online presence. Rails struck me as being overly heavy in this context and I wanted something lighter.
I was primarily looking for a web framework that, out of the box, [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months I&#8217;ve been on the hunt for a Ruby web framework to replace <a href="http://rubyonrails.org/" target="_blank">Rails</a> as my weapon of choice when building an online presence. <a href="http://rubyonrails.org/" target="_blank">Rails</a> struck me as being overly heavy in this context and I wanted something lighter.</p>
<p>I was primarily looking for a web framework that, out of the box, supported a healthy variety of template/ORM options, offered flexible routing and good layout/view support.</p>
<p>My search took me through the green pastures of <a href="http://merbivore.com/" target="_blank">Merb</a>, into <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a>&#8217;s glitzy jazz hall and finally into the land of <a href="http://ramaze.net/" target="_blank">Ramaze</a>.</p>
<h2>Merb&#8217;s Green Pastures</h2>
<p>I had heard so many good things about <a href="http://merbivore.com/" target="_blank">Merb</a> that starting with it seemed like a no brainer. The rewrite of <a href="http://www.xambr.com/" target="_blank">xambr.com</a> using <a href="http://merbivore.com/" target="_blank">Merb</a> was mostly an enjoyable experience &#8211; <a href="http://merbivore.com/" target="_blank">Merb</a> was able to do everything I was doing with <a href="http://rubyonrails.org/" target="_blank">Rails</a> out of the box.</p>
<p>There were annoying holes in the documentation but nothing that couldn&#8217;t be filled in through a bit of spelunking in the code base &#8211; which was pretty clean and easy to understand (at least the parts I looked at were).</p>
<p>Of course, a couple days after finishing the rewrite of <a href="http://www.xambr.com/" target="_blank">xambr.com</a> I read that <a href="http://merbivore.com/" target="_blank">Merb</a> was to be merged into <a href="http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3" target="_blank">Rails v3</a>. At first I was a little dismayed but I&#8217;ve come to the opinion that the merge is a good thing &#8211; <a href="http://rubyonrails.org/" target="_blank">Rails</a> will definitely benefit from it and I think <a href="http://merbivore.com/" target="_blank">Merb&#8217;s</a> spot will be taken by the very capable, if under-appreciated, <a href="http://ramaze.net/" target="_blank">Ramaze</a>.</p>
<p>I ran <a href="http://www.xambr.com/" target="_blank">xambr.com</a> on Merb for about 3 months during which time I dabbled in <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> (previously blogged about <a href="http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/" target="_blank">here</a>). These first experiences with <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> were very positive and I liked the fact that it was lighter than Merb &#8211; so I figured I&#8217;d give it a shot.</p>
<h2>Getting Classy with Sinatra [Redux]</h2>
<p>While the rewrite of <a href="http://www.xambr.com/" target="_blank">xambr.com</a> in Merb had taken about 10 hours the rewrite in <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> took 1/2 that time&#8230; or at least 90% of it did.</p>
<p>I got hung up when trying to figure out how to have multiple view sections within a single layout (like <a href="http://merbivore.com/" target="_blank">Merb&#8217;s</a> throw/catch system). Several hours of searching and tinkering didn&#8217;t turn anything up other than a tidbit on <a href="http://github.com/" target="_blank">Github</a> using <a href="http://haml.hamptoncatlin.com/" target="_blank">Haml</a> &#8211; which I was not able to get working with <a href="http://www.kuwata-lab.com/erubis/" target="_blank">Erubis</a> (and I didn&#8217;t want to switch to <a href="http://haml.hamptoncatlin.com/" target="_blank">Haml</a>).</p>
<p>Its very likely that with a bit more poking around, maybe hitting up the mailing list or IRC, a solution could have been found but I didn&#8217;t want to spend any more time with it &#8211; as mentioned above I was looking for a web framework that did all of this out of the box.</p>
<p>So I was a little disappointed, but I still think <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> is a great little web framework &#8211; just not for online presences (or at least not <a href="http://www.xambr.com/" target="_blank">xambr.com</a>).</p>
<h2>Ramaze FTW</h2>
<p>I stumbled upon <a href="http://ramaze.net/" target="_blank">Ramaze</a> several months before starting this little adventure but never gave it the look it deserved. Revisiting it was the best thing I&#8217;ve done all year (code wise anyway). How can one possibly argue with &#8220;Any ruby, any adapter, any ORM and any template engine&#8221; &#8211; contortionists everywhere are jealous of <a href="http://ramaze.net/" target="_blank">Ramaze&#8217;s</a> flexibility.</p>
<p>Rewriting <a href="http://www.xambr.com/" target="_blank">xambr.com</a> in <a href="http://ramaze.net/" target="_blank">Ramaze</a> took about the same time as it did in <a href="http://merbivore.com/" target="_blank">Merb</a> &#8211; roughly 10 hours. I started off using <a href="http://www.kuwata-lab.com/erubis/" target="_blank">Erubis</a> but ultimately ended up using <a href="http://github.com/manveru/nagoro/tree/master" target="_blank">Nagoro</a> &#8211; mainly because I liked its &#8220;Page Elements&#8221; which are like partials only better. <a href="http://github.com/manveru/nagoro/tree/master" target="_blank">Nagoro</a> is pretty close to <a href="http://www.kuwata-lab.com/erubis/" target="_blank">Erubis</a> but I&#8217;d say its a little more natural if you&#8217;re coming at them both with a fresh slate (due to its substitution syntax).</p>
<p><a href="http://ramaze.net/" target="_blank">Ramaze</a> has a great community too &#8211; a question I posed on the <a href="http://ramaze.net/" target="_blank">Ramaze</a> IRC channel about some odd <a href="http://github.com/manveru/nagoro/tree/master" target="_blank">Nagoro</a> behavior got an immediate, friendly response from <a href="http://ramaze.net/" target="_blank">Ramaze&#8217;s</a> creator, <a href="http://github.com/manveru" target="_blank">Michael <span id="author">Fellinger</span></a>. Now, I&#8217;m not a frequenter of IRC channels in general so I wouldn&#8217;t know if getting friendly answers from a technology&#8217;s creator is the norm but to me it was a much appreciated surprise (thanks <a href="http://github.com/manveru" target="_blank">Michael</a>!).</p>
<p>The <a href="http://ramaze.net/learn" target="_blank">documentation</a> for <a href="http://ramaze.net/" target="_blank">Ramaze</a> isn&#8217;t quite complete but its pretty close &#8211; more so than for <a href="http://merbivore.com/" target="_blank">Merb</a> in my opinion. That said it does seem to be less the subject of blog posts than <a href="http://merbivore.com/" target="_blank">Merb</a> (although I think that will all change in the coming months). Its got a <a href="http://book.ramaze.net/" target="_blank">book</a> (albeit an incomplete one), a ton of well written <a href="http://github.com/manveru/ramaze/tree/master/examples" target="_blank">examples</a> of ranging in size from hello world to a <a href="http://github.com/manveru/sociar/tree/master" target="_blank">social networking site</a> and a great <a href="http://blog.purepistos.net/index.php/2008/11/18/ramaze-by-example/" target="_blank">set of blog posts</a> by <a href="http://blog.purepistos.net/" target="_blank">Pistos</a>.</p>
<p>All my gushing aside, I did run into a bit of trouble finding a good end-to-end deployment solution. This wasn&#8217;t a bad thing though &#8211; it forced me to get to know <a href="http://rack.rubyforge.org/" target="_blank">Rack</a> a little better and look into process monitoring solutions. In the coming days (ok maybe weeks&#8230;) I&#8217;ll be posting my solution (which involves a couple of <a href="http://mongrel.rubyforge.org/" target="_blank">mongrels</a> under <a href="http://god.rubyforge.org/">god</a>&#8217;s watchful eye) &#8211; its not rocket science by any stretch of the imagination but I did run into a couple of snags&#8230;</p>
<h2>In Short&#8230;</h2>
<p>To sum it all up for those of you who&#8217;d rather read the back of the envelope (thats me!) here is how I&#8217;d characterize each of these Ruby web frameworks:</p>
<ul>
<li><a href="http://merbivore.com/" target="_blank">Merb</a>
<ul>
<li>Skip it and check out <a href="http://ramaze.net/" target="_blank">Ramaze</a> instead
<ul>
<li><a href="http://merbivore.com/" target="_blank">Merb</a> will likely give you a leg up on Rails 3 but <a href="http://ramaze.net/" target="_blank">Ramaze</a> will serve you better in the &#8220;alternative to Rails&#8221; context.</li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a>
<ul>
<li>Great place to start if you&#8217;re new to web development
<ul>
<li>The <a href="http://www.sinatrarb.com/intro.html" target="_blank">README</a> page is close to a one stop shop for everything you need to get up and singing</li>
</ul>
</li>
<li>The handy multi-tool you need to get small jobs done quickly
<ul>
<li>eg. <a href="http://mwrc2009.confreaks.com/13-mar-2009-11-05-in-a-world-of-middleware-who-needs-monolithic-applications-jon-crosby.html" target="_blank">Rack middleware</a>, tiny websites, web services, etc</li>
</ul>
</li>
</ul>
</li>
<li><a href="http://ramaze.net/" target="_blank">Ramaze</a>
<ul>
<li>The fine wine of Ruby web frameworks
<ul>
<li>It requires a bit more work but its very rewarding</li>
</ul>
</li>
<li>Fluff-less</li>
</ul>
</li>
</ul>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Rails Alternatives: Merb, Sinatra &#038; Ramaze&amp;url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/&amp;title=Rails Alternatives: Merb, Sinatra &#038; Ramaze' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Rails Alternatives: Merb, Sinatra &#038; Ramaze+http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=132&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/05/28/rails-alternatives-merb-sinatra-ramaze/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Bridging the gap</title>
		<link>http://blog.xambr.com/2009/05/05/bridging-the-gap/</link>
		<comments>http://blog.xambr.com/2009/05/05/bridging-the-gap/#comments</comments>
		<pubDate>Tue, 05 May 2009 23:00:53 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Discoveries]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=109</guid>
		<description><![CDATA[Mike Gunderloy started off this week by announcing an exciting new initiative: Rails Bridge. Its mission statement says it all:
To create an inclusive and friendly Ruby on Rails community
To give a bit of context to my excitement&#8230; Up until this time I could sum up my view of the Rails community in one sentence:
Novices need [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://afreshcup.com/2009/05/04/announcing-railsbridge/" target="_blank">Mike Gunderloy</a> started off this week by announcing an exciting new initiative: <a href="http://railsbridge.org/" target="_blank">Rails Bridge</a>. Its mission statement says it all:</p>
<blockquote><p>To create an inclusive and friendly Ruby on Rails community</p></blockquote>
<p>To give a bit of context to my excitement&#8230; Up until this time I could sum up my view of the Rails community in one sentence:</p>
<blockquote><p>Novices need not apply</p></blockquote>
<p>I&#8217;m not saying community wasn&#8217;t willing to help novices, just that it didn&#8217;t seem to want the help <strong>of </strong>novices and in my eyes, the end result was that it looked very <a href="http://2.bp.blogspot.com/_hFvTUKoc_As/SIoY_V9wgWI/AAAAAAAAFGE/121qbcPKtgI/s400/democratic_org_1.jpg" target="_blank">top heavy</a>. That appearance has been enough to keep me at bay and I&#8217;m sure I&#8217;m not the only one&#8230; After all, spare time is limited and it seems like a waste to spend it simply trying to open a door.</p>
<p><a href="http://railsbridge.org/" target="_blank">Rails Bridge</a> looks to change all of that and based on their <a href="http://groups.google.com/group/railsbridge" target="_blank">group discussion</a> they&#8217;re heading in the right direction. I&#8217;m hoping they will succeed in making the community <a href="http://i.ehow.com/images/GlobalPhoto/Articles/4645657/85066-main_Full.jpg" target="_blank">easier to enter</a> and in doing so open the door for many more experts-to-be.</p>
<p>Count me in.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Bridging the gap&amp;url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&title=Bridging the gap' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/05/05/bridging-the-gap/&amp;title=Bridging the gap' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Bridging the gap+http://blog.xambr.com/2009/05/05/bridging-the-gap/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/05/05/bridging-the-gap/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=109&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/05/05/bridging-the-gap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Classy with Sinatra</title>
		<link>http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/</link>
		<comments>http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 00:05:59 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Discoveries]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=85</guid>
		<description><![CDATA[I had heard about the Sinatra Ruby web DSL a while back but I had not had a chance to play with it until a few days ago. I&#8217;m happy to say it was a highly enjoyable experience. I accomplished what I was trying to do very quickly thanks to the good documentation and intuitive [...]]]></description>
			<content:encoded><![CDATA[<p>I had heard about the <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> <a href="http://www.ruby-lang.org/en/" target="_blank">Ruby</a> web DSL a while back but I had not had a chance to play with it until a few days ago. I&#8217;m happy to say it was a highly enjoyable experience. I accomplished what I was trying to do very quickly thanks to the good documentation and intuitive interface. It is not a replacement for MVC frameworks such as <a href="http://rubyonrails.org/" target="_blank">Rails</a>, <a href="http://merbivore.com/" target="_blank">Merb</a>, <a href="http://ramaze.net/" target="_blank">Ramaze</a>, etc but it certainly compliments them.</p>
<h2>Sinatra Features</h2>
<p>The <a href="http://www.sinatrarb.com/intro.html">Sinatra README</a> is a great resource for getting a run down of its features and I&#8217;m not going to regurgitate it here. However, I&#8217;d like to whet your appetite with a few of the features that caught my eye when I first scoped it out.</p>
<h3>Rides on Rack</h3>
<p><a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> rides on <a href="http://rack.rubyforge.org/" target="_blank">Rack</a> and thus supports a wide variety of handlers such as: <a href="http://code.macournoyer.com/thin/" target="_blank">Thin</a>, <a href="http://mongrel.rubyforge.org/" target="_blank">Mongrel</a>, <a href="http://www.modrails.com/" target="_blank">Phusion Passenger</a>, etc (a full list is available on the <a href="http://rack.rubyforge.org/" target="_blank">Rack</a> website). It can also be used to develop <a href="http://rack.rubyforge.org/" target="_blank">Rack</a> middleware. More information about this is available on the <a href="http://www.sinatrarb.com/intro.html">README</a>. If you&#8217;re interested in Rack middleware in general, <a href="http://blog.joncrosby.me/" target="_blank">Jon Crosby</a> gave a great <a href="http://mwrc2009.confreaks.com/13-mar-2009-11-05-in-a-world-of-middleware-who-needs-monolithic-applications-jon-crosby.html" target="_blank">intro</a> at the <a href="http://mwrc2009.confreaks.com/index.html" target="_blank">Moutain West Ruby Conf 2009</a>.</p>
<h3>Flexible Routing</h3>
<p>The routing in <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> is powerful, supporting RESTful actions, named parameters, regular expressions, splats and user agents. See the Gist bellow for an example. The <a href="http://www.sinatrarb.com/intro.html">README</a> page describes these options in more detail.<br />
<script src="http://gist.github.com/91271.js"></script></p>
<h3>View/Template Support</h3>
<p>There are a host of template options available when using <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a>. Currently it supports <a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Haml.html" target="_blank">HAML</a>, <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/" target="_blank">ERB</a>, <a href="http://builder.rubyforge.org/" target="_blank">Builder</a> and <a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html" target="_blank">SASS</a> and automatic layout templates (provided you give it a &#8220;layout&#8221; template to work with). Again, checkout the <a href="http://www.sinatrarb.com/intro.html">README</a> page for more details.</p>
<h2>My Impressions</h2>
<p>What struck me while I was working with <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> was how light it was and how out of the way it stayed. It was only present when I needed it to do something — outside of that, it let me build what I wanted, how I wanted. If <a href="http://rubyonrails.org/" target="_blank">Rails</a> is the web developer&#8217;s assembly line then <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> is their essential toolkit — one drives you and the other is driven by you.</p>
<p>While having a pre-baked MVC web framework such as <a href="http://rubyonrails.org/" target="_blank">Rails</a> and <a href="http://merbivore.com/" target="_blank">Merb</a> is great, it does lock you in to one way of thinking about web development. With <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> you have the freedom to dabble and experiment — and I don&#8217;t think that can ever be a bad thing.</p>
<h2>Resources</h2>
<p>Here are some resources that I found to be useful in my first adventure with <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a>.</p>
<ul>
<li><a href="http://www.sinatrarb.com/intro.html" target="_blank">README</a></li>
<li><a href="http://www.sinatrarb.com/api/" target="_blank">API</a></li>
<li><a href="http://www.sinatrarb.com/documentation.html" target="_blank">Official Documentation Page</a></li>
<li><a href="http://www.modrails.com/documentation/Users%20guide.html" target="_blank">Sinatra on Apache + Phusion Passenger</a></li>
</ul>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Getting Classy with Sinatra&amp;url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&title=Getting Classy with Sinatra' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/&amp;title=Getting Classy with Sinatra' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Getting Classy with Sinatra+http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=85&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/04/07/getting-classy-with-sinatra/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby on Linux with jEdit</title>
		<link>http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/</link>
		<comments>http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 23:51:30 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=66</guid>
		<description><![CDATA[I recently moved from Windows to a Linux development environment and needed to find good text editor &#8211; particularly one that was (or could be made) friends with Ruby. Ideally this editor would be cross platform because, on occasion I do have to load up Windows and if possible I wanted to avoid having a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved from Windows to a Linux development environment and needed to find good text editor &#8211; particularly one that was (or could be made) friends with Ruby. Ideally this editor would be cross platform because, on occasion I do have to load up Windows and if possible I wanted to avoid having a different editor for each environment.</p>
<p>On Windows I was using <a href="http://www.e-texteditor.com/">E</a> &#8211; but that does not run on Linux and I had a couple of gripes with it (slow loading of large files and overaggressive code completion). I gave <a href="http://www.vim.org/">Vim/gVim</a> a shot but I didn&#8217;t enjoy text-editing in a console and <a href="http://www.vim.org/">gVim</a> is ugly (yes, I do believe <a title="Chapter 3, Pragmatic Thinking and Learning by Andy Hunt" href="http://www.pragprog.com/titles/ahptl/pragmatic-thinking-and-learning">attractiveness is important</a>). I was suspicious of the IDE possibilities out there but I did give a number of them  (<a href="http://www.aptana.com/rails">RadRails</a>, <a href="http://homepage2.nifty.com/sakazuki/rde_en/">RDE</a>, <a href="http://www.eclipse.org/">Eclipse</a>, etc) a quick shot. Suffice to say they all suffered from one or more of the following: being too bloated, waving too many wands and possessing play buttons (I feel a rant coming on&#8230; stifle!).</p>
<p>Enter <a href="http://www.jedit.org/">jEdit</a>. It is a very functional, customizable, extensible, java based editor <strong>and</strong> it looks pretty good to boot. So a couple weeks ago I set it up on both my Windows and Linux installs and so far so good &#8211; it has what I want and does not suffer from the gripes I had with <a href="http://www.e-texteditor.com/">E</a>. One of my favourite features so far (keep in mind its only been a couple weeks) is it&#8217;s <a title="jEdit features" href="http://www.jedit.org/index.php?page=features">&#8220;Hyper Search&#8221;</a> which is a bit like a built in ack.</p>
<p>Currently, I&#8217;m using the following plugins (geared towards ruby/web development):</p>
<ul>
<li>Editor Scheme (for pre-fabricated syntax highlighting schemes)</li>
<li>RubyPlugin</li>
<li>Console</li>
<li>Templates</li>
</ul>
<p>One thing I did have to do in order to get Ruby ERB files to be highlighted properly was to update jEdit&#8217;s &#8220;modes&#8221; <code>catalog</code> file. On my Windows install this was located in <code>C:\Program Files\jEdit\Modes</code> and on Linux it was located in <code>/usr/share/jEdit/modes</code>. My file already contained a reference to an &#8216;rhtml&#8217; mode so I just updated it &#8211; here is the whole mode block:</p>
<pre class="code-block">  &lt;MODE NAME="erb"		FILE="erb.xml"
				FILE_NAME_GLOB="*.{.html.erb,rhtml}" /&gt;</pre>
<p>If you use that you&#8217;ll also need to rename the file <code>rhtml.xml</code> to <code>erb.xml</code> (it will be in the same directory as the catalog file).</p>
<p>As I said I&#8217;ve only been using <a href="http://www.jedit.org/">jEdit</a> for a couple of weeks but thus far I do not have anything negative to report. If that changes I&#8217;ll update this post. In the meantime, if anyone has any comments about jEdit or other options I might have overlooked please let me (and us) know.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=Ruby on Linux with jEdit&amp;url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&title=Ruby on Linux with jEdit' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/&amp;title=Ruby on Linux with jEdit' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=Ruby on Linux with jEdit+http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=66&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/03/02/ruby-on-linux-with-jedit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WP Framework</title>
		<link>http://blog.xambr.com/2009/02/28/wp-framework/</link>
		<comments>http://blog.xambr.com/2009/02/28/wp-framework/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 22:39:16 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Discoveries]]></category>
		<category><![CDATA[blogging]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=36</guid>
		<description><![CDATA[Here is the first peak into that box of stones I mentioned on the about page.
WP Framework is a blank Word Press(WP) theme that you can use to easily setup a your own theme for your WP blog. When I started this blog I debated whether or not I wanted to spend the time putting [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the first peak into that <a href="http://blog.xambr.com/?page_id=4?#stone-box">box of stones</a> I mentioned on the <a href="http://blog.xambr.com/?page_id=4?">about</a> page.</p>
<p><a href="http://wpframework.com/">WP Framework</a> is a blank <a href="http://wordpress.org/">Word Press</a>(WP) theme that you can use to easily setup a your own theme for your <a href="http://wordpress.org/">WP</a> blog. When I started this blog I debated whether or not I wanted to spend the time putting together my own theme – do I want to spend time CSS-ing or writing? In the end I figured to give it a shot thinking that at the very least I would get a little more familiar with this blogging software.</p>
<p>I started by fiddling around with the default <a href="http://wordpress.org/">WP</a> theme but found the results to similar to a well dressed plate having its mashed potatoes with gravy swapped out for rice – things were looking messy. So I googled around a bit and came across the concept of <a href="http://codex.wordpress.org/Theme_Frameworks">WP &#8220;theme frameworks&#8221;</a>. These are basically pre-baked vanilla cakes ready for their icing to be added.</p>
<p>After downloading a few and taking a very quick look around I decided to give <a href="http://wpframework.com/">WP Framework</a> a shot. It seemed to provide the most functional starting position without getting in the way. So a few pleasent hours later here I am with my custom theme. Thanks <a href="http://wpframework.com/">WP Framework</a>.</p>
<p>One thing I did trip over (this isn&#8217;t directly related to <a href="http://wpframework.com/">WP Framework</a> itself)  was the ability to add a &#8220;home&#8221; link to the navigation bar at the top of the page. I confess to not having read any of the <a href="http://codex.wordpress.org/Main_Page">WP</a> or <a href="http://wpframework.com/">WP Framework</a> documentation so I cannot say whether or not it mentions how to do this (my guess is that it does). But for those of you who, like me, tend to skip the docs here is the solution (at least for <a href="http://wordpress.org/">WP 2.7</a>):</p>
<p>There is a PHP method <code>wp_page_menu( $args = array() )</code> in <code>wp-includes/post-template.php</code> which is used to create the navigation links. This method checks the <code>$args</code> array for an option called <code>show_home</code>. If specified it uses this option&#8217;s value for the text of the home page link and if it is not specified (the default) no home page link is displayed.</p>
<p>For this blog I&#8217;m calling that method using:</p>
<pre class="code-block">wp_page_menu( array('show_home'=&gt;'Blog', 'menu_class'=&gt;'nav') );</pre>
<p>I hope this first peak into my box has been useful to you.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.dzone.com/links/add.html?description=WP Framework&amp;url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Save to dzone' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/dzone.png' style='width:16px; height:16px;' alt='[dzone] ' /></a> <a href='http://www.linkedin.com/shareArticle?mini=true&url=http://blog.xambr.com/2009/02/28/wp-framework/&title=WP Framework' title='Share on LinkedIn' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/linkedin.png' style='width:16px; height:16px;' alt='[LinkedIn] ' /></a> <a href='http://reddit.com/submit?url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://blog.xambr.com/2009/02/28/wp-framework/&amp;title=WP Framework' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://twitter.com/home/?status=WP Framework+http://blog.xambr.com/2009/02/28/wp-framework/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://blog.xambr.com/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a>  <a title='See more bookmark and sharing options...' href='http://blog.xambr.com/2009/02/28/wp-framework/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div></div><img src="http://blog.xambr.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=36&amp;ts=1280422996" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/02/28/wp-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
