<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ruby Inside</title>
	
	<link>http://www.rubyinside.com</link>
	<description />
	<pubDate>Sat, 22 Nov 2008 05:23:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/RubyInside" type="application/rss+xml" /><feedburner:emailServiceId>362021</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>Rails 2.2 Released - 27 Links and Resources To Get You Going</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/461524198/rails-22-released-27-links-and-resources-to-get-you-going-1354.html</link>
		<comments>http://www.rubyinside.com/rails-22-released-27-links-and-resources-to-get-you-going-1354.html#comments</comments>
		<pubDate>Sat, 22 Nov 2008 05:23:12 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Compilation Posts]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/rails-22-released-27-links-and-resources-to-get-you-going-1354.html</guid>
		<description><![CDATA[<p><a href="http://railslogo.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/rails22.png" width="140" height="80" alt="rails22.png" style="float:left; margin-right:12px; margin-bottom:12px;" /></a>Ruby's most popular Web application framework, <a href="http://www.rubyonrails.org/">Ruby on Rails</a>, takes another giant step today with <a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">the release of Rails 2.2!</a> It follows on just five months after Rails 2.1, but offers even more significant improvements, particularly in the areas of compatibility, internationalization, and documentation. Read David Heinemeier Hansson's <a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">release post</a> for a quick overview.</p>
<p>Ruby Inside's sister site, <a href="http://www.railsinside.com/">Rails Inside</a>, was launched alongside Rails 2.1 in June, and would, you'd think, be the ideal place for a post like this, but no. Rails&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://railslogo.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/rails22.png" width="140" height="80" alt="rails22.png" style="float:left; margin-right:12px; margin-bottom:12px;" /></a>Ruby's most popular Web application framework, <a href="http://www.rubyonrails.org/">Ruby on Rails</a>, takes another giant step today with <a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">the release of Rails 2.2!</a> It follows on just five months after Rails 2.1, but offers even more significant improvements, particularly in the areas of compatibility, internationalization, and documentation. Read David Heinemeier Hansson's <a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">release post</a> for a quick overview.</p>
<p>Ruby Inside's sister site, <a href="http://www.railsinside.com/">Rails Inside</a>, was launched alongside Rails 2.1 in June, and would, you'd think, be the ideal place for a post like this, but no. Rails is very significant to the Ruby world as a whole, so you'll still get the biggest of the biggest Rails announcements here on Ruby Inside! If you want more regular Rails-only news, however, go and subscribe to <a href="http://www.railsinside.com/">Rails Inside</a> (<a href="http://feeds.feedburner.com/RailsInside">RSS feed</a> or <a href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=2118199&amp;loc=en_US">e-mail subscription</a>).</p>
<p>As is typical for a big release, we've pooled together a ton of excellent resources, links, and what not, to help you get fully into the Rails 2.2 mindset. So if you've got Rails 2.2 running already or if you're just investigating what it could do for you, read on and investigate some of these resources.</p>
<h3>General Documentation and Guides</h3>
<p><strong>Rails 2.2 Release Notes -</strong> A very solid <a href="http://guides.rubyonrails.org/2_2_release_notes.html">set of release notes for 2.2</a> with basic coverage of the new features (with short code examples and links) as well as a list of deprecated features. They were compiled by Ruby / Rails Inside's very own Mike Gunderloy!</p>
<p><strong>Upgrading RubyGems to 1.3.x -</strong> Depending on your setup, Rails 2.2 may demand that you upgrade to RubyGems 1.3.x. This is not as easy as it might usually be, however. Mike Gunderloy <a href="http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/">gives some tips</a> in case you get stuck.</p>
<p><strong>Rails Security Guide -</strong> Steer clear of security issues in your Rails 2.2 applications by reading the <a href="http://guides.rubyonrails.org/security.html">Ruby on Rails Security Guide</a>. Who said Rails has poor documentation? This is incredible!</p>
<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/envycastrails22.png" width="109" height="68" alt="envycastrails22.png" style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 solid;" /><strong>Rails 2.2 Screencast -</strong> Gregg Pollack and Jason Seifer of Rails Envy put together <a href="http://envycasts.com/products/ruby-on-rails-22-screencast">a very solid Rails 2.2 screencast.</a> It costs $9, but it covers a lot of ground over 44 minutes - learn about etags, connection pooling, new enumerable methods, new test helpers, and more.</p>
<p><strong>Rails 2.2 - What's New -</strong> In association with EnvyCasts, Carlos Brando and Carl Youngblood present <a href="http://envycasts.com/products/ruby-on-rails-22-pdf">Rails 2.2 - What's New</a>, a 118 page PDF covering all of the changes and additions to Rails 2.2. It's available in a <a href="http://envycasts.com/products/ruby-on-rails-22-package-deal">package deal</a> with the screencast (above) too.</p>
<p><strong>InfoQ's Glance -</strong> InfoQ's Mirko Stocker <a href="http://www.infoq.com/news/2008/11/rails-22">takes a quick glance</a> at some of Rails 2.2's new features.</p>
<h3>New Features</h3>
<p><strong>Thread Safety -</strong> Rails 2.2 is now "thread safe." In October, Pratik Naik <a href="http://m.onkey.org/2008/10/23/thread-safety-for-your-rails">wrote a summary of why this is a big deal</a> as well as some gotchas (basically, don't use class variables, use mutexes, etc.) Charles Nutter has also written <a href="http://blog.headius.com/2008/08/qa-what-thread-safe-rails-means.html">What Thread-safe Rails Means</a> which answers several pertinent questions.</p>
<p><strong>Internationalization -</strong> The Rails Internationalization effort has its own homepage at <a href="http://rails-i18n.org/">http://rails-i18n.org/</a> which features lots of links to how-tos, tips, documentation, and demos. They also have <a href="http://groups.google.com/group/rails-i18n">a Google group / mailing list</a> where you can get help, make suggestions, etc.</p>
<p><strong>Basic Language Internationalization -</strong> It's a little old, but <a href="http://almosteffortless.com/2008/07/21/simple-localization-in-rails-22/">Simple Localization in Rails 2.2</a> gives a very quick, code-driven example of how basic internationalization works in Rails 2.2 (some of the set up is easier now, but it mostly applies).</p>
<p><strong>Localization / Internationalization Demo App -</strong> Clemens Kofler has put together <a href="http://i18n-demo.phusion.nl/">a demo app that shows off some of Rails 2.2's internationalization and localization features.</a> If being knee deep in code is the best way for you to learn, jump in!</p>
<p><strong>Gem Dependencies -</strong> You can now <a href="http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies">specify any RubyGem dependencies your Rails app has</a> in <em>environment.rb</em>. This makes it possible to install all of the dependencies for an app with one Rake task!</p>
<p><strong>Layouts for ActionMailer -</strong> As of Rails 2.2, you can now <a href="http://ryandaigle.com/articles/2008/9/7/what-s-new-in-edge-rails-mailer-layouts">use layouts in your ActionMailer views</a>.</p>
<p><strong>Connection Pooling -</strong> The <a href="http://ryandaigle.com/articles/2008/9/7/what-s-new-in-edge-rails-connection-pools">connection pooling</a> in Rails 2.2 allows Rails to distribute database requests across a pool of database connections. This can cause less lockups. In collaboration with a non-blocking MySQL driver, serious performance increases could result in certain situations.</p>
<p><strong>Specify Join Table Conditions with Hashes -</strong> Do you need to run a find (or similar) query across a join? Now you can <a href="http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-easy-join-table-conditions">just specify the conditions for the joined tables in a hash</a>, much like local tables conditions!</p>
<p><strong>Limited Resource Routes -</strong> You can now <a href="http://afreshcup.com/2008/11/12/rails-22-change-limited-resource-routes/">limit <em>map.resources</em> to creating certain methods</a>. For example, you might not want <em>destroy</em> or <em>index</em> methods - you can now specify these with <em>:only</em> and <em>:except</em>.</p>
<p><strong>Memoization -</strong> Stop rolling your own memoization in Rails apps. Clemens Kofler <a href="http://www.railway.at/articles/2008/09/20/a-guide-to-memoization">demonstrates Rails 2.2's newly rolled-in memoization features</a>. It's just a single method! If you have a view that calls on a calculated attribute often, this will give you some serious performance gains.</p>
<p><strong>Custom Length Tokenizer for Validations -</strong> You can now specify <a href="http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-custom-length-validation-tokenizer">a tokenizer of your own construction for <em>validates_length_of</em> validations.</a></p>
<p><strong>Array#second through Array#tenth -</strong> If you're a bad programmer, you can now demonstrate it to the world by using <a href="http://github.com/rails/rails/commit/22af62cf486721ee2e45bb720c42ac2f4121faf4">the new Array#second, Array#third, Array#fourth, and so forth, methods.</a> I've put it in my calendar to look for open source Rails apps using <em>Array#seventh</em> in six months time and to call them out on Rails Inside ;-)</p>
<p><em>Note: This list only takes into account some of the new features in Rails 2.2. There are a lot more! Read the release notes and the Rails 2.2 - What's New PDF to get the full picture.</em></p>
<h3>Miscellaneous</h3>
<p><strong>restful-authentication-i18n -</strong> Want an authentication plugin for Rails 2.2 that supports internationalization? Take a look at <a href="http://github.com/dcrec1/restful-authentication-i18n/tree/master">result-authentication-i18n</a>!</p>
<p><strong>Barebones Apps -</strong> Check out Rails Inside's <a href="http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html">7 Barebones Rails Apps to Kick Start Your Development Process</a>.</p>
<p><strong>Deploying on JBoss -</strong> You can now <a href="http://www.railsinside.com/deployment/156-jboss-on-rails-deploying-rails-apps-to-a-jboss-app-server.html">easily deploy a Rails app to a JBoss server</a>. With Rails 2.2's significantly improved JRuby support, this makes rolling out Rails apps in the enterprise a breeze!</p>
<p><strong>Installing Rails on Ubuntu Hardy Heron -</strong> Simon St Laurent has put together two Rails useful installation videos. One for <a href="http://broadcast.oreilly.com/2008/11/installing-rails-on-ubuntu-har.html">servers</a>, and one for the <a href="http://broadcast.oreilly.com/2008/11/installing-rails-on-hardy-hero.html">desktop</a>.</p>
<p><strong>REST for Rails 2 -</strong> Are you still in Rails 1.x land or not using REST at all? Would you like to? Geoffrey Grosenbach has put together <a href="http://peepcode.com/products/rest-for-rails-2">a screencast showing you how it should be done.</a> <em>(Disclaimer: Peepcode is a sponsor of Ruby Inside.)</em></p>
<p><strong>A Better Rails Logo -</strong> <em><span style="font-style: normal;">The</span></em> <a href="http://railslogo.com/"><em><span style="font-style: normal;">Rails Logo</span></em></a> <em><span style="font-style: normal;">(as used at the head of this post) was created by Kevin Milden and is distrubuted under the</span></em> <a href="http://creativecommons.org/licenses/by-nd/3.0/"><em><span style="font-style: normal;">BY-ND Creative Commons Licence</span></em></a><em><span style="font-style: normal;">. This makes it <a href="http://www.rubyinside.com/david-heinemeier-hansson-says-no-to-use-of-rails-logo-567.html">a lot cooler than the "official" Rails logo which is trademarked</a> and, well, you can't use without getting approval from the top.</span></em></p>
<p><em>Got more? Leave a comment below. On posts like this, the comments get a lot of clicking love from readers eager to learn more - so feel free to promote your own Rails 2.2 related stuff :-)</em></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=y32IwN"><img src="http://feeds.feedburner.com/~a/RubyInside?i=y32IwN" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=X3MPN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=X3MPN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=1Ntrn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=1Ntrn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=ldJJn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=ldJJn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=GHv2n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=GHv2n" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/461524198" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/rails-22-released-27-links-and-resources-to-get-you-going-1354.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/rails-22-released-27-links-and-resources-to-get-you-going-1354.html</feedburner:origLink></item>
		<item>
		<title>HappyMapper: Easy XML / Object Mapping for Rubyists</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/459946419/happymapper-ruby-xml-object-mapping-1349.html</link>
		<comments>http://www.rubyinside.com/happymapper-ruby-xml-object-mapping-1349.html#comments</comments>
		<pubDate>Thu, 20 Nov 2008 20:00:03 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Elsewhere]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/happymapper-ruby-xml-object-mapping-1349.html</guid>
		<description><![CDATA[<p><a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again"><img style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 dotted;" src="http://www.rubyinside.com/wp-content/uploads/2008/11/happy-xml.jpg" alt="happy-xml.jpg" width="137" height="80" /></a> <a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again">HappyMapper</a> is John Nunemaker's attempt at "making XML fun again" for Rubyists by providing an object to XML mapping library with a succinct syntax. Essentially, you can use HappyMapper to rapidly turn XML into Ruby objects - even nesting them inside and referring to each other. This is powerful stuff. To install, just <em>gem install happymapper</em></p>
<p>John's <a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again">own examples</a> are powerful demonstrations of how it works, so check them out. The first is parsing the XML returned from Twitter. The statues and associated&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again"><img style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 dotted;" src="http://www.rubyinside.com/wp-content/uploads/2008/11/happy-xml.jpg" alt="happy-xml.jpg" width="137" height="80" /></a> <a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again">HappyMapper</a> is John Nunemaker's attempt at "making XML fun again" for Rubyists by providing an object to XML mapping library with a succinct syntax. Essentially, you can use HappyMapper to rapidly turn XML into Ruby objects - even nesting them inside and referring to each other. This is powerful stuff. To install, just <em>gem install happymapper</em></p>
<p>John's <a href="http://railstips.org/2008/11/17/happymapper-making-xml-fun-again">own examples</a> are powerful demonstrations of how it works, so check them out. The first is parsing the XML returned from Twitter. The statues and associated users in that XML can be processed (with the relationship maintained) with the following code:</p>
<pre><span class="keyword">class </span><span class="class">User</span>
  <span class="ident">include</span> <span class="constant">HappyMapper</span>

  <span class="ident">element</span> <span class="symbol">:id</span><span class="punct">,</span> <span class="constant">Integer</span>
  <span class="ident">element</span> <span class="symbol">:name</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:screen_name</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:location</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:description</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:profile_image_url</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:url</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:protected</span><span class="punct">,</span> <span class="constant">Boolean</span>
  <span class="ident">element</span> <span class="symbol">:followers_count</span><span class="punct">,</span> <span class="constant">Integer</span>
<span class="keyword">end</span>

<span class="keyword">class </span><span class="class">Status</span>
  <span class="ident">include</span> <span class="constant">HappyMapper</span>

  <span class="ident">element</span> <span class="symbol">:id</span><span class="punct">,</span> <span class="constant">Integer</span>
  <span class="ident">element</span> <span class="symbol">:text</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:created_at</span><span class="punct">,</span> <span class="constant">Time</span>
  <span class="ident">element</span> <span class="symbol">:source</span><span class="punct">,</span> <span class="constant">String</span>
  <span class="ident">element</span> <span class="symbol">:truncated</span><span class="punct">,</span> <span class="constant">Boolean</span>
  <span class="ident">element</span> <span class="symbol">:in_reply_to_status_id</span><span class="punct">,</span> <span class="constant">Integer</span>
  <span class="ident">element</span> <span class="symbol">:in_reply_to_user_id</span><span class="punct">,</span> <span class="constant">Integer</span>
  <span class="ident">element</span> <span class="symbol">:favorited</span><span class="punct">,</span> <span class="constant">Boolean</span>
  <span class="ident">has_one</span> <span class="symbol">:user</span><span class="punct">,</span> <span class="constant">User</span>
<span class="keyword">end</span>

<span class="ident">statuses</span> <span class="punct">=</span> <span class="constant">Status</span><span class="punct">.</span><span class="ident">parse</span><span class="punct">(</span><span class="ident">xml_string</span><span class="punct">)</span>
<span class="ident">statuses</span><span class="punct">.</span><span class="ident">each</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">status</span><span class="punct">|</span>
  <span class="ident">puts</span> <span class="ident">status</span><span class="punct">.</span><span class="ident">user</span><span class="punct">.</span><span class="ident">name</span><span class="punct">,</span> <span class="ident">status</span><span class="punct">.</span><span class="ident">user</span><span class="punct">.</span><span class="ident">screen_name</span><span class="punct">,</span> <span class="ident">status</span><span class="punct">.</span><span class="ident">text</span><span class="punct">,</span> <span class="ident">status</span><span class="punct">.</span><span class="ident">source</span><span class="punct">,</span> <span class="punct">'</span><span class="punct">'</span>
<span class="keyword">end</span></pre>
<p><strong>Added: Or.. how about a similar library that doesn't require naming the elements to work (but then lacks typecasting)? Check out <a href="http://xml-object.rubyforge.org/doc/">xml-object</a> by Jordi Bunster.</strong></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=ZhZgQ7"><img src="http://feeds.feedburner.com/~a/RubyInside?i=ZhZgQ7" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=3XZzN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=3XZzN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=ejbWn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=ejbWn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=BmOvn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=BmOvn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=6nNxn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=6nNxn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/459946419" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/happymapper-ruby-xml-object-mapping-1349.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/happymapper-ruby-xml-object-mapping-1349.html</feedburner:origLink></item>
		<item>
		<title>Cucumber: The Latest in Ruby Testing</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/458738638/cucumber-the-latest-in-ruby-testing-1342.html</link>
		<comments>http://www.rubyinside.com/cucumber-the-latest-in-ruby-testing-1342.html#comments</comments>
		<pubDate>Wed, 19 Nov 2008 19:35:20 +0000</pubDate>
		<dc:creator>Mike Gunderloy</dc:creator>
		
		<category><![CDATA[Tools]]></category>

		<category><![CDATA[bdd]]></category>

		<category><![CDATA[cucumber]]></category>

		<category><![CDATA[rspec]]></category>

		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/?p=1342</guid>
		<description><![CDATA[<p><img class="alignleft size-medium wp-image-1344" src="http://www.rubyinside.com/wp-content/uploads/2008/11/cucumber.png" alt="" width="129" height="91" style="margin: 0px 8px 8px 0px; float: left" />Testing is a firmly ingrained part of the Ruby culture: you probably ran across <a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html">Test::Unit</a> not long after you first started writing Ruby code (though it wouldn't be surprising if you ignored it for a while). But it hasn't been a static part of Ruby - we've seen the simple availability of tests evolve into test-driven development (TDD) that in turn gave rise to behavior-driven development (BDD). Along the way, Ruby has spawned a variety of testing tools and frameworks.<strong> The latest,&#8230;</strong></p>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-1344" src="http://www.rubyinside.com/wp-content/uploads/2008/11/cucumber.png" alt="" width="129" height="91" style="margin: 0px 8px 8px 0px; float: left" />Testing is a firmly ingrained part of the Ruby culture: you probably ran across <a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html">Test::Unit</a> not long after you first started writing Ruby code (though it wouldn't be surprising if you ignored it for a while). But it hasn't been a static part of Ruby - we've seen the simple availability of tests evolve into test-driven development (TDD) that in turn gave rise to behavior-driven development (BDD). Along the way, Ruby has spawned a variety of testing tools and frameworks.<strong> The latest, Aslak Hellesoy's</strong> <strong><a href="http://github.com/aslakhellesoy/cucumber/tree/master">Cucumber</a>, is the latest addition to the RSpec family of tools.</strong></p>
<p><em>Cucumber is designed to allow you to execute feature documentation written in plain text (often known as "stories").</em> I've been experimenting with it as a replacement for integration tests in Rails. With Cucumber, you can write tests that look like this:</p>
<pre><code>
Scenario: See all vendors
    Given I am logged in as a user in the administrator role
    And There are 3 vendors
    When I go to the manage vendors page
    Then I should see the first 3 vendor names
</code></pre>
<p>With Cucumber, that it an executable specification that you can discuss with the customer and then use to verify the correct behavior of tests. Behind the scenes, you make it work by writing "steps," which are regex matchers that execute Ruby code. Here's one of the steps for that scenario:</p>
<pre><span class="constant">Given</span> <span class="punct">/</span><span class="ident">there</span> <span class="ident">are</span> <span class="punct">(\</span><span class="ident">d</span><span class="punct">+)</span> <span class="ident">vendors</span><span class="punct">/</span><span class="ident">i</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">n</span><span class="punct">|</span>
  <span class="constant">Vendor</span><span class="punct">.</span><span class="ident">transaction</span> <span class="keyword">do</span>
    <span class="constant">Vendor</span><span class="punct">.</span><span class="ident">destroy_all</span>
    <span class="ident">n</span><span class="punct">.</span><span class="ident">to_i</span><span class="punct">.</span><span class="ident">times</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">n</span><span class="punct">|</span>
      <span class="constant">Factory</span><span class="punct">.</span><span class="ident">create</span><span class="punct">(</span><span class="symbol">:vendor</span><span class="punct">,</span> <span class="symbol">:business_name</span> <span class="punct">=&gt;</span> <span class="punct">"</span><span class="string">Vendor <span class="expr">#{n}</span></span><span class="punct">")</span>
    <span class="keyword">end</span>
  <span class="keyword">end</span>
<span class="keyword">end</span></pre>
<p>Ideally, you'll do this all in true BDD fashion: write the Cucumber features first, watch them fail, implement code to make them pass (with lower-level tests written with RSpec or Test::Unit), and repeat.</p>
<p>Cucumber is under rapid development, but it's already a useful part of my testing toolbox. In addition to integrating with RSpec and Rails, it works with Merb, Sinatra, and the Webrat web-testing framework (as well as, of course, pure Ruby projects). It also has translations into 20 languages and the ability to run FIT-style tabular tests. If you're looking for a higher level of abstraction in your tests, it's definitely worth checking out.</p>
<p class="s" style="font-family:verdana;font-style:italic;padding:8px;font-size: 12px">Supported by: <strong><a href="http://gearsquare.com/actiongear/">ActionGear</a> is a menu-bar app for task management on your Mac.</strong> It's lightweight, quick, and helps you get stuff done. <strong><a href="http://gearsquare.com/actiongear/">Try it out for free.</a></strong></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=EKNFD6"><img src="http://feeds.feedburner.com/~a/RubyInside?i=EKNFD6" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=qqbjN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=qqbjN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=zjS8n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=zjS8n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=QoUBn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=QoUBn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=DMZVn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=DMZVn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/458738638" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/cucumber-the-latest-in-ruby-testing-1342.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/cucumber-the-latest-in-ruby-testing-1342.html</feedburner:origLink></item>
		<item>
		<title>Scaling Ruby - The Informative, 40 Minute Screencast</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/455446423/scaling-ruby-the-informative-40-minute-screencast-1337.html</link>
		<comments>http://www.rubyinside.com/scaling-ruby-the-informative-40-minute-screencast-1337.html#comments</comments>
		<pubDate>Mon, 17 Nov 2008 01:41:37 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/scaling-ruby-the-informative-40-minute-screencast-1337.html</guid>
		<description><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/ruby18cast.png" width="162" height="122" alt="ruby18cast.png" style="float:left; margin-right:12px; margin-bottom:12px;" />Earlier this month, <a href="http://www.railsenvy.com/">Rails Envy</a>'s Gregg Pollack gave a talk at RubyConf08 called <a href="http://rubyconf.org/talks/2">Scaling Ruby (without the Rails)</a>. He answered questions like "How do existing Ruby applications use Threads/Processes to scale?", "How do we implement an Event Driven application using Ruby EventMachine?", "What are the current bottlenecks with speeding up Ruby and how can they be fixed?", and "What does Ruby 1.9 bring to the table to speed things up?" From what I hear, it was a very well received&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/ruby18cast.png" width="162" height="122" alt="ruby18cast.png" style="float:left; margin-right:12px; margin-bottom:12px;" />Earlier this month, <a href="http://www.railsenvy.com/">Rails Envy</a>'s Gregg Pollack gave a talk at RubyConf08 called <a href="http://rubyconf.org/talks/2">Scaling Ruby (without the Rails)</a>. He answered questions like "How do existing Ruby applications use Threads/Processes to scale?", "How do we implement an Event Driven application using Ruby EventMachine?", "What are the current bottlenecks with speeding up Ruby and how can they be fixed?", and "What does Ruby 1.9 bring to the table to speed things up?" From what I hear, it was a very well received and informative session.</p>
<p>Not all of us could be at RubyConf08, however, so Gregg has taken the whole Ruby scalability topic and put together a solid 40 minute screencast called <a href="http://envycasts.com/products/scaling-ruby">Scaling Ruby</a> <em>(note: it is NOT a recording of the talk - but a separate, professional production)</em>. It costs $9 (cheaper than RubyConf, of course) but it's a very solid primer on Ruby scaling issues. Almost every topic is illustrated through Gregg's unique diagrams, and he goes into depth on topics as diverse as event-based applications, threads, <a href="http://segment7.net/projects/ruby/drb/rinda/ringserver.html">Rinda</a>, process messaging, and even "dropping in to C" to write high performance sections of code.</p>
<p>I've been very impressed with the quality of the EnvyCasts I've seen so far, and this is no exception. Lots of practical knowledge delivered in a memorable way. $9 will still seem too rich to many - especially those who think all forms of documentation and instruction should be free (as in speech and beer) - but if it takes Gregg and Jason's fine commercial attempts to encourage others to produce higher quality, free documentation, I'm all for it! They also have screencasts covering <a href="http://envycasts.com/products/ruby-on-rails-22-screencast">Rails 2.2</a> (see <a href="http://www.railsinside.com/screencasts/137-envy-casts-releases-rails-22-screencast-and-pdf.html">the Rails Inside review</a>) and <a href="http://envycasts.com/products/advanced-activerecord">ActiveRecord</a>.</p>
<p><em>(Disclaimer: I've received free, promotional copies of the EnvyCasts for review. I have no other relationship - financial or otherwise - with the Rails Envy guys, other than being one of the first to</em> <a href="http://www.rubyinside.com/in-depth-acts_as_ferret-tutorial-add-search-to-your-rails-app-391.html"><em>promote them</em></a> <em>back in the day - doesn't time fly!)</em></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=fjCs77"><img src="http://feeds.feedburner.com/~a/RubyInside?i=fjCs77" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=E6jzN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=E6jzN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=P91An"><img src="http://feeds.feedburner.com/~f/RubyInside?i=P91An" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=riIEn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=riIEn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=fAlBn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=fAlBn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/455446423" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/scaling-ruby-the-informative-40-minute-screencast-1337.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/scaling-ruby-the-informative-40-minute-screencast-1337.html</feedburner:origLink></item>
		<item>
		<title>Ruby Best Practices: The Book and Interview with Gregory Brown</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/453044287/ruby-best-practices-gregory-brown-interview-1332.html</link>
		<comments>http://www.rubyinside.com/ruby-best-practices-gregory-brown-interview-1332.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 15:42:45 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Interviews]]></category>

		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[News]]></category>

		<category><![CDATA[Reference]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/ruby-best-practices-gregory-brown-interview-1332.html</guid>
		<description><![CDATA[<p><a href="http://oreilly.com/catalog/9780596156749/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/ruby-best-practices.gif" width="116" height="152" alt="ruby-best-practices.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /></a>Back in March, Ruby developer Gregory Brown <a href="http://www.rubyinside.com/help-fund-a-ruby-developer-to-work-on-open-source-for-6-months-798.html">raised the idea</a> of receiving donations so he could work on open source Ruby projects full-time. It went well, and out of this project came <a href="http://www.rubyinside.com/prawn-ruby-pdf-library-987.html">Prawn, a pure Ruby PDF generation library</a>. Not one to rest on his laurels, Gregory's now working on a book for O'Reilly called <a href="http://oreilly.com/catalog/9780596156749/">Ruby Best Practices</a>, billed as "for programmers who want to use Ruby the way Rubyists do." The book will cover how to design "beautiful" APIs and&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://oreilly.com/catalog/9780596156749/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/ruby-best-practices.gif" width="116" height="152" alt="ruby-best-practices.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /></a>Back in March, Ruby developer Gregory Brown <a href="http://www.rubyinside.com/help-fund-a-ruby-developer-to-work-on-open-source-for-6-months-798.html">raised the idea</a> of receiving donations so he could work on open source Ruby projects full-time. It went well, and out of this project came <a href="http://www.rubyinside.com/prawn-ruby-pdf-library-987.html">Prawn, a pure Ruby PDF generation library</a>. Not one to rest on his laurels, Gregory's now working on a book for O'Reilly called <a href="http://oreilly.com/catalog/9780596156749/">Ruby Best Practices</a>, billed as "for programmers who want to use Ruby the way Rubyists do." The book will cover how to design "beautiful" APIs and DSLs, along with lots of other general topics that will make your code more expressive and make you a better Ruby developer into the bargain.</p>
<p>The book is not due for final release until <em>August 2009</em>, but thanks to O'Reilly's "Rough Cuts" program, the first three chapters (<em>Driving Code Through Tests</em>, <em>Designing Beautiful APIs</em>, and <em>Text Processing and File Management</em>) are already available. Online-only access is $17.99 and you'll get the latest version as it becomes available. Print-only and Print + Online bundles are also available.</p>
<p>Gregory gave me a copy of the first three chapters to look over, and they're well crafted. This definitely isn't a reference book, a "cook book" or any sort of book you merely "dip" into. It's designed to be read by the chapter. The first chapter, Driving Code Through Tests, for example, takes you on a journey through the world of testing in Rubyland from motivation through to best practices - it's a full introduction to a single topic.</p>
<h3>The Interview</h3>
<p>I decided to ask Gregory a few questions to get more background on the book, as well as an update on his Ruby Mendicant project:</p>
<p><strong>What was the inspiration for writing Ruby Best Practices?</strong></p>
<blockquote>
<p>Right now, it's entirely possible for one to learn enough Ruby to get by without ever understanding why people love the language. I think one reason is that our books have disproportionately emphasized on solving particular problems, via some recipe or pattern. We've also got a ton of introductions to the language, some better than others, but these books don't dive into code that looks or feels real. Our reference books are great (at least IMO), but they're only telling you what sharp tools are in the shed, not how to use them.</p>
<p>Ruby Best Practices is a book about why Rubyists tend to write Ruby the way they do. So this book looks at a lot of real code, most of it from open source projects, and tries to make it approachable to any reader who's got a reference book handy, so long as their willing to engage their brain a bit. I'm hoping that people will have fun learning a bit more about the 'why' behind a lot of the design decisions we face when writing code.</p>
</blockquote>
<p><strong>Does the rapid pace of change in the Ruby community makes writing a book like this more difficult?</strong></p>
<blockquote>
<p>I think change is generally good, and that folks who wish to live on the edge must be willing to pay the price. There's nothing wrong with using older versions of software if you're not ready to make the jump to the new hotness of the week.</p>
<p>However, I want this book to be current when it prints, and I also want to help encourage people to move forward, so I've been writing against Ruby 1.9.1 only. Because the only place 1.8 is mentioned is in my chapter on how to write backwards-compatible code, I don't have the pain that most people do with updating their notes constantly about changes in 1.9 vs 1.8. I just need to make sure my code keeps running properly on 1.9.1 until the time the book is released. There are hiccups from time to time, but I've definitely been in less pain than anyone who's trying to write a reference book right now.</p>
</blockquote>
<p><strong>What sort of developer should be buying this book right now?</strong></p>
<blockquote>
<p>I think that any developer who has worked through some introductory Ruby material and has a reference book handy can learn something from RBP. I've got a couple internal reviewers who are in exactly that position, so they help keep that target audience in range.</p>
<p>However, in terms of the Rough Cuts release, <strong>what I need most is folks who are fairly strong in idiomatic Ruby to pick up a copy and help correct me where I am wrong.</strong> I put together a great team of internal reviewers who check every chapter before it becomes public, but more eyes will surely help shape the book before it hits the shelves.</p>
<p>I definitely want the book to have the kind of authority that comes from extensive peer review instead of having people trust it based on name recognition. If people provide feedback through Rough Cuts, I think it'll be easier to accomplish that goal.</p>
</blockquote>
<p><strong>How is the Ruby Mendicant project going?</strong></p>
<blockquote>
<p>The Ruby Mendicant project officially ended on September 30th, two weeks after the scheduled end-date. However, I'm still actively working on Prawn and will continue to move things forward over the coming months. I came up a little short of the hours I initially pledged, but accomplished most of the goals I had in mind. We're getting closer and closer to providing a replacement for PDF::Writer, and many users have already made the jump.</p>
<p>I gave <a href="http://majesticseacreature.com/talks/rubyconf08.html">a talk on Ruby Mendicant / Prawn at RubyConf</a>, and it's probably the best summary I've done so far, which people could check out once Confreaks gets the video online. I also plan to write a post-mortem about the whole experience but haven't found time just yet. I'll link it on that talk page once it's available.</p>
</blockquote>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=yJcTQZ"><img src="http://feeds.feedburner.com/~a/RubyInside?i=yJcTQZ" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=MATEN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=MATEN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=JUFPn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=JUFPn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=hoAKn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=hoAKn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=EsjBn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=EsjBn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/453044287" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/ruby-best-practices-gregory-brown-interview-1332.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/ruby-best-practices-gregory-brown-interview-1332.html</feedburner:origLink></item>
		<item>
		<title>Roxy - An Object Proxying Library for Ruby</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/451987314/roxy-ruby-object-proxying-1328.html</link>
		<comments>http://www.rubyinside.com/roxy-ruby-object-proxying-1328.html#comments</comments>
		<pubDate>Thu, 13 Nov 2008 17:10:46 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Ruby Tricks]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/roxy-ruby-object-proxying-1328.html</guid>
		<description><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/roxy-new.png" width="137" height="137" alt="roxy-new.png" style="float:left; margin-right:12px; margin-bottom:12px;" />When you want your objects to refer to / have associations with other objects, it can quickly become a complex procedure. Ryan Daigle to the rescue! Ryan has built <a href="http://github.com/yfactorial/roxy/tree/master">Roxy</a>, a "Ruby Proxy-Object Library." He's also put together <a href="http://ryandaigle.com/articles/2008/11/10/implement-ruby-proxy-objects-with-roxy">an awesome blog post</a> with the motivation for developing Roxy and some code examples showing how it works. Roxy gives you the ability to add some rather ActiveRecord-esque functionality to your classes and their instances.</p>
<p>Straight from the horse's mouth:</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/roxy-new.png" width="137" height="137" alt="roxy-new.png" style="float:left; margin-right:12px; margin-bottom:12px;" />When you want your objects to refer to / have associations with other objects, it can quickly become a complex procedure. Ryan Daigle to the rescue! Ryan has built <a href="http://github.com/yfactorial/roxy/tree/master">Roxy</a>, a "Ruby Proxy-Object Library." He's also put together <a href="http://ryandaigle.com/articles/2008/11/10/implement-ruby-proxy-objects-with-roxy">an awesome blog post</a> with the motivation for developing Roxy and some code examples showing how it works. Roxy gives you the ability to add some rather ActiveRecord-esque functionality to your classes and their instances.</p>
<p>Straight from the horse's mouth:</p>
<blockquote>
<p>Roxy is a basic proxy library that lets you quickly create proxies between your ruby objects. Its syntax is loosely based on Association Extensions in ActiveRecord as that is a well-known use of proxies.</p>
</blockquote>
<p>Still not convinced to jump straight over to <a href="http://ryandaigle.com/articles/2008/11/10/implement-ruby-proxy-objects-with-roxy">Ryan's blog post</a>? Code example coming up in 3..2..1..:</p>
<pre><span class="keyword">class </span><span class="class">Person</span>
  <span class="ident">include</span> <span class="constant">Roxy</span><span class="punct">::</span><span class="constant">Moxie</span>    

  <span class="ident">attr_accessor</span> <span class="symbol">:first</span><span class="punct">,</span> <span class="symbol">:last</span><span class="punct">,</span> <span class="symbol">:parents</span> 

  <span class="ident">proxy</span> <span class="symbol">:parents</span> <span class="keyword">do</span>
    <span class="keyword">def </span><span class="method">divorced?</span>
      <span class="ident">proxy_target</span><span class="punct">.</span><span class="ident">size</span> <span class="punct">></span> <span class="number">1</span> <span class="keyword">and</span> <span class="ident">proxy_target</span><span class="punct">.</span><span class="ident">collect</span> <span class="punct">{</span> <span class="punct">|</span><span class="ident">parent</span><span class="punct">|</span> <span class="ident">parent</span><span class="punct">.</span><span class="ident">last</span> <span class="punct">}.</span><span class="ident">uniq</span><span class="punct">.</span><span class="ident">size</span> <span class="punct">></span> <span class="number">1</span>
    <span class="keyword">end</span>
  <span class="keyword">end</span>
<span class="keyword">end</span>

<span class="comment"># Can then invoke your proxy methods directly on parents</span>
<span class="ident">person</span><span class="punct">.</span><span class="ident">parents</span><span class="punct">.</span><span class="ident">divorced?</span></pre>
<p class="s" style="font-family:verdana;font-style:italic;padding:8px;font-size: 12px">Supported by: <strong><a href="http://gearsquare.com/actiongear/">ActionGear</a> is a menu-bar app for task management on your Mac.</strong> It's lightweight, quick, and helps you get stuff done. <strong><a href="http://gearsquare.com/actiongear/">Try it out for free.</a></strong></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=YtrEZD"><img src="http://feeds.feedburner.com/~a/RubyInside?i=YtrEZD" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=Ft98N"><img src="http://feeds.feedburner.com/~f/RubyInside?i=Ft98N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=wuyin"><img src="http://feeds.feedburner.com/~f/RubyInside?i=wuyin" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=VYG9n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=VYG9n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=YFr4n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=YFr4n" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/451987314" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/roxy-ruby-object-proxying-1328.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/roxy-ruby-object-proxying-1328.html</feedburner:origLink></item>
		<item>
		<title>Easy Git External Dependency Management with Giternal</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/450756364/giternal-easy-git-external-dependency-management-1322.html</link>
		<comments>http://www.rubyinside.com/giternal-easy-git-external-dependency-management-1322.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 14:46:43 +0000</pubDate>
		<dc:creator>Mike Gunderloy</dc:creator>
		
		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/?p=1322</guid>
		<description><![CDATA[<p><img class="size-medium wp-image-1324" src="http://www.rubyinside.com/wp-content/uploads/2008/11/icicles3jpg-jpeg-image-472x400-pixels.png" alt="icicles" width="145" height="198" style="float: left; margin: 0px 12px 12px 0px" />Anyone building up a project with many dependencies - and in the Ruby community, with so much functionality wrapped up in gems and plugins, it's hard to imagine not having external dependencies! - must face the issue of managing the situation in source code control. How do you maintain everything you need in your own repository, while still being able to update your dependencies from their own repository? How do you set things up so you can even contribute to&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-1324" src="http://www.rubyinside.com/wp-content/uploads/2008/11/icicles3jpg-jpeg-image-472x400-pixels.png" alt="icicles" width="145" height="198" style="float: left; margin: 0px 12px 12px 0px" />Anyone building up a project with many dependencies - and in the Ruby community, with so much functionality wrapped up in gems and plugins, it's hard to imagine not having external dependencies! - must face the issue of managing the situation in source code control. How do you maintain everything you need in your own repository, while still being able to update your dependencies from their own repository? How do you set things up so you can even contribute to the projects you depend on?</p>
<p>If you're using <a href="http://git.or.cz/">git</a>, the right answer is often the <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html">subtree merge strategy</a> - but remembering the necessary commands can be a nuisance, especially if you rarely use them. There are several projects out there designed to make this easier for you: Tim Dysinger published some <a href="http://dysinger.net/2008/04/29/replacing-braid-or-piston-for-git-with-40-lines-of-rake/">rake tasks</a> to handle subtrees, and <a href="http://github.com/evilchelu/braid/wikis/home">Braid</a> is a more full-featured tool to manage both git- and svn-based vendor branches. 37signals have also released <a href="http://github.com/37signals/cached_externals/tree/master">cached_externals</a> which provides a somewhat different solution to the problem using symbolic links and separated checkouts.</p>
<p>After trying all of those approaches, though, I've settled on Pat Maddox's <a href="http://github.com/pat-maddox/giternal/tree/master">giternal</a> tool for my own work. With giternal, you add a YAML file with details on your project's dependencies, similar to this:</p>
<pre>
<span class="ident">delayed_job</span><span class="punct">:</span>
<span class="ident">&nbsp;&nbsp;repo</span><span class="punct">:</span> <span class="ident">git</span><span class="punct">:/</span><span class="punct">/</span><span class="ident">github</span><span class="punct">.</span><span class="ident">com</span><span class="punct">/</span><span class="ident">tobi</span><span class="punct">/</span><span class="ident">delayed_job</span><span class="punct">.</span><span class="ident">git</span>
<span class="ident">&nbsp;&nbsp;path</span><span class="punct">:</span> <span class="ident">vendor</span><span class="punct">/</span><span class="ident">plugins</span>
<span class="ident">paperclip</span><span class="punct">:</span>
<span class="ident">&nbsp;&nbsp;repo</span><span class="punct">:</span> <span class="ident">git</span><span class="punct">:/</span><span class="punct">/</span><span class="ident">github</span><span class="punct">.</span><span class="ident">com</span><span class="punct">/</span><span class="ident">thoughtbot</span><span class="punct">/</span><span class="ident">paperclip</span><span class="punct">.</span><span class="ident">git</span>
<span class="ident">&nbsp;&nbsp;path</span><span class="punct">:</span> <span class="ident">vendor</span><span class="punct">/</span><span class="ident">plugins</span>
</pre>
<p>After that, there are just three commands to remember: <code>giternal update</code> to update all of your dependencies, <code>giternal freeze</code> to create a self-contained deploy tag with all externals at a known version, and <code>giternal unfreeze</code> to go back to live subtrees. If you've been shying away from dealing with externals in your git repositories, give it a shot.</p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=TbZI2p"><img src="http://feeds.feedburner.com/~a/RubyInside?i=TbZI2p" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=UZrRN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=UZrRN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=4Z7En"><img src="http://feeds.feedburner.com/~f/RubyInside?i=4Z7En" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=bJPgn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=bJPgn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=4lXPn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=4lXPn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/450756364" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/giternal-easy-git-external-dependency-management-1322.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/giternal-easy-git-external-dependency-management-1322.html</feedburner:origLink></item>
		<item>
		<title>Merb 1.0 Released So Here’s 44 Links and Resources To Get You Going</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/446841073/44-merb-resources-1318.html</link>
		<comments>http://www.rubyinside.com/44-merb-resources-1318.html#comments</comments>
		<pubDate>Sat, 08 Nov 2008 21:14:17 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[Compilation Posts]]></category>

		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Elsewhere]]></category>

		<category><![CDATA[News]]></category>

		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/44-merb-resources-1318.html</guid>
		<description><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/merb.png" width="137" height="55" alt="merb.png" style="float:left; margin-right:12px; margin-bottom:12px;" /><a href="http://www.merbivore.com/">Merb</a> - a much heralded, highly flexible Ruby-based Web application framework - has <a href="http://brainspl.at/articles/2008/11/08/merb-1-0">reached version 1.0</a> after two years of development. Congratulations to Merb's creator, Ezra Zygmuntowicz, and to the large group of associated developers (such as Yehuda Katz and Matt Aimonetti) who've kept adding features and pushed Merb forward to be a significant alternative to Rails.</p>
<p>Ruby Inside has been some surveys for the past couple of months, and they still show that only 25% of Ruby Inside's visitors have ever developed&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/merb.png" width="137" height="55" alt="merb.png" style="float:left; margin-right:12px; margin-bottom:12px;" /><a href="http://www.merbivore.com/">Merb</a> - a much heralded, highly flexible Ruby-based Web application framework - has <a href="http://brainspl.at/articles/2008/11/08/merb-1-0">reached version 1.0</a> after two years of development. Congratulations to Merb's creator, Ezra Zygmuntowicz, and to the large group of associated developers (such as Yehuda Katz and Matt Aimonetti) who've kept adding features and pushed Merb forward to be a significant alternative to Rails.</p>
<p>Ruby Inside has been some surveys for the past couple of months, and they still show that only 25% of Ruby Inside's visitors have ever developed a Merb application. With the stability that the 1.0 release offers (older versions of Merb had a reputation - fair or not - for a constantly shifting API), it's now a great time to give Merb a try. It's also a great time to get into writing tutorials and documentation!</p>
<h3>Quick Start</h3>
<p>Install Merb from Rubyforge: <span style="font-family: -webkit-monospace;">gem install merb</span></p>
<p>If you'd rather go from Merb's "edge" repository: <span style="font-family: -webkit-monospace;">gem install merb --source http://edge.merbivore.com</span></p>
<blockquote>
<p>NOTE: Make sure that you are running RubyGems 1.3.0 or higher (run <code>gem -v</code> to check). If not, you need to upgrade (I found <a href="http://www.ruby-forum.com/topic/166853#732427">this page</a> very useful for doing that.</p>
</blockquote>
<p>Then follow a tutorial such as <a href="http://merb.4ninjas.org/">Life On The Edge with Merb, DataMapper &amp; RSpec</a>, <a href="http://www.socialface.com/slapp/">Slapp: A Simple Chat Wall Merb Tutorial</a> or <a href="http://www.devx.com/webdev/Article/39735">Move Over Rails. Here Comes Merb.</a></p>
<p>Once you're ready to roll, bookmark this page for safe keeping and read on for our Merb resources! We've divided them up into sections to make it easier. Some will also be left in the comments by other readers!</p>
<h3>Merb News and Community Sites</h3>
<div style="margin-left: 1.5em">
<p><a href="http://merbunity.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/merbunity.png" width="137" height="37" alt="merbunity.png" style="margin-right:12px;" /></a></p>
<p><a href="http://merbunity.com/"><strong>Merbunity</strong></a> - A community news site that focuses entirely on Merb. So far it's not been updated particularly often, but this is likely to change, and what they do have is great.</p>
<p><a href="http://www.merbivore.com/"><strong>Merbivore</strong></a> - The official Merb homepage. It provides links to all of the major things you'd need - <a href="http://merbivore.com/documentation.html">docs</a>, a wiki, downloads, and information on how to help the Merb project.</p>
<p><a href="http://merboverheard.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/merboverheard.png" width="137" height="33" alt="merboverheard.png" style="margin-right:12px;" /></a></p>
<p><a href="http://merboverheard.com/"><strong>Merb Overheard</strong></a> - A "planet" / aggregation blog for Merb related content. It also features some of the latest Merb related Twitter messages. A good looking site and well worth following if you want to stay up to date on Merb news.</p>
<p><a href="http://planet.merbivore.com/"><strong>Planet Merb</strong></a> - A "planet" site for Merb-related blogs. Currently only has the blogs of several Merb developers and the official Merb blog, but it's bound to grow over time.</p>
<p><a href="http://merbist.com/"><strong>The Merbist</strong></a> - A Ruby Inside-esque blog for the Merb world. It's run by Matt Aimonetti, a Merb core team member. Well worth subscribing to if you want a look at high level news related to Merb.</p>
<p><a href="http://groups.google.com/group/merb"><strong>Merb Google Group</strong></a> - A Google Groups hosted mailing list for Merb developers. It has over 800 members and is pretty busy!</p>
<p><span style="font-family: -webkit-monospace;">#merb on irc.freenode.net</span> - Not a Web link, but an IRC channel. If you want to chat live about Merb but aren't familiar with IRC, learn more <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">here</a>.</p>
<p><a href="http://brainspl.at/"><strong>Ezra Zygmuntowicz's Brainspl.at</strong></a> - The personal blog of Merb creator, Ezra Zugmuntowicz. A lot of it is Merb related in some way or another.</p>
<p><a href="http://yehudakatz.com/"><strong>Katz Got Your Tongue?</strong></a> - The personal blog of Yehuda Katz, a key Merb developer and evangelist. A lot of Merb related posts.</p>
</div>
<h3>Merb Tutorials and Documentation</h3>
<div style="margin-left: 1.5em">
<p><em><strong>Note that some tutorials may be slightly out of date</strong> or use features that have changed in Merb 1.0. Use these tutorials as a guide, not as canon (for that, you'll want a book, see next section).</em></p>
<p><a href="http://merb.4ninjas.org/"><strong>The Merb Book: Life On The Edge With Merb, Datamapper &amp; RSpec</strong></a> - An online book started by the guys of London development team, New Bamboo, but now contributed to by many Merb developers. It's very indepth and changing over time. There's definitely no lack of detail here.</p>
<p><a href="http://rorblog.techcfl.com/2008/02/01/merborial-getting-started-with-merb-and-datamapper/"><strong>Merborial: Getting Started with Merb and DataMapper</strong></a> - A simple and straightforward tutorial by Chris Kaukis.</p>
<p><a href="http://www.devx.com/webdev/Article/39735"><strong>Move Over Rails. Here Comes Merb.</strong></a> - A tutorial by Mark Watson that demonstrates how to create a "planet" type Ruby blog aggregator using Merb. Very complete - doesn't include Ruby Inside though? Heresy!</p>
<p><a href="http://dev.strawberrydiva.com/relax_with_merb_and_couchdb/"><strong>Relax with Merb and CouchDB</strong></a> - A very clean and to the point guide by Paul Carey on developing a Merb application that uses CouchDB for the DB backend (using RelaxDB).</p>
<p><a href="http://jit.nuance9.com/2008/02/merb-faqs-environment-variables.html"><strong>7 Merb Questions Answered</strong></a> - Justin Pease answers some Merb related questions. How to access environment variables, partial rendering, how to use HAML, how to start in production mode, how to log data, and how to get the current URL in a view.</p>
<p><a href="http://www.socialface.com/slapp/"><strong>Slapp: A Simple Chat Wall Merb Tutorial</strong></a> - SocialFace presents a great tutorial on how to use Merb to develop a basic "chat wall" application. If you'd rather just look at the resulting code, check out <a href="http://gitorious.org/projects/slapp/repos/mainline">the Slapp Git repository</a>.</p>
<p><a href="http://www.rubyinside.com/merb-shoes-interesting-web-gui-app-crossovers-691.html"><strong>Merb + Shoes = Interesting Web / GUI App Crossovers</strong></a> - Gregory Brown and Brad Ediger wrote a six page tutorial on how to develop a cross-platform GUI app using Shoes and Merb on the backend.</p>
<p><a href="http://atmos.org/index.php/2008/10/19/multi-environment-merbdm-deployment-with-vladgit/"><strong>Multi Environment Merb+DM Deployment with Vlad+Git</strong></a> - Corey Donohoe (a.k.a. atmos) demonstrates how to use Vlad and Git to deploy your Merb apps.</p>
<p><a href="http://merbcamp.com/video"><strong>MerbCamp Videos</strong></a> - Videos of all of the main sessions from MerbCamp. Lots of awesome stuff to watch here on how to write Merb plugins, how to deploy a Merb app, Merb primers, DataMapper tutorial sessions, how to migrate from Rails to Merb, and more!</p>
<p><a href="http://merbunity.com/tutorials/19"><strong>MerbAuth - The Basics</strong></a> - An excellent overview of the MerbAuth authentication framework and how to use it to perform authentication in your Merb app.</p>
</div>
<h3>Merb Books</h3>
<div style="margin-left: 1.5em">
<p><a href="http://www.manning.com/ivey/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/mia.png" width="137" height="167" alt="mia.png" style="margin-right:12px;" /></a></p>
<p><a href="http://www.manning.com/ivey/"><strong>Merb in Action</strong></a> - A general Merb book being written by Michael Ivey, Yehuda Katz, and Ezra Zygmuntowicz. It's not due out in print till May 2009, but so far three chapters are available in PDF form via an "Early Access Edition" right now. With the soldier on the cover, I guarantee this will end up being called the "MIA" or "Soldier" book :)</p>
<p><a href="http://blog.obiefernandez.com/content/2008/08/announcing-the-merb-way-by-foy-savas.html"><strong>The Merb Way</strong></a> - Following in the mold of the awesome <em>The Ruby Way</em> and <em>The Rails Way</em> books will come <em>The Merb Way</em> by Foy Savas. Publishing date is still uncertain, but likely to be next year. Given the history of Addison Wesley's <em>* Way</em> series, I expect this will be a gigantic reference book spilling out all of the guts of Merb for us to see and enjoy.</p>
<p><a href="http://www.amazon.com/Beginning-Merb-Replacing-Framework-Datamapper/dp/1430218231/"><strong>Beginning Merb</strong></a> - Apress continue their Beginning * series with a Merb entry. Due out in February 2009, it'll be about 500 pages in length.</p>
</div>
<h3>Merb Sample Apps</h3>
<div style="margin-left: 1.5em">
<p><strong><span style="font-weight: normal;"><a href="http://github.com/mleung/feather/wikis"><strong>Feather</strong></a> - An "uber lightweight" Merb blogging engine / system. A blog is always a great app to take inspiration from :)</span><br /></strong></p>
<p><strong><a href="http://pandastream.com/">Panda: Open source video platform</a></strong> - An open source video transcoding and streaming platform built mostly around a Merb app.</p>
<p><a href="http://pmpknpi.com/"><strong>PmpknPi</strong></a> - A RESTful Blog API written in Merb.</p>
<p><a href="http://gitorious.org/projects/slapp/repos/mainline"><strong>Slapp</strong></a> - A "chat wall" Web app.</p>
<p><a href="http://github.com/atmos/merb-openid-example/tree/master"><strong>Merb-OpenID-Example</strong></a> - An example OpenID consumer application written in Merb using merb-auth's OpenID functionality.</p>
<p><a href="http://github.com/myabc/merb_mart/tree/master"><strong>merb_mart</strong></a> - An open source e-commerce engine built on Merb.</p>
<p><a href="http://github.com/stevebartholomew/merb-dm-couchdb-sample/tree/master"><strong>merb-dm-couchdb-sample</strong></a> - A quick sample application showing how to use CouchDB with a Merb / DataMapper app.</p>
</div>
<h3>Merb Events</h3>
<div style="margin-left: 1.5em">
<p><a href="http://merbcamp.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/merbcamp.png" width="137" height="74" alt="merbcamp.png" style="margin-right:12px;" /></a></p>
<p><a href="http://merbcamp.com/"><strong>MerbCamp</strong></a> - MerbCamp was the first official gathering for the Merb community, but it's likely to happen again next year, so make sure you keep your eyes peeled for it. Also be sure to watch <a href="http://merbcamp.com/video">the videos of the MerbCamp presentations</a>.</p>
<p><a href="http://atlanta.merbday.com/"><strong>MerbDay</strong></a> - A Merb event taking place in Atlanta on December 6. Yehuda Katz will be speaking.</p>
<p><a href="http://www.merboutpost.com/"><strong>Merb Outpost</strong></a> - A London based "outpost" of MerbCamp where 29 Merbists watched MerbCamp on a live webfeed. I'd be surprised if they didn't try to revive this for the next MerbCamp. If you're in London and want to be in contact with other local Merbists, however, get on there and check them out.</p>
</div>
<h3>Merb Miscellaneous</h3>
<div style="margin-left: 1.5em">
<p><a href="http://blog.fiveruns.com/2008/10/11/fiveruns-tuneup-for-merb"><strong>FiveRuns TuneUp for Merb</strong></a> - FiveRuns is a leading provider of monitoring and development products for Ruby on Rails and other popular open source and commercial systems. They've got a version of their performance tuning and debugging tool, TuneUp, available for Merb developers.</p>
<p><a href="http://www.youtube.com/watch?v=TcMklv40YMY"><strong>Google Tech Talk: Merb, Rubinius and the Engine Yard Stack</strong></a> - Ezra Zygmuntowicz gave a tech talk to Googlers on Merb and Rubinius. This is very new and well worth watching for its full 47 minutes.</p>
<p><a href="http://brainspl.at/articles/2007/12/02/a-quick-jaunt-through-merbs-framework-code"><strong>A Quick Jaunt Through Merb's Framework Code</strong></a> - Ezra Zygmuntowicz presents a tutorial for those who want to see how a request travels through the Merb framework in its quest to get a proper response. Some nice indepth stuff here.</p>
<p><a href="http://rubypond.com/articles/2008/10/11/merbcamp---notes-from-the-edge/"><strong>Merbcamp - notes from the edge</strong></a> - Some excellent notes taken based on what happened at Merbcamp.</p>
<p><a href="http://github.com/binarylogic/authlogic/tree/master"><strong>Authlogic</strong></a> - A framework agnostic authentication system that works well with Merb. Get awesome authentication on your Merb app - fast.</p>
<p><a href="http://rubyforge.org/projects/merb/"><strong>Merb on RubyForge</strong></a> - All of the Merb libraries and gems directly from RubyForge.</p>
<p><a href="http://github.com/wycats/merb/tree/master"><strong>Merb on Github</strong></a> - All of the Merb libraries collectively within a Git repository on Github.</p>
<p><a href="http://datamapper.org/"><strong>DataMapper</strong></a> - While Merb forces no specific ORM on you, DataMapper has become the <em>de facto</em> standard when developing Merb applications. Learn more about it here.</p>
<p><a href="http://github.com/drnic/merb-tmbundle/tree/master"><strong>Merb TextMate bundle</strong></a> - A Merb bundle for TextMate by Dr Nic Williams.</p>
<p><a href="http://github.com/myabc/merb_global/tree/master"><strong>Merb_global</strong></a> - Localization and internationalization support for Merb. Experimental.</p>
<p><a href="http://github.com/david/merb_cucumber/tree/master"><strong>merb_cucumber</strong></a> - A library offering <a href="http://github.com/aslakhellesoy/cucumber/tree/master">Cucumber</a> (a BDD testing tool) integration with Merb.</p>
<p><a href="http://www.rubyinside.com/merb-tutorials-and-resources-716.html"><strong>21 Merb Links, Tutorials and Other Resources</strong></a> - A set of Merb resources on Ruby Inside from February! Might still be some stuff worth checking out in there. It's a real bran tub of Merb delights.</p>
<p><a href="http://antoniocangiano.com/2008/01/15/why-engine-yard-rubinius-and-merb-matter/"><strong>Why Engine Yard, Rubinius and Merb Matter</strong></a> - Antonio Cangiano looks at some of the motivation behind Engine Yard's progress on Merb and Rubinius.</p>
</div>
<p><em>Got any more Merb resources? Please leave a comment!</em></p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=kk9UdF"><img src="http://feeds.feedburner.com/~a/RubyInside?i=kk9UdF" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=wEvuN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=wEvuN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=ZdQpn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=ZdQpn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=on5Zn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=on5Zn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=8EE4n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=8EE4n" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/446841073" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/44-merb-resources-1318.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/44-merb-resources-1318.html</feedburner:origLink></item>
		<item>
		<title>3 Tools for DRYing Your Ruby Code</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/445894806/3-tools-for-drying-your-ruby-code-1305.html</link>
		<comments>http://www.rubyinside.com/3-tools-for-drying-your-ruby-code-1305.html#comments</comments>
		<pubDate>Fri, 07 Nov 2008 21:03:01 +0000</pubDate>
		<dc:creator>Mike Gunderloy</dc:creator>
		
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/?p=1305</guid>
		<description><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/hercules-and-atlas.gif" width="137" height="143" alt="hercules-and-atlas.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /> We've all heard the admonitions: "Don't Repeat Yourself!" But how do you avoid this if you're working on a Ruby codebase that stretches to thousands of lines, maintained by multiple developers? One answer is to run a tool that looks for duplicate code. This is an area where good tools are tantalizingly close - there are at least three out there that are worth checking out:</p>
<h3>Towelie</h3>
<p>The first contender is Giles Bowkett's <a href="http://github.com/gilesbowkett/towelie/tree">Towelie</a>, which uses <a href="http://rubyforge.org/projects/parsetree/">parsetree</a> and ruby2ruby to look through a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/hercules-and-atlas.gif" width="137" height="143" alt="hercules-and-atlas.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /> We've all heard the admonitions: "Don't Repeat Yourself!" But how do you avoid this if you're working on a Ruby codebase that stretches to thousands of lines, maintained by multiple developers? One answer is to run a tool that looks for duplicate code. This is an area where good tools are tantalizingly close - there are at least three out there that are worth checking out:</p>
<h3>Towelie</h3>
<p>The first contender is Giles Bowkett's <a href="http://github.com/gilesbowkett/towelie/tree">Towelie</a>, which uses <a href="http://rubyforge.org/projects/parsetree/">parsetree</a> and ruby2ruby to look through a set of files searching for duplicates. Unfortunately, Towelie in its current state was unable to handle my test case (the Active Record subtree of Rails), persistently erroring somewhere in parsetree. Admittedly, ActiveRecord is an extremely large and often arcane code base - though yours may be also.</p>
<p>Giles has written <a href="http://gilesbowkett.blogspot.com/2008/10/verbatim-how-to-find-patterns-in-code.html">an extensive blog post on Towelie</a>, which includes a screenshot of a successful output. Clean and to the point. Give it a try and see if it works on your code base - there's a lot of potential here.</p>
<h3>Flay</h3>
<p>Next I looked at <a href="http://ruby.sadi.st/Flay.html">Flay</a>, which just showed up (instantly at version 1.0.0) on <a href="http://rubyforge.org/frs/?group_id=1513&amp;release_id=28021">RubyForge</a>. From Ryan Davis, Flay uses <a href="http://rubyforge.org/forum/forum.php?forum_id=27971">sexp_processor</a> and ruby_parser to examine the structure of Ruby code. It's capable of detecting both exact and close matches, and did in fact find some spots in Active Record where patterns repeat. In its current state, Flay's output is very primitive: a list of repeated code nodes, together with a weight to rank them by and line numbers and file names where they show up.</p>
<p>Just <code>gem install flay</code>, and then <code>flay *.rb</code> to get playing with Flay.</p>
<h3>Simian - A more general approach</h3>
<p>Turning away from pure Ruby tools, I grabbed a copy of <a href="http://www.redhillconsulting.com.au/products/simian/">Simian</a>, a code similarity analyzer that's been around for quite a while. Written in Java, Simian can handle Ruby source code just fine - and indeed, it very quickly found a number of duplicate lines in the source I was looking at. For open source projects, Simian is free; others will pay $99 or more to license. This is definitely a more mature and faster tool than either Towelie or Flay; the drawback is that <strong>it has no knowledge of Ruby code structures</strong>, and so can't do the sort of logical looking for duplicate intent that the native tools promise.</p>
<h3>Conclusion</h3>
<p>The verdict? If I were coming into a new codebase with suspicious provenance, <strong>I'd run all three tools against it to get a sense of how bad the situation is</strong>. But I'd love to see the Ruby community push along the two native tools to a point where they have better output and can actually be used in a nightly build to watch for problems. We're not there yet, but could be reasonably soon - thoughts?</p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=5f1QJW"><img src="http://feeds.feedburner.com/~a/RubyInside?i=5f1QJW" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=ss5gN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=ss5gN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=kzh6n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=kzh6n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=Wx7Zn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=Wx7Zn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=tCZPn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=tCZPn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/445894806" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/3-tools-for-drying-your-ruby-code-1305.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/3-tools-for-drying-your-ruby-code-1305.html</feedburner:origLink></item>
		<item>
		<title>Rubyists On The Front Row of Election History</title>
		<link>http://feeds.feedburner.com/~r/RubyInside/~3/442729106/rubyists-on-the-front-row-of-election-history-1304.html</link>
		<comments>http://www.rubyinside.com/rubyists-on-the-front-row-of-election-history-1304.html#comments</comments>
		<pubDate>Wed, 05 Nov 2008 02:12:22 +0000</pubDate>
		<dc:creator>Peter Cooper</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.rubyinside.com/rubyists-on-the-front-row-of-election-history-1304.html</guid>
		<description><![CDATA[<p><a href="http://obamaftw.org/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/tweetrow.gif" width="137" height="188" alt="tweetrow.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /></a> <strong>Happy Election Night!</strong></p>
<p>A few days ago, the Obama campaign ran another call for donations and offered the chance for ten donors to sit on the "<a href="http://uk.youtube.com/watch?v=O8Rj-XStFf8">Front Row to History</a>" - basically the front row of an Obama event in Grant Park, Chicago. Rubyists <a href="http://www.codefluency.com/">Bruce Williams</a> (of <a href="http://www.fiveruns.com/">FiveRuns</a>) and <a href="http://damonc.com/">Damon Clinkscales</a> (<a href="http://austinonrails.org/">Austin on Rails</a>) have made it into this group, and they've rapidly launched <a href="http://obamaftw.org/"><strong>The Tweet Row to History</strong></a> <strong>(obamaftw.org)</strong> - a Twitter fuelled site with their up-to-the-minute adventures in Chicago.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://obamaftw.org/"><img src="http://www.rubyinside.com/wp-content/uploads/2008/11/tweetrow.gif" width="137" height="188" alt="tweetrow.gif" style="float:left; margin-right:12px; margin-bottom:12px;" /></a> <strong>Happy Election Night!</strong></p>
<p>A few days ago, the Obama campaign ran another call for donations and offered the chance for ten donors to sit on the "<a href="http://uk.youtube.com/watch?v=O8Rj-XStFf8">Front Row to History</a>" - basically the front row of an Obama event in Grant Park, Chicago. Rubyists <a href="http://www.codefluency.com/">Bruce Williams</a> (of <a href="http://www.fiveruns.com/">FiveRuns</a>) and <a href="http://damonc.com/">Damon Clinkscales</a> (<a href="http://austinonrails.org/">Austin on Rails</a>) have made it into this group, and they've rapidly launched <a href="http://obamaftw.org/"><strong>The Tweet Row to History</strong></a> <strong>(obamaftw.org)</strong> - a Twitter fuelled site with their up-to-the-minute adventures in Chicago.</p>
<p>Naturally, Bruce and Damon are flying the Obama banner pretty strongly, but this is a bipartisan site, so may whoever you voted for win!</p>

<p><a href="http://feeds.feedburner.com/~a/RubyInside?a=szL9DI"><img src="http://feeds.feedburner.com/~a/RubyInside?i=szL9DI" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/RubyInside?a=rbEEN"><img src="http://feeds.feedburner.com/~f/RubyInside?i=rbEEN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=MfK9n"><img src="http://feeds.feedburner.com/~f/RubyInside?i=MfK9n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=nB4cn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=nB4cn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/RubyInside?a=MKibn"><img src="http://feeds.feedburner.com/~f/RubyInside?i=MKibn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RubyInside/~4/442729106" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.rubyinside.com/rubyists-on-the-front-row-of-election-history-1304.html/feed</wfw:commentRss>
		<feedburner:origLink>http://www.rubyinside.com/rubyists-on-the-front-row-of-election-history-1304.html</feedburner:origLink></item>
	</channel>
</rss>
