<?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>metal &#38; gin &#187; ruby/rails</title>
	<atom:link href="http://blog.craig-mackenzie.com/category/ruby-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.craig-mackenzie.com</link>
	<description>(a weblog by craig t mackenzie)</description>
	<lastBuildDate>Thu, 19 Mar 2009 20:56:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails 2.0, out now!</title>
		<link>http://blog.craig-mackenzie.com/2007/12/10/rails-20-out-now/</link>
		<comments>http://blog.craig-mackenzie.com/2007/12/10/rails-20-out-now/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 10:33:11 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[observations]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[releases]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/12/10/rails-20-out-now/</guid>
		<description><![CDATA[
I&#8217;m a little bit late to the party on this one, but it would appear that Rails 2.0(.1) is finally out. Friday saw the birth of the second major release of the framework we love to love, and it jam packed with lots of loveliness and joy.


Rails 2.0 (i wonder how long until the trolls [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m a little bit late to the party on this one, but it would appear that Rails 2.0(.1) is finally out. Friday saw the birth of the second major release of the framework we love to love, and it jam packed with lots of loveliness and joy.
</p>
<p>
Rails 2.0 (i wonder how long until the trolls think Rails 2.0 is a Rails mash-up or something) brings with it lots of new features, polish, fixes and sexy, here are some of my favourites:
</p>
<ul>
<li>Namespaces in ActionPack</li>
<li>Seperation of view-type and renderer (ie. <code>show.html.erb</code> or <code>show.html.haml</code>)</li>
<li>Automagic record routing: <code>form_for(person)</code></li>
<li>HTTP Authentication baked in!</li>
<li>Request Profiler</li>
<li>Sexy Migrations, say a big thanks to <a href="http://errtheblog.com/" title="err.the_blog">err.the blog</a> for this one</li>
<li>ActiveRecord XML deserialization and JSON serialization</li>
<li>ActiveResource (like AR for REST api&#8217;s) </li>
</ul>
<p>
There are (obviously) tons more features to the release, i suggest you check out the <a href="http://weblog.rubyonrails.com/2007/12/7/rails-2-0-it-s-done" title="Riding Rails: Rails 2.0: It's done!">official announcement</a> as well as <a href="http://ryandaigle.com/articles/2007/12/7/rails-2-0-final-released-summary-of-features" title="Ryan's Scraps: Rails 2.0 Final Released! - Summary of Features">Ryan&#8217;s awesome post</a>. Happy coding bitches!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/12/10/rails-20-out-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>simple bread crumbs in ruby on rails</title>
		<link>http://blog.craig-mackenzie.com/2007/08/09/simple-bread-crumbs-in-ruby-on-rails/</link>
		<comments>http://blog.craig-mackenzie.com/2007/08/09/simple-bread-crumbs-in-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 15:55:10 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[breadcrumbs]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/08/09/simple-bread-crumbs-in-ruby-on-rails/</guid>
		<description><![CDATA[below is a simple implementation of bread-crumbs for use in ruby on rails, you can pass in the level separator as the first argument and a boolean to indicate inclusion of home link.
it relies on the requested path to work out how to split the breadcrumbs, it alsoo requires that every component of your path [...]]]></description>
			<content:encoded><![CDATA[<p>below is a simple implementation of bread-crumbs for use in ruby on rails, you can pass in the level separator as the first argument and a boolean to indicate inclusion of home link.</p>
<p>it relies on the requested path to work out how to split the breadcrumbs, it alsoo requires that every component of your path is accessable, should be a good starting block though.</p>
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails"><span class="meta meta_rails meta_rails_helper">  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">breadcrumbs</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">sep <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Â»<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> include_home <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="constant constant_language constant_language_ruby">true</span></span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    levels <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> request<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>path<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>split<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>?<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">0</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>split<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    levels<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>delete_at<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="constant constant_numeric constant_numeric_ruby">0</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>

    links <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>You are here: <span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    links <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">+=</span> content_tag<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>a<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>home<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>href</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="keyword keyword_control keyword_control_ruby">if</span> include_home

    levels<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>each_with_index <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do </span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span><span class="variable variable_other variable_other_block variable_other_block_ruby">level</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">,</span> <span class="variable variable_other variable_other_block variable_other_block_ruby">index</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span>
      links <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">+=</span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span> <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>sep<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span> <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>content_tag<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>a<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> level<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>downcase<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>gsub<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_regexp string_regexp_classic string_regexp_classic_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span>_<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby">/</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span> <span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>href</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">+</span>levels<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">0</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">..</span>index<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>join<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">))</span><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>

    content_tag<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>div<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> content_tag<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>p<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> links <span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>id</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>breadcrumb<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span></span></span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/08/09/simple-bread-crumbs-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007: All Over</title>
		<link>http://blog.craig-mackenzie.com/2007/05/23/railsconf-2007-all-over/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/23/railsconf-2007-all-over/#comments</comments>
		<pubDate>Wed, 23 May 2007 13:49:25 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[railsconf2007]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/23/railsconf-2007-all-over/</guid>
		<description><![CDATA[RailsConf 2007 is over, I&#8217;m back in the UK, thousands of miles away from the lovely Portland, back into the normal swing of things, back on the train, just back where I was. weird feeling.
Community
RailsConf rocked, so much more than I could have hoped for an so many levels, the content was brilliant the people [...]]]></description>
			<content:encoded><![CDATA[<p>RailsConf 2007 is over, I&#8217;m back in the UK, thousands of miles away from the lovely Portland, back into the normal swing of things, back on the train, just back where I was. weird feeling.</p>
<h2>Community</h2>
<p>RailsConf rocked, so much more than I could have hoped for an so many levels, the content was brilliant the people were amazing, organizationally the thing was a stunning success and what was achieved by the community and what was achieved by many people on an individual basis was amazing.</p>
<p>The feeling was very community focused, the Rails community has grown exponentially over the past year, and this was definitely reflected in the mix of and volume of people. I spoke to at least hundred Java developers, as well as some .NET folk and a whole mix of people from other languages. All here to have a little look at this web app frame work written in this crazy Ruby language.</p>
<p>The numbers as well, this year there were over 1600 people in attendance, last year 500, the year before there was no conference. In one year Rails as a community has grown so quickly, many many people are getting wealthy off the back of it, and I think this was Chad&#8217;s point on the first day, if we were all to use that for good, we can show the rest of the IT tech, hell the world, we can show them that we can make a difference. Well I think we were all listening, last time I checked we had raised over $33,000 in donations.</p>
<p>The community, as well as the framework have grown and matured, and it&#8217;s good to see companies like Adobe, Sun, O&#8217;rielly and Amazon making their presence at this conference for a framework only 2 years old.</p>
<h2>Enterprise</h2>
<p>As larger companies start to pay more attention to us it&#8217;s important to make sure we are ready to deal with what the enterprise world wants, through projects like JRuby and others.</p>
<p>Although this is good, in a way, I hope Rails will maintain it&#8217;s Opinion as it is spun off in all sorts of directions. It&#8217;s a little bit over my head if truth be known. But interest from larger companies can only mean good right? Probably wrong? I don&#8217;t know.</p>
<p>Enterprise anxiety was definitely a strong theme running the conference.</p>
<h2>REST</h2>
<p>REST was covered heavily at RailsConf also, there were over 4 separate talks on the subject. This is important I guess, as we hurtle towards Rails 2, REST is going to become more and more central to what it is the core team are thinking.</p>
<p>Plugin&#8217;s like Hamilton&#8217;s make_resourceful have already started popping up all over the place and getting knowledge on it all know while it&#8217;s still all EDGE-centric, is going to prove really useful down the line. DHH&#8217;s keynote actually helped to clarify one of my biggest concerns, nested resources, or something. Either way I have a better understanding of it all now.</p>
<p>RailsConf was an amazing experience, something I wouldn&#8217;t have changed. The best thing to come out of the whole thing was meeting 3 wonderful human beings, <a href="http://cumu.li">Anthony Ramm</a>, <a href="http://rev.dantripp.com">Dan Tripp</a> and <a href="http://jeremy.sydik.com/">Jeremy Sydik</a>. You three are amazing, Thank You for making the experience so welcoming and warm.</p>
<p>To summarize, I&#8217;ve met some amazingly talented, clever and inspirational people over the past 4 days. I&#8217;ve felt the power of the community to truly do something amazing and make a real difference, and above everything I&#8217;ve left with 3 brilliant friends.</p>
<p>Roll on RailsConf 2008.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/23/railsconf-2007-all-over/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007: Day 4</title>
		<link>http://blog.craig-mackenzie.com/2007/05/21/railsconf-2007-day-4/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/21/railsconf-2007-day-4/#comments</comments>
		<pubDate>Mon, 21 May 2007 13:31:32 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/21/railsconf-2007-day-4/</guid>
		<description><![CDATA[The last day of RailsConf was a sad one as well as an amazing one.
The Rails Way
Jamis Buck and Michael Koziarski of the rails core team presented a rundown of some of the more common questions they get asked on the Rails Way website.
They sorta tackled the thing from a tag-team perspective, each taking it [...]]]></description>
			<content:encoded><![CDATA[<p>The last day of RailsConf was a sad one as well as an amazing one.</p>
<h2>The Rails Way</h2>
<p>Jamis Buck and Michael Koziarski of the rails core team presented a rundown of some of the more common questions they get asked on the Rails Way website.</p>
<p>They sorta tackled the thing from a tag-team perspective, each taking it in turns to walk through a page of code and give lots of great advice.</p>
<p>There was an irc channel you could post questions to whilst the talk was going on, these were answered at the end.</p>
<p>The thing I found really valuable was with_options stuff for routing, I&#8217;m totally gonna be re-writing some killer route files.</p>
<p>Take this for example:</p>
<pre class="textmate-source"> <span class="source source_ruby source_ruby_rails">map<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>create_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/create/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>controller</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>message<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>create<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
 map<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>create_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/edit/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>controller</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>message<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>edit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
 map<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>create_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/delete/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>controller</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>message<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>delete<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span></span></pre>
<p>And turn it into this:</p>
<pre class="textmate-source"> <span class="source source_ruby source_ruby_rails">map<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>with_options <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>controller</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>message<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do </span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span><span class="variable variable_other variable_other_block variable_other_block_ruby">msg</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span>
   msg<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>create_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/create/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>create<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
   msg<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>delete_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/edit/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>edit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
   msg<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>delete_message <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/msg/delete/:id<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>action</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=></span> <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>delete<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
 <span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>I think it&#8217;s much clearer, and way more descriptive.</p>
<h2>Choose Your Battles and LetIt::REST</h2>
<p>This was Hampton&#8217;s talk about REST (there was lots of REST talk at RailsConf) this one was more about implementation than theory, or practice. Which was good. It also took from the perspective of the current REST code in EDGE (unlike Vonage). Again refreshing.</p>
<p>The focus was on a new plugin they had developed (ham an the guys at unspace) originally called letItRest, now renamed make_resourceful. The plugin addresses the amount of duplication necessary to implement a RESTful interface, it seems to be a bit like a scaffold/code-generator type thing, which is cool, and although we&#8217;re promised it&#8217;s very easy to still get your edge-cases/exceptions in there, I can&#8217;t help but wonder how it &#8220;feels&#8221;. I&#8217;m definitely going to give it a go though.</p>
<p>The talk it&#8217;s self seemed over quite quickly, there were some funny slides, which helped break up the code slides, the pace was good and Hampton is a great talker.</p>
<h2>Rubber, Meet Road</h2>
<p>Amy Hoy&#8217;s talk focused on finding the comfortable place between designer and developer to let communication flourish, as well as touching on the two mindsets, how they work together, how they fight and why.</p>
<p>Amy (like myself) is a programmer with a designer background. This was really useful for me to help identify the thought patterns in my mind that are clearly designer and those that fit squarely in the dev head box. It also helped to reveal how far work (as in my 9-5, not just work in general) has yet to go to be truly productive.</p>
<p>The talk itself was very fun, lots of funny slides, some jokes and healthy dose of sarcasm. Great fun.</p>
<h2>Dave Thomas&#8217;s Keynote</h2>
<p>Dave Thomas&#8217;s ending keynote was good, i&#8217;d like to say I was paying him 100% attention but me and ant were buying domains for an upcoming project I&#8217;m going to be collaborating with him on.</p>
<p>From what I can gather the keynote was about community, charity and cargo-cult mentality. It ended with Dave asking us all to have fun. Which is cool.</p>
<p>After the final keynote was a meet and greet in the reception area, me, ant dan and jeremy ditched in favor of mexican and beer. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/21/railsconf-2007-day-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007: Day 3</title>
		<link>http://blog.craig-mackenzie.com/2007/05/20/railsconf-2007-day-3/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/20/railsconf-2007-day-3/#comments</comments>
		<pubDate>Sun, 20 May 2007 19:16:15 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[railsconf2007]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/20/railsconf-2007-day-3/</guid>
		<description><![CDATA[Saturday was a slightly shorter day here at RailsConf and went like this
Bring Ruby to the Enterprise. Not the Other Way &#8216;Round
Cyndi Mitchell&#8217;s opening keynote was very good, although the community may not like It (in certain circles) there Is a need to educate and support enterprising companies about the virtues of rails/ruby. 
Cyndi&#8217;s talk [...]]]></description>
			<content:encoded><![CDATA[<p>Saturday was a slightly shorter day here at RailsConf and went like this</p>
<h2>Bring Ruby to the Enterprise. Not the Other Way &#8216;Round</h2>
<p>Cyndi Mitchell&#8217;s opening keynote was very good, although the community may not like It (in certain circles) there Is a need to educate and support enterprising companies about the virtues of rails/ruby. </p>
<p>Cyndi&#8217;s talk was very well paced and touched on some humorous comparisons between pop culture and tech-industry, some of her slides were awesome too. A good start to the day.</p>
<h2>Tim Bray</h2>
<p>Tim bray&#8217;s keynote was again on rails / enterprise, sun&#8217;s position on It, his passion for It. To be honest a lot of went over my head, I was really tired. That guy seems awesome though.</p>
<h2>Custom Rails Helpers: Keeping Your Views DRY</h2>
<p>The first session of the day focused on DRYing up your views with custom helpers, this was cool, not from a  &#8220;i&#8217;m learning something new&#8221; perspective, more from a &#8220;I do this already, I&#8217;m so glad I&#8217;m doing right&#8221;</p>
<p>Although the session taught me nothing new, It did validate a lot of the work of been doing on helpers, so It felt kinda cool. was very busy.</p>
<h2>Memcaching Rails</h2>
<p>Chris Wanstrath, of <a href="http://errtheblog.com/" title="err.the_blog">err the blog</a> fame (that&#8217;s where I heard of him anyway) presented this talk.</p>
<p>It focused on the probleming of caching, and his solution cache_fu. It was a really Insightful session with some wicked slides, and chris himself Is super animated, which Is always good.</p>
<p>It left me with enough knowledge to know where to start with caching, that Is when I need It.</p>
<h2>The Dark Art of Developing Plugins</h2>
<p>This session was really cool, It walked through making a simple plugin and was themed like a horror flick. wicked.</p>
<p>The really Insightful stuff was about ruby, extending and overwriting and all that jazz, was way cool. that class_eval method Is some crazy ass ninja kung fu.</p>
<p>Makes me wanna wrap up some common stuff Into plugins now.</p>
<h2>Data Warehouses with ActiveWarehouse</h2>
<p>This was way more high brow than I was expecting, and although I was following along alright top begin with, as soon as the concept of cubes and dimensional data aggregation started I had to walk.</p>
<p>But If the need every came along to churn through piles of data and make It relevant, this would be my starting post.</p>
<p>The day ended In a chinese restaurant, with my sipping beer from a tea cup.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/20/railsconf-2007-day-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007: Day 2</title>
		<link>http://blog.craig-mackenzie.com/2007/05/19/railsconf-2007-day-2/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/19/railsconf-2007-day-2/#comments</comments>
		<pubDate>Sat, 19 May 2007 17:42:18 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[railsconf2007]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/19/railsconf-2007-day-2/</guid>
		<description><![CDATA[The second day of RailsConf was long&#8230; very long.
Chad Fowler&#8217;s Intro
The day kicked off with chad fowler opening the keynote with an important message: &#8220;Everyone thinks we are a bunch of arrogant bastards.&#8221; People laughed at this at first, but as he kept talking what he was saying become apparent, as our community grows more [...]]]></description>
			<content:encoded><![CDATA[<p>The second day of RailsConf was long&#8230; very long.</p>
<h2>Chad Fowler&#8217;s Intro</h2>
<p>The day kicked off with chad fowler opening the keynote with an important message: &#8220;Everyone thinks we are a bunch of arrogant bastards.&#8221; People laughed at this at first, but as he kept talking what he was saying become apparent, as our community grows more and more of us are becoming wealthy off the back of rails it becomes important to prove to the rest of the world that we can make a difference.</p>
<p>It was an important message, there are nearly 2000 people at RailsConf and if we each donated $100 to the Pragmatic Studio&#8217;s Charity of Choice we can prove to people that we can change the world.</p>
<p>Or something.</p>
<h2>DHH&#8217;s Keynote</h2>
<p>David&#8217;s keynote was good, the focus was on Rails 2, recapping the features introducing some minor new features, and indicating which features are going to be removed.</p>
<p>One of the things he highlighted which definitely got me excited was some further clarification on and enhancements to the way that RESTful routing works, my biggest gripe with that was admin/backend routing and implementing REST in all situation.</p>
<p>This has been cleaned up a lot and you can now namespace your RESTful routes / resources. </p>
<p>Another neat thing was the respond_to stuff, it now seems (i might be wrong) that this has become transparent in detecting and routing mime types. which is nice.</p>
<p>ActiveResource looks sweet. It&#8217;s going to be replacing ActiveWebService and is completely focused on consuming REST interfaces. REST is one of the main focuses of Rails 2, it&#8217;s the new opinion, if you&#8217;re going to be devleoping an app, it should be REST routed, APIs should be based on REST. Good opinions.</p>
<h2>respond_to :voice</h2>
<p>This was the first session of the day, at it fucking rocked.</p>
<p>It was an introduction to using the Asterisk PBX with rails, using a new plugin called Telegraph.</p>
<p>I looked into Asterisk a while ago, and the AGI config files are just horrible, hundreds of lines of extraneous repetitive code. nasty.</p>
<p>Telegraph takes these AGI/AMI config files and wraps them in clean MVC ruby code. The thing that really got me going was the possibilities, the guy gave some demo&#8217;s and it&#8217;s really exciting. The general idea is that you can take your rails app and another interface for your users to interact with it in. Voice, using Asterisk and Telegraph will allow you to have your app call out to people, have people call in, consume data over the phone, maintain session data between the web and the phone network (super sweet).</p>
<p>I really cant wait to get going with it.</p>
<h2>Doing Rest Right</h2>
<p>I really really wanted this to be good. It wasn&#8217;t. Although it was insightful, and gave some brain food to chew over, it was a bit high-level and philosophical. I left early.</p>
<h2>Apollo</h2>
<p>This talk was kinda good, although not really Rails-centric, it was a nice introduction to the new Adobe cross-platform runtime for Flash/Flex/HTML/JS/PDF apps.</p>
<p>The really interesting thing is that all of the separate technologies supported inside of the runtime are treated as first class citizens with a common cross technology DOM to use.</p>
<p>You could basically have an Apollo app with an HTML viewer, and Flex/Flash component side by side, and cross-script between the two of them with a common DOM. Very neat.</p>
<p>Flex in general is something that I really need to get into (again)</p>
<h2>Avi Bryant&#8217;s Keynote</h2>
<p>Avi Bryant has been in and out of the Ruby community for a while, he&#8217;s a smalltalk advocate that works on the seaside project.</p>
<p>His talk was focused on the future of ruby, performance etc.</p>
<p>It was kinda good, a prompt to think of the future of our language. meh.</p>
<h2>Ze Frank&#8217;s Keynote</h2>
<p>Ze Frank, simply put is the fucking funniest thing ever. His keynote was more of a stand up comedy routine, with slides. The topic was accelerating anxiety.</p>
<p>I really can&#8217;t explain how good it was, you just have to google some of the stuff this guy has done. It was the perfect end to the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/19/railsconf-2007-day-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007: Day 1</title>
		<link>http://blog.craig-mackenzie.com/2007/05/18/railsconf-2007-day-1-2/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/18/railsconf-2007-day-1-2/#comments</comments>
		<pubDate>Fri, 18 May 2007 16:00:52 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[railsconf2007]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/18/railsconf-2007-day-1-2/</guid>
		<description><![CDATA[So yesterday was my first day at RailsConf, it was great. The day was broken into two tutorial sessions with a break for lunch.
Intro to Test Driven Development with Rails
This tutorial was awesome, presented by David Chelimsky this really helped to solidify my understanding of TDD, as well as touching on and clarifying some aspects [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday was my first day at RailsConf, it was great. The day was broken into two tutorial sessions with a break for lunch.</p>
<h2>Intro to Test Driven Development with Rails</h2>
<p>This tutorial was awesome, presented by David Chelimsky this really helped to solidify my understanding of TDD, as well as touching on and clarifying some aspects of <a href="http://rspec.rubyforge.org/" title="RSpec Home">Rspec</a>.</p>
<p>The pace was good and the tutorial didn&#8217;t seem long enough, there was lots of good discussion and the code examples were great. </p>
<p>Part of the tutorial featured us &#8220;Pair Programming&#8221; (a practice from eXtreme Programming (XP)) The basic concept is one person writes a failing test, then the next writes just enough code to pass that test, then writes a another failing test for the previous person to fix, gradually the code is written and tested and passing mechanisms are refactored into useful clean code.</p>
<p>It was a really great exercise and provided a lot of value.</p>
<h2>Harnessing Capistrano</h2>
<p>The second tutorial of the day was presented by <a href="http://weblog.jamisbuck.org/" title="the { buckblogs :here }">Jamis Buck</a>, the creator of <a href="http://capistrano.org/">Capistrano</a> and core member that works at <a href="http://www.37signals.com/" title="Simple software to help you get organized: 37signals">37 Signals</a>.</p>
<p>I was really looking forward to this tutorial and although offered a lot of insight into the new feature of Capistrano 2.0, it was a little slow and dry. </p>
<p>I guess it&#8217;s kind of difficult to get excited about something without having a hands on experiance (there was no code writing in this tutorial) but it definitely left me with some ideas.</p>
<p>The day ended with Dan Tripp, Ant (another brit from Birmingham) and myself having dinner, drinking beer and talking g33k in a mexican joint downtown.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/18/railsconf-2007-day-1-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RailsConf 2007</title>
		<link>http://blog.craig-mackenzie.com/2007/05/17/railsconf-2007-day-1/</link>
		<comments>http://blog.craig-mackenzie.com/2007/05/17/railsconf-2007-day-1/#comments</comments>
		<pubDate>Thu, 17 May 2007 14:55:42 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[i am geek]]></category>
		<category><![CDATA[ruby/rails]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[railsconf2007]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/05/17/railsconf-2007-day-1/</guid>
		<description><![CDATA[I&#8217;m currently sitting in exhibit hall c of the Oregon Convention Center enjoying a starbucks coffee, I&#8217;m at railsconf 07, my first tutorial (Intro to Test-Driven Development for Rails) starts in 45mins, the convention center is huge!
Getting here was easy, Portland has a tram system called the Max Light Rail, it&#8217;s free for most of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently sitting in exhibit hall c of the Oregon Convention Center enjoying a starbucks coffee, I&#8217;m at railsconf 07, my first tutorial (Intro to Test-Driven Development for Rails) starts in 45mins, the convention center is huge!</p>
<p>Getting here was easy, Portland has a tram system called the Max Light Rail, it&#8217;s free for most of the city, and only took like 20mins.</p>
<p>There are a lot of people here already and I expect there will be even more tomorrow.</p>
<p>Portland is a beautiful city, I could honestly see living here, image paris without the dirt and smog, make the roads and paths wider, take away the awkward angles and turn them into blocks and you have portland. Why paris? The trees, image the Champs-Ã‰lysÃ©es only every block is like that. It&#8217;s really beautiful, I had a good wonder around yesterday, the sine was shining, the trees were green, it was lovely. A woman at the airport told me that portland has the feel of a big-town rather than a city. She was right.</p>
<p>My hotel (the <a href="http://hotellucia.com">hotel lucia</a>) is stunning. drop-dead-gorgeous. I also found a fabulous all-male designer underwear shop called Under U 4 Men, I dropped like $200 dollars in the already and I know I will go back.</p>
<p>All in all I&#8217;m having a great time so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/05/17/railsconf-2007-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying Multiple Instances of an Application With Capistrano</title>
		<link>http://blog.craig-mackenzie.com/2007/01/04/deploying-multiple-instances-of-an-application-with-capistrano/</link>
		<comments>http://blog.craig-mackenzie.com/2007/01/04/deploying-multiple-instances-of-an-application-with-capistrano/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 14:50:26 +0000</pubDate>
		<dc:creator>craig mackenzie</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby/rails]]></category>

		<guid isPermaLink="false">http://blog.craig-mackenzie.com/2007/01/04/deploying-multiple-instances-of-an-application-with-capistrano/</guid>
		<description><![CDATA[Like most people I use capistrano to deploy my rails applications, at work we host with the excellent railsmachine and they have really helped simplify the process of deploying to their servers using the railsmachine gem, which builds on top of the excellent functionality of capistrano. 
The way these tools work by default they only [...]]]></description>
			<content:encoded><![CDATA[<p>Like most people I use capistrano to deploy my rails applications, at work we host with the excellent <a href="http://railsmachine.com/">railsmachine</a> and they have really helped simplify the process of deploying to their servers using the <a href="https://support.railsmachine.com/index.php?pg=kb.chapter&#038;id=18">railsmachine gem</a>, which builds on top of the excellent functionality of capistrano. </p>
<p>The way these tools work by default they only allow you to deploy one instance of your application, which is fine, that&#8217;s all they&#8217;re are intended to do. But in the client facing world you&#8217;re probably going to want to have at least two versions of the same application at different stages of development running on the same server.</p>
<p>A live forward facing version (my-app.com) and a staging version (staging.my-app.com) for client approval / production testing (not code testing, that should stay on your development box) / progressive reviews etc.</p>
<p>So how do we achieve that? The idea is to determine what context you are deploying your application in, and use the fact the capistrano tasks can be chained together to set everything up ready for deploying a revision of your application to a targeted url, independent of other deployments.</p>
<h2>Step 1</h2>
<p>The first thing to do is to require the railsmachine recipes and setup some variables, as you will see later some of these variables are redundant, and the code has a fair bit of duplication, but this is a work in progress and I hope to clean it up when I have some more spare time.</p>
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails"><span class="meta meta_require meta_require_ruby"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">require</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>railsmachine/recipes<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span></span>

set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>application</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-app<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>deploy_to</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/var/www/apps/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>application<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>main_domain</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-app.com<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>

set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>user</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>deploy<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>repository</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svn+ssh://<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>user<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span>@my-svn-server.com/var/svn/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>main_domain<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span>/trunk<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>rails_env</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>production<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>

role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>scm</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-svn-server.com<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span></span></pre>
<p>You&#8217;ll notice that I&#8217;m keeping my my project on separate svn server, by default the railsmachine gem will create an svn repo for you as part of the project tree, this is really useful at first, but when you&#8217;re deploying multiple instances of the same application you&#8217;re going to want your svn repo independent.</p>
<h2>Step 2</h2>
<p>Now comes the clever bit, creating the tasks which will be called before our regular cap commands, like so <code>$ cap -a staging deploy</code> (which would deploy the current revision of your application to the staging server)</p>
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails">desc <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Set staging instance variables<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>staging</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>application</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-app-staging<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>domain</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>staging.my-app.com<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>apache_proxy_port</span>, <span class="constant constant_numeric constant_numeric_ruby">8010</span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>database_yml</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>database-staging.yml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>deploy_to</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/var/www/apps/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>application<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>

    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>web</span>, domain
    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>app</span>, domain
    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>db</span>,  domain, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>primary</span> =&gt; <span class="constant constant_language constant_language_ruby">true</span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

desc <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Set production instance variables<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>production</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>application</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-app-production<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>domain</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>my-app.com<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>apache_proxy_port</span>, <span class="constant constant_numeric constant_numeric_ruby">8000</span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>database_yml</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>database-production.yml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
    set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>deploy_to</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/var/www/apps/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>application<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>

    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>web</span>, domain
    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>app</span>, domain
    role <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>db</span>,  domain, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>primary</span> =&gt; <span class="constant constant_language constant_language_ruby">true</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>What this does is set all of the variables which any command you&#8217;ll call after staging or production will need, it&#8217;s pretty ugly at the moment and I hope to clean it up and make it a lot smarter, but for the moment it works, and in it&#8217;s ugliness it does make it clear what it&#8217;s doing.</p>
<h2>Step 3</h2>
<p>Next we overwrite the railsmachine setup_scm task and one of the tasks it calls, we&#8217;re doing this because we are using a custom location for our repository and not the one which the railsmachine gem tries to create for us. </p>
<p>In my particular situation I have an external server used for svn, but the repository could just as easily be on the same server as your application just so long as the folder you create the repo in is in the deploy group. Also in my situation I am creating a new repo for each project I deploy, if you already have a repo that you deploy all projects to you could easily just remove the setup_svn_repo task call from the setup_scm task.</p>
<p>Enough talk, on with the code:</p>
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails">desc <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Setup svn repository<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>setup_svn_repo</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>roles</span> =&gt; <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>scm</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>  dir = <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>/var/svn/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>main_domain<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  run <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>mkdir -p <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>dir<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  run <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>chmod 770 <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>dir<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  run <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svnadmin create <span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>dir<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

desc <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>Setup source control server.<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>setup_scm</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>roles</span> =&gt; <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>scm</span>  <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>  setup_svn_repo
  import_svn
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<h2>Step 4</h2>
<p>Because different instances of our application are going to need different databases we have to overwrite the method which read&#8217;s in the database configuration when setting up the database for the first time. The way it works at the moment we also need to remove the database.yml file from svn control, and recreate it from the correct file after every code update.</p>
<pre class="textmate-source"><span class="source source_ruby source_ruby_rails">task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>clean_db_yml</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>removing database.yml from svn<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  system <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svn remove config/database.yml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>ignoring database.yml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  system <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svn propset svn:ignore 'database.yml' config/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  system <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svn update config/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  puts <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>committing changes<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
  system <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>svn commit -m 'Removed and ignored database.yml file'<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>
<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">read_config</span></span>
  db_config = <span class="variable variable_other variable_other_constant variable_other_constant_ruby">YAML</span>.load_file(<span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>config/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>database_yml<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>)
  set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>db_user</span>, db_config[rails_env][<span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>username<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>]
  set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>db_password</span>, db_config[rails_env][<span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>password<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>]
  set <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>db_name</span>, db_config[rails_env][<span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>database<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>]
<span class="keyword keyword_control keyword_control_ruby">end</span>

task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>after_update_code</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>roles</span> =&gt; <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>app</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>   correct_db_yml
<span class="keyword keyword_control keyword_control_ruby">end</span>

task <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>correct_db_yml</span> <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do
</span>  put(<span class="support support_class support_class_ruby">File</span>.read(<span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>config/<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>database_yml<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>), <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span><span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">#{</span>release_path<span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby">}</span></span>/config/database.yml<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>mode</span> =&gt; <span class="constant constant_numeric constant_numeric_ruby">0444</span>)
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>Thats all there is to it, I run the following commands to set up an instance of my app:</p>
<pre>
cap -a staging setup
cap -a staging setup_scm
cap -a staging setup_servers
../[new directory]
cap -a staging clean_db_yml
cap -a staging cold_deploy
cap -a staging restart_web

cap -a staging deploy
cap -a staging deploy_with_migrations
</pre>
<h2>The End</h2>
<p>There you have it, it works, it&#8217;s not the most elegant solution and definitely something I want to work further on. The last section with database.yml stuff is by far the ugliest, but it is a work in progress, and I plan to make further amendments to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craig-mackenzie.com/2007/01/04/deploying-multiple-instances-of-an-application-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
