Removing framework clutter from autotest failure stacktraces

If you’re programming in Ruby, then in the list of “should be’s” is “using autotest“, assuming you’re doing automated testing, which of course is a giant “should be”. One problem if you’re using a bunch of gems or Rails is that their code works and yours is broken but the failure stacktraces you’re reading contain their method names mixed in with yours. 99% of the time this is distracting. So, using some code from Faisal that did the same thing with an older version of Autotest but doesn’t work in the latest release, I hacked up the code to help remove unwanted text from Autotest test output. And now I present it to you.
Continue reading “Removing framework clutter from autotest failure stacktraces”

Hacking rake:stats to get gross LOC

Web App Autopsy has some juicy metrics such as the 100:10:1 ratio of anonymous visitors to free registered users to paying users. But they also have LOC counts which seem quite high, and which include things that rake:stats (a Rake task that’s part of Rails, which counts lines of source code and provides some basic analysis) doesn’t count. So, I hacked rake:stats to include them. Here’s what I did:
Continue reading “Hacking rake:stats to get gross LOC”

First Rails gotcha: Rails doesn’t tear down fixture data

Rails doesn’t delete loaded fixtures in the tear down phase of tests, but it does delete and re-insert the fixtures you do use at the beginning of tests. This is a serious problem if you use foreign keys.

This issue is covered in the Rails issue tracker here:
Continue reading “First Rails gotcha: Rails doesn’t tear down fixture data”

Ruby Deeper Impressions

For two weeks (ending on this past Wednesday afternoon), most of my days and nights were occupied with a self-administered crash course in the Ruby programming language, outside of the Rails framework. I had struggled somewhat with Objective-C in January, partly because of the massive combined burden of learning the language, the Cocoa framework, the Xcode IDE, and the odd but brilliant Interface Builder. So, I wanted to try and attack Ruby in isolation.
Continue reading “Ruby Deeper Impressions”

Ruby First Impressions: Backup Scripting

I started programming in Ruby this week, and so far I like it a lot. From my initial use of Ruby as a backup automation scripting language, here are my thoughts.

You might be wondering, why am I working on backup scripting now? Don’t I have some big project I’m supposed to be working on 24/7? Yes, and actually this work is in the critical path of that project.

My super fast laptop is still away being repaired for a video problem, so I’ve taken a major hit in terms of the resources of my main computer: 90% less MHz, 36% less display area, 50% less memory. In the meantime, I’ve been avoiding tasks that need a lot of CPU or graphics performance and instead working on things that are easier on my old desktop computer.

This week, I decided that I would pause working on the design and implementation of my startup project, until I had really sorted out my server backup and monitoring situation.
Continue reading “Ruby First Impressions: Backup Scripting”