Rulers gem from the book Rebuilding Rails.