<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Hashrocket =&gt; Blog</title>
    <link>http://www.hashrocket.com/blog/</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:creator>les@hashrocket.com</dc:creator>
    <dc:rights>Copyright 2008</dc:rights>
    <dc:date>2008-07-02T12:35:00-05:00</dc:date>
    <admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
    

    <item>
      <title>RSpec 1.1.4 and Helper Specs</title>
      <link>http://www.hashrocket.com/blog/comments/rspec_114_and_helper_specs/</link>
      <guid>http://www.hashrocket.com/blog/comments/rspec_114_and_helper_specs/#When:12:35:00Z</guid>
      <description><![CDATA[<p>Last week, RSpec 1.1.4 was released; and given my optimistic disposition I immediately upgraded.  Happily, the upgrade was almost seamless.  Two interdependent issues kept this from being a flawless upgrade:</p>


	<ol>
	<li>A new deprecation warning on our helper specs (<em>no one really likes to see deprecation warnings</em>)</li>
		<li>A bug in the new way to write helper specs (<em>a show stopper</em>)</li>
	</ol>


	<p>Lets see what happens when we run our spec<sup><a href="#fn1">1</a></sup>.</p>


	<pre><code>Wonderland$ spec spec/helpers/dog_helper_spec.rb 
Modules will no longer be automatically included in RSpec version 1.1.4.  Called from ./spec/helpers/dog_helper_spec.rb:8
.Modules will no longer be automatically included in RSpec version 1.1.4.  Called from ./spec/helpers/dog_helper_spec.rb:16
.
Finished in 0.393129 seconds
2 examples, 0 failures</code></pre>


	<p>So, what does this deprecation warning tell us?  Lets examine the helper spec that generated these warnings:</p>


<pre>
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe DogHelper do

  describe "name_or_description()" do
    it "should return a description for a dog without a name" do
      dog = mock_model(Dog, :name =&gt; nil, :sex =&gt; 'male', :breed =&gt; 'Labrador', :color =&gt; 'black')
      name_or_description(dog).should == "(male Labrador, black)" 
    end
  end

  describe "owner_link()" do
    it "should return a link to the owner" do
      owner = mock_model(User, :login =&gt; 'sally_smith', :to_param =&gt; 'sally_smith')
      dog = mock_model(Dog, :owner =&gt; owner)
      owner_link(dog).should =~ /users\/sally_smith/
    end
  end
end
</pre>

	<p>We are being warned that calls to <strong>name_or_description</strong> and <strong>owner_link</strong>, which are called on the implicit <strong>self</strong> of the RSpec <em>it</em> blocks, are going to fail in the future when the helper module (<strong>DogHelper</strong> in this example) is no longer automatically included by RSpec.</p>


	<p>Or put another way, calling helper methods like <strong>name_or_description</strong> directly, <em>exactly as one might in a view</em>, will no longer work.</p>


	<p>The new way to call helper methods is through the <strong>helper</strong> attribute of RSpec, giving access to an <strong>ActionView::Base</strong> instance with the helper module included.  Lets go ahead and make this change to our two helper calls:</p>


<pre>
      helper.name_or_description(dog).should == "(male Labrador, black)" 
</pre>
<pre>
      helper.owner_link(dog).should =~ /users\/sally_smith/
</pre>

	<p>Lets try this out!</p>


	<pre><code>Wonderland$ spec spec/helpers/dog_helper_spec.rb 
.F
1)
NoMethodError in 'DogHelper owner_link() should return a link to the owner'
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.url_for
(eval):17:in `user_path'
/Users/leshill/src/rails/rspec114/app/helpers/dog_helper.rb:9:in `owner_link'
./spec/helpers/dog_helper_spec.rb:16:
Finished in 0.398686 seconds
2 examples, 1 failure</code></pre>


	<p>Hmmm, we have gotten rid of the deprecation warnings, but we now have a new (and truly unexpected!) failure.</p>


	<p>This is a bona-fide bug in 1.1.4, and might lead to our having to rollback to 1.1.3 if there was no easy workaround.  A quick search on the <a href="http://www.github.com">github</a> repository and there is a fix already available for 1.1.5.</p>


	<p>Lets adapt that fix, and use it within our own specs.  Add this <strong>before</strong> block to our spec:</p>


<pre>
  before(:each) do
    # Patch until 1.1.5
    helper_controller = @controller
    helper.instance_eval { @controller = helper_controller }
  end
</pre>

	<p>And then try it out:</p>


	<pre><code>Wonderland$ spec spec/helpers/dog_helper_spec.rb 
..
Finished in 0.40663 seconds
2 examples, 0 failures</code></pre>


	<p>Much better!</p>


	<p id="fn1"><sup>1</sup> I am using a mock spec to demonstrate the issue, the minimal Rails app which fits around this spec is left as an exercise for the reader.</p>
]]></description>
      <dc:subject>Code</dc:subject>
      <dc:date>2008-07-02T12:35:00-05:00</dc:date>
    </item>

    <item>
      <title>Crummy &#45; Tasty Breadcrumbs Plugin</title>
      <link>http://www.hashrocket.com/blog/comments/crummy_breadcrumbs/</link>
      <guid>http://www.hashrocket.com/blog/comments/crummy_breadcrumbs/#When:16:04:00Z</guid>
      <description><![CDATA[<p>I have worked on many applications that require breadcrumbs. Every time, one of the developers has built a quick custom solution. Finally, I decided that we needed a complete solution that we could easily add to future projects, and thus <a href="http://github.com/zachinglis/crummy/">Crummy</a> was born.</p>

<h3>Requirements</h3>

<p>I set a few requirements that must be fulfilled in order for me to call the plugin a success. They were:</p>

<ul>
  <li>Ability to add breadcrumbs at Controller class level (like a before filter)</li>
  <li>Ability to add breadcrumbs in the controller methods (such as actions)</li>
  <li>Ability to add breadcrumbs from the views</li>
  <li>Ability to add breadcrumbs with or without an url</li>
  <li>No variable conflicts (such as instance variables)</li>
  <li>Full and strong spec coverage</li>
  <li>Good documentation</li>
</ul>

<p>I managed to fulfill these requirements and add a few shiny methods to make life easy.</p>

<h3>Examples of Usage</h3>

<code>
  <pre>
    class ApplicationController < ActionController::Baseee
      add_crumb 'Home', '/' # This will display on EVERY list of breadcrumbs
    end
  </pre>
</code>
<code>
  <pre>
    class BusinessController < ApplicationController
      # The load order DOES matter.
      add_crumb("Businesses") { |instance| instance.send :businesses_path } # Show on all actions
      add_crumb("Comments", :only => [:comments, :show]) { |instance| instance.send :business_comments_path } # Only add the comments link on the comments and show actions.
      before_filter :load_comment, :only => "show"

      def show
       add_crumb @business.display_name, @business
      end

      def load_comment
       @comment = Comment.find(params[:id])
      end
    end
  </pre>
</code>

<h3>Golden Feature</h3>

One of the most useful argument usage is <code>add_crumb :comment</code>. What this does is turns the symbol into an instance variable (<code>@comment</code>.) Then it roughly translates into:
<code><pre>
  # add_crumb :comment
  before_filter :add_comment_breadcrumb
  def add_comment_breadcrumb
    add_crumb @comment.to_s, @comment
  end
</pre></code>


<h4>Installation</h4>

<code>script/plugin install git://github.com/zachinglis/crummy.git</code>

]]></description>
      <dc:subject>Open Source</dc:subject>
      <dc:date>2008-06-30T16:04:00-05:00</dc:date>
    </item>

    <item>
      <title>RubyJax: Jacksonville&#8217;s Ruby and Rails User Group</title>
      <link>http://www.hashrocket.com/blog/comments/rubyjax/</link>
      <guid>http://www.hashrocket.com/blog/comments/rubyjax/#When:20:32:01Z</guid>
      <description><![CDATA[<p><a href="http://www.rubyjax.com/">RubyJax</a>, the Ruby and Rails user group for Jacksonville, FL, is a monthly get-together with one or more presentations. Pizza and refreshments always accompany the awesome line-up of topics and presenters. 
  Past topics include Advanced Active Record, jQuery, RSpec and Amazon EC2.
  
<p>The group is populated with lovable characters from the local Ruby community like Steven Bristol of 
  <a href="http://www.lesseverything.com/">Less Everything</a>, our own <a href="http://www.obiefernandez.com/">Obie Fernandez</a> 
  (author of The Rails Way) and a collection really smart tech people who've embraced Ruby for all the right reasons. Defectors
  from Java, ColdFusion, .Net, and PHP can be found at each meeting.</p>

<p>RubyJax members are also active in the <a href="http://groups.google.com/group/rubyjax/">mailing list</a> and <a href="http://www.rubyjax.com/2007/11/20/rubyjax-on-irc-freenode-net/">IRC channel</a></p>

<p>Meetings are typically held the third Thursday of each month but, as the group is made up of entrepreneurs, self-employed, and family people life 
  tends to intervene and move the occasional meeting. To make sure you find us check out the <a href="http://www.google.com/calendar/render?cid=4l89gdt6toa7ub2io9p6tgpfi8%40group.calendar.google.com">group calendar</a>.
  
]]></description>
      <dc:subject>Hashrocket News, Jacksonville, Technology</dc:subject>
      <dc:date>2008-06-13T20:32:01-05:00</dc:date>
    </item>

    <item>
      <title>3&#45;2&#45;1 Feedback</title>
      <link>http://www.hashrocket.com/blog/comments/3_2_1_feedback/</link>
      <guid>http://www.hashrocket.com/blog/comments/3_2_1_feedback/#When:15:11:00Z</guid>
      <description><![CDATA[<p>We've been pretty excited about the feedback we've received so far on our flagship product offering, <a href="http://www.hashrocket.com/products">3-2-1 Launch</a>. It seems as though a lot of people are getting on board with the idea of rapid-fire, super-focused development. Sure, we've had a few "that's crazy, dudes" or "you must be smoking a hashrocket," but we've also had dozens of inquiries from enthusiastic folks who want help getting off on the right foot.</p>

<p>And we're not offering the unattainable. <b>3-2-1 Launch</b> is about beginning with a set of reasonable mutual expectations, working swiftly and building a great 1.0 version of a site in three days. Our theory is that working within such a short time frame will force quick, efficient decision making, thereby eliminating the extraneous, clunky development that we see so much of these days. For a client, this means getting a solid and fertile site foundation in the first go-around.</p>

<p>Soon, we'll be adding an FAQ page to answer all of your questions about the <b>3-2-1 Launch</b> process. Until then, keep 'em comin', Gleep-Glop. ]]></description>
      <dc:subject>Hashrocket News</dc:subject>
      <dc:date>2008-02-06T15:11:00-05:00</dc:date>
    </item>

    <item>
      <title>Hashrocket Takes Off, or: How I Learned to Stop Worrying and Love Bad Rocketry Lingo</title>
      <link>http://www.hashrocket.com/blog/comments/hashrocket_takes_off_or_how_i_learned_to_stop_worrying_and_love_bad_rocketr/</link>
      <guid>http://www.hashrocket.com/blog/comments/hashrocket_takes_off_or_how_i_learned_to_stop_worrying_and_love_bad_rocketr/#When:00:14:00Z</guid>
      <description><![CDATA[<p>Thanks to a lot of hard work from the Hashrocket team and our friends at <a href="http://www.ngenworks.com">nGen Works</a>, hashrocket.com launches today!</p>

<p>We’re all pretty excited about this, as the site’s launch represents not only months and months of team discussions, brainstorming and planning, but also hours of grueling, drunken hot-tubbery and thousands of hard-fought ping-pong matches. Needless to say, there is a price for success that this team is willing to pay.</p>

<p>Our official press release is forthcoming so I’ll spare you the gory details on our product offerings. We do, however, have a few projects in the works that we think are pretty cool: <a href="http://www.clean-undies.com">clean-undies.com</a> is an emergency contact list service that allows you to post your “in case of emergency” instructions and contact info to a website that your friends and family can access. <a href="http://www.citycliq.com">CityCliq.com</a>, our enhanced Yellow Pages site, has been in the testing phase for about a month now and will be entering its second iteration soon.</p>

<p>So, between these sites and our upcoming projects, things are looking good. We’ll be sure to keep you posted on all of our project and team news as things happen.</p>

<p>Cheers!<br />
<strong>Hashrocket</strong></p>]]></description>
      <dc:subject>Hashrocket News</dc:subject>
      <dc:date>2008-01-17T00:14:00-05:00</dc:date>
    </item>

    
    </channel>
</rss>