Recent Posts

Seattle in late March

February 20, 2007

I’m going to be hanging out in Redmond, WA. late next month… why? That… I’ll explain at a later date. ;-)

What I can say is that I’ll be available on a few evenings if anybody is interested in meeting up to talk shop, which can include anything from d3, ruby on rails, bdd, agile interaction design. to BBC comedy shows. :-)

I’ll be flying up from Portland to Seattle on Saturday, March 24th. I’m going to try and stay downtown for that night… and then will be staying at Sheraton Bellevue until Tuesday night. So… Saturday-Monday nights are currently open.

I’m also planning to head to the monthly Seattle.rb meeting on Tuesday, March 27th.

If you’re interested in meeting up, drop me a line.

UPDATE If you’re taking the kinky aspect of BDD too serious. please don’t email me. ;-)

On Apologies

February 15, 2007

Recently, Seth Godin posted a short blog post, titled, Apologies, ranked, which points out several ways of apologizing. When you work in a service industry, it becomes very important to develop good apology skills. Let’s be honest for a moment. Not everything works out for the best in every customer experience. Sometimes it’s their fault and many times… it’s our fault.

In response to Seth’s post, Marc Chung has written up a similar post that adapts this to software bugs, titled, Seth on Fixing Bugs.

It’s worth a read and definitely relates to the communication issues that we keep talking about within the Dialogue-Driven Development community and how that can translate to a healthy testing process with BDD.

Thoughts?

Get to Know a Gem: Hpricot

February 13, 2007

In this new series, Get to Know a Gem, we’re going to take a look at hpricot.

What is Hpricot?

WhyTheLuckyStiff released Hpricot in July of 2006 in an effort to bring fast HTML parsing to the masses. It’s currently unknown what prompted it, but my guess would be that Why is secretly scraping all the pages on the internet that archive the future. To speed it up, Why has written the Hpricot scanner in C, to be much faster than the other options available in Ruby.

Installation

This process… is as always with most gems, very simple.

Be Careful that you don't Stub your Big Toe

February 13, 2007

In a project that I’m currently working on, we’re handling recurring payments for subscribers. I’ve decided to play with a different payment service API on this project (TrustCommerce), which supposedly has one of the easier systems to handle recurring payments as well as one-time charges to the same credit cards. They store all the credit card data so that our delivered product to the client is CISP-compliant.

I came across the TrustCommerce Subscription plugin for Rails, which does just everything that I need to do in this first product release… as well as things that aren’t requirements just yet.

Well, I got my test account from TrustCommerce and was working on some RSpecs to test my new subscription and noticed that it was failing. After some snooping around the error responses, I realized that… test accounts don’t give you the ability to test the Citadel features of TrustCommerce. It’ll be another week or so before finish getting our account setup, so what am I to do? I really want to finish writing these specs and move on to the other portions that are dependent upon this working.

Suppose that you were going to perform something like this in an AR callback.

Poke My Brain

February 12, 2007

I’m working on a few blog articles that I’ll be posting over the next few weeks. The other day, I got another email from someone that asked me if I would write about something that I mentioned briefly in a blog post. This got me thinking… perhaps there are things that you’d like me write something on? In general, I try to keep a broad range of topics that relate to Ruby/Rails circulating and I’m planning a major overhaul to my blog (switch to mephisto in the near future?) and working on more tutorials, especially as we near the release of my book as a O’Reilly Rough Cut… and when it finally makes it to print. :-)

If there is something that you’d like to learn more about (Rails, business, agile…), feel free to drop an email to suggestions@robbyonrails.com.

Gems Gone Wild!

February 12, 2007

Mike Clark is offering everyone[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”} in the Ruby community Mardis Gras beads… in exchange for showing everyone your sexy gems. Chad and Bryan showed us theirs, so I figured it was my turn to show you all what I’ve been hiding beneath this shell.

Sharing Custom TextMate Bundles with Subversion

February 11, 2007

Early last year, I began to start creating a bunch of snippets and such for TextMate, all of which were lost several months ago due to Hurricane iSight. I recently decided to start building some again, especially some that sped up my RSpec writing. After creating a few, I wondered, “would anybody else on my team want to help me write some?” So, I thought that it was time to figure out how to share my bundle with others and allow them to add stuff to it… which seems like a good job for Ms. Subversion.

I couldn’t find a quick walk-through online and found myself in the #textmate IRC channel getting proper instructions. (thank you Allan)

Create Your Bundle

In TextMate, you can open up the Bundle Editor and create a new bundle. Let’s call our custom bundle, RSpec. Go ahead and begin adding some snippets, commands, etc to your new custom bundle. Once you have something in your Bundle, you’ll want to reload your bundles, by going to Bundles > Bundle Editor > Reload Bundles. This will write your new bundle to disk to ~/Library/Application\ Support/TextMate/Bundles/.

Extending ActionController, part two

February 09, 2007

One of our consulting clients consists of a team of .NET developers that are rewriting a rather large product in Ruby on Rails. Every once in a while they have a problem that needs a second set of eyes to look over in order to find a solution with Rails. One of their developers recently asked how they could extend ActionController to provide all of their controllers with an action that would interact with a custom extension they built for ActiveRecord.

One of the few examples that he found to help them do this was a short blog post that I wrote nearly two years ago, titled, Extending ActionController. Given that I wouldn’t do it that way anymore, I felt that I’d quickly post an updated way of doing something similar.

Create Your Extension

This is when you get to take advantage of that lonely lib/ directory in your Rails application. We’ll go ahead and save our custom extension as lib/giraffe_actioncontroller_ext.rb. Now let’s put some code in there.

5{width=”240” height=”181” style=”border: 2px solid #333;”}

Looking at the following example, you’ll notice that we’re creating a basic Ruby module, which contains a method named, hot_air_balloon. Within that method, we can do just about anything that we’d normally do in an controller action.

Is BDD kinkier than TDD?

February 08, 2007

If you’re in need of a compelling reason to switch from Test-Driven Development to Behavior-Driven Development. consider this.

“BDD sounds kinkier.” -Michael K. Loukides, Book Editor for O’Reilly

…on that bombshell… I am going to suggest that this be used as the official BDD logo.

There you have it. Deep down… the biggest reason that I switched from Test::Unit to RSpec. was the sex appeal. ;-)

What was your reason?

Goodbye Instiki, Hello JunebugWiki

February 06, 2007

If you’ve spent much time on the Ruby on Rails wiki, you know that the spam situation smells like rotten fruit.

We’ve been using Instiki, the same software as the Rails wiki for the PLANET ARGON Documentation Project and the spam situation was becoming an annoyance. So, we’ve switched to JunebugWiki as step one, to see how it holds up. The default styling was a nice improvement because we haven’t had much chance to update the instiki one. It might not solve all of our spam problems, but in the short term, it appears to be a more elegant solution. It’s also the first application built with camping that I have personally deployed.

So… I present to you… the new PLANET ARGON Documentation Project.

In other news, it appears that RubyURL has caught the eye of spammers, which sucks. I’m still thinking over a few possible ways to try and prevent that. :-/