<?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>FiveAM</title>
	<atom:link href="http://www.fiveamsoftware.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fiveamsoftware.com</link>
	<description>Ruby, Rails and TDD</description>
	<lastBuildDate>Sun, 03 Jul 2011 17:24:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Specifying environments on Heroku</title>
		<link>http://www.fiveamsoftware.com/2011/07/03/specifying-environments-on-heroku/</link>
		<comments>http://www.fiveamsoftware.com/2011/07/03/specifying-environments-on-heroku/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 16:29:44 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=538</guid>
		<description><![CDATA[When I first started using Heroku for deployment, it truly was a black box for &#8216;push button deployment&#8217; as I joked &#8212; one simply typed &#8216;git push heroku master&#8217; into a black box, i.e. your shell, and things &#8216;should&#8217; work&#8230; &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/07/03/specifying-environments-on-heroku/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>When I first started using Heroku for deployment, it truly was a black box for &#8216;push button deployment&#8217; as I joked &#8212; one simply typed &#8216;git push heroku master&#8217; into a black box, i.e. your shell, and things &#8216;should&#8217; work&#8230;</p>
<p>But what if they do not, or if you need more options when deploying an application?</p>
<p>So, I took advantage of the holiday weekend to deep-dive into Heroku and first was these two useful rake scripts for adding staging/production deployment environments and rolling back migrations/deployments.</p>
<ul>
<li><a href="http://goo.gl/Sjy64">Gist</a> by Nicola Junior Vitta for deploying, migrating and rolling back</li>
<li>Gist by Michael Dwan for setting up, deploying and breaking down</li>
<li>Gist by George Brock for creating and deploying to separate staging and production environments</li>
</ul>
<p>The .rake files go into the lib/tasks directory for Rails 3 applications, and their usage follow their task naming convention in the .rake file. So, tasks that are nested would be called by &#8216;rake deploy:rollback_staging&#8217; if rollback_staging were nested inside the deploy task code block.</p>
<p>The reason for these rake files is that Heroku currently supports only one rollback under the release management <a href="http://devcenter.heroku.com/articles/releases">add-on</a>, and if you are working on a share project where you are not the owner then you cannot enable the add-on&#8230; which is where the .rake files come in.</p>
<p>Finally, &#8216;heroku create&#8217; appears to be a black box but it does come with <a href="http://devcenter.heroku.com/articles/multiple-environments">options</a> like most bash commands, e.g.: heroku create app-staging &#8211;stack bamboo-mri-1.9.2 &#8211;remote staging, where app-staging is the staging application name / bamboo-mri.1.9.2 is the flavor of Ruby selected for use in deployment / &#8211;remote staging is added as the staging branch for the deployment repository.</p>
<p>This write-up stems from my curiosity about deployment after poking around with Linode via Capistrano, which offer more control but also more configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/07/03/specifying-environments-on-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Resources</title>
		<link>http://www.fiveamsoftware.com/2011/07/03/git-resources/</link>
		<comments>http://www.fiveamsoftware.com/2011/07/03/git-resources/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 16:05:17 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[source control]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=536</guid>
		<description><![CDATA[Source control is critical for tracking changes and managing development. Often, the changes we make to our applications do not work out. We try something new in an experimental branch and either decide to change our minds or something about &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/07/03/git-resources/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Source control is critical for tracking changes and managing development.</p>
<p>Often, the changes we make to our applications do not work out. We try something new in an experimental branch and either decide to change our minds or something about the project requirements renders it obsolete.</p>
<p>For Rails developers, git is the common practice for source control. Written by <a href="http://goo.gl/SGi3">Linux Torvalt</a> while workin on the Linux kernel. Practically, it tracks every change to every file (as long as it is being tracked) with a unique key (commit id).</p>
<p>In addition, it is possible to branch, merge and reverse any changes in a given code repository. Nifty stuff, and here are my favorite references whenever I need a quick refresher on which commands to use along with their options:</p>
<ul>
<li>http://gitready.com/</li>
<li>http://progit.org/book/</li>
<li>http://cheat.errtheblog.com/s/git</li>
</ul>
<p>Git and source control are large enough topics for many posts, and I may (or not) return to writing more about this topic once I have developed a skill level beyond my current &#8216;proficiency&#8217; level.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/07/03/git-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rollbacks &amp; Release Management on Heroku</title>
		<link>http://www.fiveamsoftware.com/2011/07/02/rollbacks-release-management-on-heroku/</link>
		<comments>http://www.fiveamsoftware.com/2011/07/02/rollbacks-release-management-on-heroku/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 23:57:46 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[deployment]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=533</guid>
		<description><![CDATA[While working on an existing RoR application deployed on Heroku, I ran across the issue of rolling back previous deployments and release management into production. The solution is a .rake file I found in a blog post by Casper Fabricious &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/07/02/rollbacks-release-management-on-heroku/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>While working on an existing RoR application deployed on Heroku, I ran across the issue of rolling back previous deployments and release management into production.</p>
<p>The solution is a .rake file I found in a blog post by Casper Fabricious posted <a href="http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/">here</a> that includes release management and rollbacks in staging and production environments.</p>
<p>Finally, here are my observations after doing my research on this topic:</p>
<div>General:</p>
<ul>
<li>heroku only deploys from master branch of the git repo.</li>
<li>as a result, staging remote branches can be added but will not be deployed nor will any other branch for that matter.</li>
<li>heroku_san offers some additional rake tasks but do not manage rollbacks.</li>
<li>heroku release management add-on only manages single rollback to previous deployment.</li>
<li>work-around is using git tags and series of rake tasks: <a href="http://goo.gl/4tCSf">http://goo.gl/4tCSf</a></li>
<li>put the .rake file into the lib/tasks directory and run from command line, e.g. ‘rake deploy_staging’ or when task is nested under the :deploy namespace, then ‘rake deploy:staging_rollback’</li>
</ul>
<p>Heroku rollbacks &amp; release management:</p>
<ul>
<li>heroku staging deploy: <a href="http://devcenter.heroku.com/articles/multiple-environments">http://devcenter.heroku.com/articles/multiple-environments</a></li>
<li>heroku release management: <a href="http://goo.gl/cZDfk">http://goo.gl/cZDfk</a></li>
<li>elijah miller, heroku release management: <a href="http://goo.gl/8oY9E">http://goo.gl/8oY9E</a></li>
<li>heroku_san gem on github: <a href="http://goo.gl/LdCsB">http://goo.gl/LdCsB</a></li>
</ul>
<p>Rollbacks via rake:</p>
<ul>
<li>rollbacks via rake on github: <a href="http://goo.gl/4tCSf">http://goo.gl/4tCSf</a></li>
<li>usage: ‘rake deploy_staging’ or when task is nested under the :deploy namespace, then ‘rake deploy:staging_rollback’</li>
</ul>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/07/02/rollbacks-release-management-on-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[rvm] global gemset &amp; 1.8.7-head vs. 1.8.7-p334.</title>
		<link>http://www.fiveamsoftware.com/2011/04/05/rvm-global-gemset-1-8-7-head-vs-1-8-7-p334/</link>
		<comments>http://www.fiveamsoftware.com/2011/04/05/rvm-global-gemset-1-8-7-head-vs-1-8-7-p334/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 05:00:31 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=524</guid>
		<description><![CDATA[Problem #1: New rvm gemset does not recognize Bundler. Solution: Download Bundler into global gemset, then run &#8216;bundle install&#8217;. Problem #2: When running rake, ruby-1.8.7-head throws private method chomp error. Solution: Issues known in ruby-1.8.7-head. Revert to ruby-1.8.7-p334. Here are the &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/04/05/rvm-global-gemset-1-8-7-head-vs-1-8-7-p334/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Problem #1: New rvm gemset does not recognize Bundler.<br />
Solution: Download Bundler into global gemset, then run &#8216;bundle install&#8217;.</p>
<p>Problem #2: When running rake, ruby-1.8.7-head throws private method chomp error.<br />
Solution: <a href="http://www.ruby-forum.com/topic/523412">Issues</a> known in ruby-1.8.7-head. Revert to ruby-1.8.7-p334.</p>
<p>Here are the results via Gist:</p>
<div id="gist-903859" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'># .rvm </div><div class='line' id='LC2'># [fiveam] rvm global gemset &amp; 1.8.7-head vs. 1.8.7-p334.</div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'># Problem: rvm gemset does not recognize Bundler.</div><div class='line' id='LC5'># Solution: store gem in global gemset, then run &#39;bundle install&#39;.</div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'>me@me:~/classes/eff-tdd/aws-demo$ bundle install</div><div class='line' id='LC8'>bundle: command not found</div><div class='line' id='LC9'>me@me:~/classes/eff-tdd/aws-demo$ rvm use 1.8.7-p334@global</div><div class='line' id='LC10'>Using /home/me/.rvm/gems/ruby-1.8.7-p334 with gemset global</div><div class='line' id='LC11'>me@me:~/classes/eff-tdd/aws-demo$ gem install bundler</div><div class='line' id='LC12'>Fetching: bundler-1.0.11.gem (100%)</div><div class='line' id='LC13'>Successfully installed bundler-1.0.11</div><div class='line' id='LC14'>1 gem installed</div><div class='line' id='LC15'>Installing ri documentation for bundler-1.0.11...</div><div class='line' id='LC16'>Installing RDoc documentation for bundler-1.0.11...</div><div class='line' id='LC17'>me@me:~/classes/eff-tdd/aws-demo$ rvm use 1.8.7-p334@aws-demo</div><div class='line' id='LC18'>Using /home/me/.rvm/gems/ruby-1.8.7-p334 with gemset aws-demo</div><div class='line' id='LC19'>me@me:~/classes/eff-tdd/aws-demo$ bundle install</div><div class='line' id='LC20'>Fetching source index for http://rubygems.org/</div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'># Problem: when running rake, ruby-1.8.7-head throws error in logger.rb.</div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'>me@me:~/classes/eff-tdd/aws-demo$ rake spec --trace</div><div class='line' id='LC25'>(in /home/me/classes/eff-tdd/aws-demo)</div><div class='line' id='LC26'>rake aborted!</div><div class='line' id='LC27'>private method `chomp&#39; called for nil:NilClass</div><div class='line' id='LC28'>/home/me/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/logger.rb:174</div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'># Solution: Known issues in 1.8.7-head build: http://www.ruby-forum.com/topic/523412, revert to 1.8.7-p334.</div><div class='line' id='LC31'><br/></div><div class='line' id='LC32'>me@me:~/classes/eff-tdd/aws-demo$ rvm use 1.8.7-p334@aws-demo</div><div class='line' id='LC33'>Using /home/me/.rvm/gems/ruby-1.8.7-p334 with gemset aws-demo</div><div class='line' id='LC34'>me@me:~/classes/eff-tdd/aws-demo$ bundle install</div><div class='line' id='LC35'>bundle: command not found</div><div class='line' id='LC36'>me@me:~/classes/eff-tdd/aws-demo$ rvm use 1.8.7-p334@global</div><div class='line' id='LC37'>Using /home/me/.rvm/gems/ruby-1.8.7-p334 with gemset global</div><div class='line' id='LC38'>me@me:~/classes/eff-tdd/aws-demo$ gem install bundler</div><div class='line' id='LC39'>Fetching: bundler-1.0.11.gem (100%)</div><div class='line' id='LC40'>Successfully installed bundler-1.0.11</div><div class='line' id='LC41'>1 gem installed</div><div class='line' id='LC42'>Installing ri documentation for bundler-1.0.11...</div><div class='line' id='LC43'>Installing RDoc documentation for bundler-1.0.11...</div><div class='line' id='LC44'>me@me:~/classes/eff-tdd/aws-demo$ rvm use 1.8.7-p334@aws-demo</div><div class='line' id='LC45'>Using /home/me/.rvm/gems/ruby-1.8.7-p334 with gemset aws-demo</div><div class='line' id='LC46'>me@me:~/classes/eff-tdd/aws-demo$ bundle install</div><div class='line' id='LC47'>Fetching source index for http://rubygems.org/</div><div class='line' id='LC48'>...</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/903859/164980b1d4200a110d499048efc334da43a69fa7/.rvm" style="float:right;">view raw</a>
            <a href="https://gist.github.com/903859#file_.rvm" style="float:right;margin-right:10px;color:#666">.rvm</a>
            <a href="https://gist.github.com/903859">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/04/05/rvm-global-gemset-1-8-7-head-vs-1-8-7-p334/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby and Rails in 5 Minutes with RVM</title>
		<link>http://www.fiveamsoftware.com/2011/04/01/ruby-and-rails-in-5-minutes-with-rvm/</link>
		<comments>http://www.fiveamsoftware.com/2011/04/01/ruby-and-rails-in-5-minutes-with-rvm/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 04:16:12 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=518</guid>
		<description><![CDATA[Installed Linux on yet another laptop, quick instructions for installing Ruby and Rails in 5 minutes (okay, maybe 10) with RVM. Basic steps are get RVM installed, download Rubies using RVM, then setup and use .rvmrc gemsets inside your projects. &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/04/01/ruby-and-rails-in-5-minutes-with-rvm/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Installed Linux on yet another laptop, quick instructions for installing Ruby and Rails in 5 minutes (okay, maybe 10) with RVM.</p>
<p>Basic steps are get RVM installed, download Rubies using RVM, then setup and use .rvmrc gemsets inside your projects.</p>
<p>Here is the Gist to explain it:</p>
<div id="gist-899223" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'># .rvmrc</div><div class='line' id='LC2'># Finish downloads required OS prior to installing RVM -- Linux requires curl, bison, autoconf and git before cloning into local repo. Next, download RVM: </div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'>$ bash &lt; &lt;(curl -B http://rvm.beginrescueend.com/install/rvm)</div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'># When complete, add this line to the bottom of the .bashrc file located in the /home/&lt;name&gt; directory:</div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'>[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; . &quot;$HOME/.rvm/scripts/rvm&quot; # Loads rvm into shell.</div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'># Run test to verify that installation was successful:</div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'>$ type rvm | head -1 # Should return &#39;rvm is a function&#39;</div><div class='line' id='LC13'><br/></div><div class='line' id='LC14'># Install Rubies:</div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'>$ rvm install ruby-&lt;version&gt;-&lt;build&gt; # Sample: ruby-1.8.7-p334, can lead off build too.</div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'># Install Rails along with your RVM gemsets -- create .rvmrc system file in your project directory using one line:</div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'>rvm use &lt;ruby version&gt;@&lt;gemset&gt; # Sample: 1.8.7-p334@test-app</div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'># Create same gemset named above inside project directory:</div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'>$ rvm gemset create &lt;ruby version&gt;@&lt;gemset&gt; # Sample: 1.8.7-p334@test-app</div><div class='line' id='LC25'><br/></div><div class='line' id='LC26'># Begin using newly created gemset:</div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'>$ rvm use &lt;ruby version&gt;@&lt;gemset&gt; # Sample: 1.8.7-p334@test-app</div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'># Run bundle install, which installs from Gemfile into gemset -- including Rails</div><div class='line' id='LC31'><br/></div><div class='line' id='LC32'>$ bundle install</div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'># These are the general steps, see http://rvm.beginrescueend.com/rvm/install/ with any problems during installation. Result is version of Ruby, Rails and gemsets nicely organized by project using .rvmrc. Repeat the process with .rvmrc, creating and using gemsets with each new project.</div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/899223/0c9bd92a8e4bcaecf1e52df2f40a54b3745b6090/.rvmrc" style="float:right;">view raw</a>
            <a href="https://gist.github.com/899223#file_.rvmrc" style="float:right;margin-right:10px;color:#666">.rvmrc</a>
            <a href="https://gist.github.com/899223">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/04/01/ruby-and-rails-in-5-minutes-with-rvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSpec: Best Practices by Carbon Five</title>
		<link>http://www.fiveamsoftware.com/2011/03/13/rspec-best-practices-by-carbon-five/</link>
		<comments>http://www.fiveamsoftware.com/2011/03/13/rspec-best-practices-by-carbon-five/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 21:10:34 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=514</guid>
		<description><![CDATA[I have been focusing on RSpec lately, using it for my projects and taking the Efficient TDD course at Blazing Cloud. Although I prefer textbooks to the Internets for coding advice, the Carbon Five community site is an exception and &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/03/13/rspec-best-practices-by-carbon-five/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I have been focusing on RSpec lately, using it for my projects and taking the <a href="http://marakana.com/techtv/efficient-rails-test-driven-development.html">Efficient TDD course</a> at Blazing Cloud. Although I prefer textbooks to the Internets for coding advice, the Carbon Five community site is an exception and contains useful bits such as their post on <a href="http://blog.carbonfive.com/2010/10/21/rspec-best-practices/">RSpec Best Practices</a>.</p>
<p>The post reinforces what I am learning in the class regarding readability, formatting, and applying the DRY (Don&#8217;t Repeat Yourself) principle my spec files.</p>
<p>Benefits of cleaner, well-organize tests include:</p>
<ul>
<li>Saves Code: Know exactly what is being tested so that both the test and code are following DRY.</li>
<li>Better Test Cases: Assertions and expectations are explicit so tests are written for specific scenarios vs. basic test coverage.</li>
<li>Readability: Test output is readable at run-time.</li>
</ul>
<p>Thanks again to Carbon Five for the write-up, and I hope to share more test code soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/03/13/rspec-best-practices-by-carbon-five/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Factories.rb: Simple as 1-2-3</title>
		<link>http://www.fiveamsoftware.com/2011/03/06/factories-rb-simple-as-1-2-3-2/</link>
		<comments>http://www.fiveamsoftware.com/2011/03/06/factories-rb-simple-as-1-2-3-2/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 18:03:28 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=509</guid>
		<description><![CDATA[Step 1: Add factory_girl to Gemfile and spec/spec_helper.rb. Step 2: Define factories in spec/factories.rb. Step 3: Method call from spec files. See Github Gist below:]]></description>
			<content:encoded><![CDATA[<p>Step 1: Add factory_girl to Gemfile and spec/spec_helper.rb.<br />
Step 2: Define factories in spec/factories.rb.<br />
Step 3: Method call from spec files.</p>
<p>See Github Gist below:</p>
<div id="gist-857452" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c1"># Step 1: Add factory_girl to Gemfile and spec/spec_helper.rb:</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="c1"># Gemfile:</span></div><div class='line' id='LC4'><span class="n">gem</span> <span class="s1">&#39;factory_girl&#39;</span><span class="p">,</span> <span class="s1">&#39;1.3.3&#39;</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'><span class="c1"># spec/spec_helper.rb:</span></div><div class='line' id='LC7'><span class="nb">require</span> <span class="s1">&#39;factory_girl&#39;</span></div><div class='line' id='LC8'><span class="nb">require</span> <span class="no">File</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">__FILE__</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;/../spec/factories.rb&quot;</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'><span class="c1"># Step 2: Define factories in spec/factories.rb</span></div><div class='line' id='LC11'><span class="c1"># Define sequence by calling sequence on factory object &#39;f&#39;.</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'><span class="no">Factory</span><span class="o">.</span><span class="n">define</span> <span class="ss">:user</span> <span class="k">do</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span></div><div class='line' id='LC14'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">status</span>                              <span class="s2">&quot;New&quot;</span></div><div class='line' id='LC15'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">role</span>                                <span class="s2">&quot;Borrower&quot;</span></div><div class='line' id='LC16'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">sequence</span><span class="p">(</span><span class="ss">:name</span><span class="p">)</span>                     <span class="p">{</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="s2">&quot;user-</span><span class="si">#{</span><span class="n">n</span><span class="si">}</span><span class="s2">&quot;</span> <span class="p">}</span></div><div class='line' id='LC17'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">sequence</span><span class="p">(</span><span class="ss">:email</span><span class="p">)</span>                    <span class="p">{</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="s2">&quot;user-</span><span class="si">#{</span><span class="n">n</span><span class="si">}</span><span class="s2">@example.com&quot;</span> <span class="p">}</span></div><div class='line' id='LC18'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">sequence</span><span class="p">(</span><span class="ss">:password</span><span class="p">)</span>                 <span class="p">{</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="s2">&quot;foobar-</span><span class="si">#{</span><span class="n">n</span><span class="si">}</span><span class="s2">&quot;</span> <span class="p">}</span></div><div class='line' id='LC19'>&nbsp;&nbsp;<span class="n">f</span><span class="o">.</span><span class="n">sequence</span><span class="p">(</span><span class="ss">:password_confirmation</span><span class="p">)</span>    <span class="p">{</span> <span class="o">|</span><span class="n">n</span><span class="o">|</span> <span class="s2">&quot;foobar-</span><span class="si">#{</span><span class="n">n</span><span class="si">}</span><span class="s2">&quot;</span> <span class="p">}</span></div><div class='line' id='LC20'><span class="k">end</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'><span class="c1"># Step 3: Method call from spec files:</span></div><div class='line' id='LC23'><span class="vi">@user</span> <span class="o">=</span> <span class="no">Factory</span><span class="p">(</span><span class="ss">:user</span><span class="p">)</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/857452/2203cbee9be32846a75d20b7a32ef9c6a4df4d58/factories.rb" style="float:right;">view raw</a>
            <a href="https://gist.github.com/857452#file_factories.rb" style="float:right;margin-right:10px;color:#666">factories.rb</a>
            <a href="https://gist.github.com/857452">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/03/06/factories-rb-simple-as-1-2-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Efficient TDD: Session One Re-cap and Marakana Video Series</title>
		<link>http://www.fiveamsoftware.com/2011/03/01/efficient-tdd-marakana-video-series/</link>
		<comments>http://www.fiveamsoftware.com/2011/03/01/efficient-tdd-marakana-video-series/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 06:07:26 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=496</guid>
		<description><![CDATA[I am taking the Efficient TDD course taught by Wolfram Arnold and hosted by Blazing Cloud for the next 6 weeks, which covers best practices, RSpec, integration testing and advanced topic such as API testing. Marakana posted the video series &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/03/01/efficient-tdd-marakana-video-series/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I am taking the <a title="Efficient TDD course" href="http://classes.blazingcloud.net/courses/show/17/efficient-rails-test-driven-development">Efficient TDD course</a> taught by <a title="Wolfram Arnold" href="http://rubyfocus.biz">Wolfram Arnold</a> and hosted by Blazing Cloud for the next 6 weeks, which covers best practices, RSpec, integration testing and advanced topic such as API testing.</p>
<p>Marakana posted the <a title="video series" href="http://marakana.com/forums/ruby/ruby_on_rails/191.html">video series</a> of the course from the last time that it was taught in 2010. The course will come in handy for my consulting work for <a title="Varitan Capital Solutions" href="http://varitan.com/about">Varitan Capital Solutions</a>.</p>
<p>Session one got off to a quick start with RVM setup for everyone and writing our first set of stories (test cases) in RSpec:</p>
<div id="gist-850540" class="gist">
    <div class="gist-file">
      <div class="gist-meta">This Gist</a> has been deleted.</div>
    </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/03/01/efficient-tdd-marakana-video-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github Gist: App-template.rb</title>
		<link>http://www.fiveamsoftware.com/2011/03/01/github-gist-app-template-rb/</link>
		<comments>http://www.fiveamsoftware.com/2011/03/01/github-gist-app-template-rb/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 08:01:14 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=487</guid>
		<description><![CDATA[Here is a Rails generator file based on a gist by Blazing Cloud for creating RoR application templates in HAML, gemsets and git repository. Usage: Place in project directory and run &#8216;rails new &#60;app_name&#62; app-template.rb&#8217;.]]></description>
			<content:encoded><![CDATA[<p>Here is a Rails generator file based on a gist by <a title="Blazing Cloud" href="http://blazingcloud.net/">Blazing Cloud</a> for creating RoR application templates in HAML, gemsets and git repository.</p>
<p>Usage: Place in project directory and run &#8216;rails new &lt;app_name&gt; app-template.rb&#8217;.</p>
<div id="gist-847768" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c1"># app-template.rb</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="c1"># Developed by Blazing Cloud. </span></div><div class='line' id='LC4'><span class="c1"># Usage: Place in project directory and run &#39;rails new &lt;app_name&gt; app-template.rb&#39;.</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'><span class="n">rvmrc</span> <span class="o">=</span> <span class="o">&lt;&lt;-</span><span class="no">RVMRC</span></div><div class='line' id='LC7'><span class="sh">rvm gemset use #{app_name}</span></div><div class='line' id='LC8'><span class="no">RVMRC</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'><span class="n">create_file</span> <span class="s2">&quot;.rvmrc&quot;</span><span class="p">,</span> <span class="n">rvmrc</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'><span class="n">gem</span> <span class="s2">&quot;factory_girl_rails&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 1.0.0&quot;</span><span class="p">,</span> <span class="ss">:group</span> <span class="o">=&gt;</span> <span class="ss">:test</span></div><div class='line' id='LC13'><span class="n">gem</span> <span class="s2">&quot;factory_girl_generator&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 0.0.1&quot;</span><span class="p">,</span> <span class="ss">:group</span> <span class="o">=&gt;</span> <span class="o">[</span><span class="ss">:development</span><span class="p">,</span> <span class="ss">:test</span><span class="o">]</span></div><div class='line' id='LC14'><span class="n">gem</span> <span class="s2">&quot;haml-rails&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 0.3.4&quot;</span></div><div class='line' id='LC15'><span class="n">gem</span> <span class="s2">&quot;rspec-rails&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 2.2.1&quot;</span><span class="p">,</span> <span class="ss">:group</span> <span class="o">=&gt;</span> <span class="o">[</span><span class="ss">:development</span><span class="p">,</span> <span class="ss">:test</span><span class="o">]</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'><span class="n">generators</span> <span class="o">=</span> <span class="o">&lt;&lt;-</span><span class="no">GENERATORS</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'><span class="sh">config.generators do |g|</span></div><div class='line' id='LC20'><span class="sh">  g.test_framework :rspec, :fixture =&gt; true, :views =&gt; false</span></div><div class='line' id='LC21'><span class="sh">  g.integration_tool :rspec, :fixture =&gt; true, :views =&gt; true</span></div><div class='line' id='LC22'><span class="sh">  g.fixture_replacement :factory_girl, :dir =&gt; &#39;spec/factories&#39;</span></div><div class='line' id='LC23'><span class="sh">  g.template_engine :haml</span></div><div class='line' id='LC24'><span class="sh">end</span></div><div class='line' id='LC25'><br/></div><div class='line' id='LC26'><span class="no">GENERATORS</span></div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'><span class="n">application</span> <span class="n">generators</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'><span class="c1"># Comment back in for jQuery library.</span></div><div class='line' id='LC31'><span class="c1"># get &quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;,  &quot;public/javascripts/jquery.js&quot;</span></div><div class='line' id='LC32'><span class="c1"># get &quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js&quot;, &quot;public/javascripts/jquery-ui.js&quot;</span></div><div class='line' id='LC33'><span class="c1">#`curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js -o public/javascripts/rails.js`</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'><span class="n">gsub_file</span> <span class="s1">&#39;config/application.rb&#39;</span><span class="p">,</span> <span class="s1">&#39;config.action_view.javascript_expansions[:defaults] = %w()&#39;</span><span class="p">,</span> <span class="s1">&#39;config.action_view.javascript_expansions[:defaults] = %w(jquery.js jquery-ui.js rails.js)&#39;</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'><span class="n">layout</span> <span class="o">=</span> <span class="o">&lt;&lt;-</span><span class="no">LAYOUT</span></div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'><span class="sh">!!!</span></div><div class='line' id='LC40'><span class="sh">%html</span></div><div class='line' id='LC41'><span class="sh">  %head</span></div><div class='line' id='LC42'><span class="sh">    %title #{app_name.humanize}</span></div><div class='line' id='LC43'><span class="sh">    = stylesheet_link_tag :all</span></div><div class='line' id='LC44'><span class="sh">    = javascript_include_tag :defaults</span></div><div class='line' id='LC45'><span class="sh">    = csrf_meta_tag</span></div><div class='line' id='LC46'><span class="sh">  %body</span></div><div class='line' id='LC47'><span class="sh">    = yield</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'><span class="no">LAYOUT</span></div><div class='line' id='LC50'><br/></div><div class='line' id='LC51'><span class="n">remove_file</span> <span class="s2">&quot;app/views/layouts/application.html.erb&quot;</span></div><div class='line' id='LC52'><span class="n">create_file</span> <span class="s2">&quot;app/views/layouts/application.html.haml&quot;</span><span class="p">,</span> <span class="n">layout</span></div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'><span class="n">create_file</span> <span class="s2">&quot;log/.gitkeep&quot;</span></div><div class='line' id='LC55'><span class="n">create_file</span> <span class="s2">&quot;tmp/.gitkeep&quot;</span></div><div class='line' id='LC56'><br/></div><div class='line' id='LC57'><span class="n">git</span> <span class="ss">:init</span></div><div class='line' id='LC58'><span class="n">git</span> <span class="ss">:add</span> <span class="o">=&gt;</span> <span class="s2">&quot;.&quot;</span></div><div class='line' id='LC59'><br/></div><div class='line' id='LC60'><span class="n">docs</span> <span class="o">=</span> <span class="o">&lt;&lt;-</span><span class="no">DOCS</span></div><div class='line' id='LC61'><br/></div><div class='line' id='LC62'><span class="sh">Run the following commands to complete the setup of #{app_name.humanize}:</span></div><div class='line' id='LC63'><br/></div><div class='line' id='LC64'><span class="sh">% rvm gemset create #{app_name}</span></div><div class='line' id='LC65'><span class="sh">% cd #{app_name}</span></div><div class='line' id='LC66'><span class="sh">% gem install bundler</span></div><div class='line' id='LC67'><span class="sh">% bundle install</span></div><div class='line' id='LC68'><span class="sh">% script/rails generate rspec:install</span></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'><span class="no">DOCS</span></div><div class='line' id='LC71'><br/></div><div class='line' id='LC72'><span class="n">log</span> <span class="n">docs</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/847768/1b04d2eefaa01659d6c9edd330cb1d4e65a2c437/app-template.rb" style="float:right;">view raw</a>
            <a href="https://gist.github.com/847768#file_app_template.rb" style="float:right;margin-right:10px;color:#666">app-template.rb</a>
            <a href="https://gist.github.com/847768">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/03/01/github-gist-app-template-rb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Github Gist: Rvmrc, Factories.rb and Gemset for Testing</title>
		<link>http://www.fiveamsoftware.com/2011/02/28/github-gist-rvmrc-factories-rb-and-gemset-for-testing/</link>
		<comments>http://www.fiveamsoftware.com/2011/02/28/github-gist-rvmrc-factories-rb-and-gemset-for-testing/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 07:02:08 +0000</pubDate>
		<dc:creator>Highwayman</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.fiveamsoftware.com/?p=471</guid>
		<description><![CDATA[Here are several snippets of Ruby code I found useful and shared on Github Gists: Rvmrc, see also: http://rvm.beginrescueend.com/workflow/rvmrc: Factories.rb, see also: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md: Update on factories.rb for Rails 3 and RSpec 2, using Factory(:user) method call and sequences: Gemset for &#8230;<p class="read-more"><a href="http://www.fiveamsoftware.com/2011/02/28/github-gist-rvmrc-factories-rb-and-gemset-for-testing/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Here are several snippets of Ruby code I found useful and shared on Github Gists:</p>
<p>Rvmrc, see also: <a href="http://rvm.beginrescueend.com/workflow/rvmrc">http://rvm.beginrescueend.com/workflow/rvmrc</a>:</p>
<div id="gist-847020" class="gist">
    <div class="gist-file">
      <div class="gist-meta">This Gist</a> has been deleted.</div>
    </div>
</div>

<p>Factories.rb, see also: <a href="https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md">https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md</a>:</p>
<div id="gist-847007" class="gist">
    <div class="gist-file">
      <div class="gist-meta">This Gist</a> has been deleted.</div>
    </div>
</div>

<p>Update on factories.rb for Rails 3 and RSpec 2, using Factory(:user) method call and sequences:</p>
<div id="gist-856764" class="gist">
    <div class="gist-file">
      <div class="gist-meta">This Gist</a> has been deleted.</div>
    </div>
</div>

<p>Gemset for Testing:</p>
<div id="gist-847010" class="gist">
    <div class="gist-file">
      <div class="gist-meta">This Gist</a> has been deleted.</div>
    </div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.fiveamsoftware.com/2011/02/28/github-gist-rvmrc-factories-rb-and-gemset-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.fiveamsoftware.com @ 2012-02-22 12:55:19 by W3 Total Cache -->
