ruby, rails, textmate, automation, etc.

Notes from the Ruby Manor (part 2)

Posted on November 23, 2008

So this is Ruby Manor part 2. After the Ruby Manor morning session we had a tasty pub lunch, rocked up a little late, and settled down to an interesting afternoon of Ruby talks…

Again, the errors and omissions are mine.

Notes from the Ruby Manor

Posted on November 22, 2008

I’m lucky enough to be at RubyManor today; a Ruby conference organised by Ruby users, for Ruby users, costing the grand total of twelve of your British pounds. A bargain, as you’ll see if you check the lineup of talks and speakers.

I started making notes, but it seems to have evolved into some kind of blog post. Apologies for typos, crap grammar and glaring errors.

Optimising PNG images for the web

Posted on November 17, 2008

Stoyan Stefanov has recently written an interesting series of articles on optimising image files for the web. In his latest article he shows how to use pngcrush to safely shrink your files, one file at a time:

$ pngcrush -rem alla -brute -reduce src.png dest.png

This evening I found myself wanting to repeat that command for all the PNG files in my current directory, and then (having reviewed the new images) overwrite the originals. Rather than do it by hand I did what all pragmatic programmers do these days, and wrote a script. Here it is in action:

$ pngcrushall 
Crushing test4012.png ... ok
Crushing test9200a.png ... ok
Crushing test9200b.png ... ok
Overwrite original files? (y/N) y
Overwriting test4012.png ... ok
Overwriting test9200a.png ... ok
Overwriting test9200b.png ... ok

You can get it from github – download pngcrushall.

Obviously you’ll need to install pngcrush too. On a Mac this is pretty easy with MacPorts:

$ sudo port install pngcrush

Integration Testing for Multiple Web Applications – Introducing Integral

Posted on November 11, 2008

I’ve recently been developing a Rails app that relies on a database that is maintained by another team as part of a different application. As you can imagine, unexpected changes to the database schema can bring our Rails app to it’s knees if they’re deployed to the live server before our application is updated.

So far we’ve been lucky, but the issue has been at the back of our minds for a while. So this week I sat down and cooked up a solution, and we’ve called it Integral.

Integral consists of some Thor tasks that:

  • Run tests on your test server.
  • Keep track of which versions of your applications work well together.
  • Can be integrated into your deployment recipes to ensure that deploying an app should never break your live server again…

All the Integral code is on github, and I’ve written some fairly extensive documentation on the Wiki. Please try it out, give us some feedback, fork it, burn it, give us some feedback, etc. etc.