Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Author Archives: Mike Gunderloy

By Mike Gunderloy / November 19, 2008

Testing is a firmly ingrained part of the Ruby culture: you probably ran across Test::Unit not long after you first started writing Ruby code (though it wouldn’t be surprising if you ignored it for a while). But it hasn’t been a static part of Ruby – we’ve seen the simple availability of tests evolve into test-driven development (TDD) that in turn gave rise to behavior-driven development (BDD). Along the way, Ruby has spawned a variety of testing tools and frameworks. The latest, Aslak Hellesoy’s Cucumber, is the latest addition to the RSpec family of tools.

Cucumber is designed to allow you to execute feature documentation written in plain text (often known as “stories”). Read More

By Mike Gunderloy / November 12, 2008

iciclesAnyone building up a project with many dependencies – and in the Ruby community, with so much functionality wrapped up in gems and plugins, it’s hard to imagine not having external dependencies! – must face the issue of managing the situation in source code control. How do you maintain everything you need in your own repository, while still being able to update your dependencies from their own repository? How do you set things up so you can even contribute to the projects you depend on?

If you’re using git, the right answer is often the subtree merge strategy – but remembering the necessary commands can be a nuisance, especially if you rarely use them. Read More

By Mike Gunderloy / November 7, 2008

hercules-and-atlas.gif We’ve all heard the admonitions: “Don’t Repeat Yourself!” But how do you avoid this if you’re working on a Ruby codebase that stretches to thousands of lines, maintained by multiple developers? One answer is to run a tool that looks for duplicate code. This is an area where good tools are tantalizingly close – there are at least three out there that are worth checking out:

Towelie

The first contender is Giles Bowkett’s Towelie, which uses parsetree and ruby2ruby to look through a set of files searching for duplicates. Unfortunately, Towelie in its current state was unable to handle my test case (the Active Record subtree of Rails), persistently erroring somewhere in parsetree. Read More