<?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 &#187; Discoveries</title>
	<atom:link href="http://blog.xambr.com/category/discover/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>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 [...]]]></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>&#8216;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>&#8216;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>
]]></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 [...]]]></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>
]]></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>
]]></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>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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/02/28/wp-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
