Vita Rara: A Life Uncommon


Very Excited about Goliath


I've spent a bit of my free time over the last two weeks or so reading about Goliath from the Post Rank guys. Basically Goliath and the supporting libraries are an evented framework without the pain of evented code.

My Programming Tools


A friend of mine wrote up a list of the tools he uses on a regular basis. Sometimes it's good to see what others are using to get ideas, confirmation, etc. So, here's my list.


I currently work on two machines. I have an original Mac Pro 2.66GHz Quad Xeon running OS X Leopard for my workstation with a 30" and a 23" display. This provides a lot of real estate for working. I only got the 30" after my wife put me in front of it at the Apple store and asked me how I'd use it. Up until then I thought 30" was too big. Then I got the 23" to go with it.

My second machine is a new 15" Mac Book Pro i7 with the hi-res anti-glare screen and 8GB of RAM running Snow Leopard. I went with the regular 500GB drive rather than the solid state drive. The price delta for the solid state was too much for me to justify. I really love the greater resolution of the new screen and the anti-glare ROCKS! I wish it was standard.

Get the Running Version of Groovy

Categories: |

This isn't documented in the Javadoc. (There is not javadoc on this method.) It seems to return the running version of Groovy when called:


Helpful if you really need to know.

New iMac: Great Pairing Station?

Categories: | |

Looking at the new iMacs the 27" quad-core looks like it would make a superb pairing station for programming. I've been waiting to see what the update looked like before looking at end of year purchases. Here's how I see it:

Rspec & Shoulda: Specifying the Object Under Test

Categories: | |

Today we needed to test conditional validations on a model. We're using RSpec with the Shoulda macros to do this. Our model looks something like:

Just Say You're Sorry Already

Categories: |

As many know Matt, known as the Merbist, presented a risque set of slides at GoGaRuCo comparing software developers to porn stars. I'll leave as an act to the interested finding the slides.

The presentation somewhat, but the reaction of Matt and some other Rails leaders, DHH in particular, to the reactions of those who were offended by the presentation has engendered an uproar of significant proportions. On April 28th Matt posted his public response to the controversy, and later followed up with the following on twitter: "I obviously made a mistake. I didn't mean to offend anyone but since I did, I failed." Which he also posted to his blog as a followup to his previous public statement.

Shoulda: should_validate_uniqueness_of

Categories: | | |

When testing an ActiveRecord model that validates_uniqueness_of using Shoulda's should_validate_uniqueness_of macro it needs to be wrapped in a context where an instance of the model is created in the database. If there is no record in the database to validate against you'll get an error.

For more information see: Lighthouse Ticket.

Testing Non-Ruby Applications with Cucumber

Categories: | | | | |

Yesterday we got Cucumber working to test an older J2EE application that uses EJB 2.1 for its persistence layer. This application because of the J2EE EJB 2.1 beans has been very hard to near impossible to test in the past. I've been hearing about Cucumber for a while and we decided it was time to take a deeper look.

We plan on adding new features to this application using Rails, and over time porting the existing functionality to Rails. So, having a test suite written in Ruby that can test the application regardless of the underlying implementation was necessary. Cucumber with Webrat to the rescue. The general outline below will work with web applications written in any language. All of the interaction with the application happens at the HTTP protocol level.

Hpricot to Nokogiri Day 1

Categories: | |

Nokogiri's #xpath != Hpricot's #xpath

In Hpricot you can call xpath on a node to get the XPath that will retrieve that node from the document. In Nokogiri that equivalent is path.

I ran into this trying to figure out the xpath to a node in an HTML document. My normal routine is to load up the document in IRB and poke around to find the things I need.

Refactoring: Introduce Local Extension in Ruby

Categories: | |

I was recently reading Martin Fowler's Refactoring. While I was reading Introduce Local Extension (p. 164) all I could think of was how simple it is to implement in Ruby.


As Fowler says in the motivation section writers of classes and libraries are not omniscient. Inevitably some class that you're using will be missing some feature you want. Using Introduce Local Extension you can add that additional functionality when you need it.

In a statically typed language, like Java, this refactoring would involve creating either a wrapping class or a descendent of the original class. In Ruby we will accomplish the same thing using a mixin.

Syndicate content