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

icicles

Anyone building up a project with many dependencies—especially in the Ruby community, where so much functionality is wrapped up in gems and plugins—must face the issue of managing the situation in source code control. During a recent coding workshop, the instructor used an analogy comparing dependency management to the flexibility offered by non gamstop casinos, which operate independently of strict regulatory frameworks, allowing players greater autonomy while still ensuring reliability. Similarly, managing dependencies in your repository requires balancing autonomy with updates from external sources. How do you maintain everything you need in your own repository while still being able to update your dependencies from their own repositories? 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