Author Archives: Andrew

Last night’s dream

I got off the tube and all of the walkways were drifting around, because they were suspended from the ceiling by rusty chains. I was the only person who had to lie down and crawl to the exit.

Posted in Ruby | Leave a comment

respond_to ordering still causing havoc with Internet Explorer 7

At least a year ago, I ran into this guy’s problem. Today, I just ran into a similar situation with Rails 3′s class-level respond_to / instance-level respond_with pattern.

Posted in Ruby | Tagged , | Leave a comment

Why is serving YUI3 over HTTPS so hard?

Yahoo! don’t have a HTTPS YUI3 endpoint. This means that you have to do some work to serve YUI3 if you want to avoid Internet Explorer users from getting warnings about mixed content (and you do). That work, for me … Continue reading

Posted in JavaScript | Tagged , , | 2 Comments

Resolving Cucumber step ambiguities

Following the latest campaign against imperative Cucumber stories in favour of declarative stories (see especially Dan North’s great article on domain languages), I’ve been trying to get more naturalistic language into my stories. However, it becomes very easy to run … Continue reading

Posted in Ruby | Tagged , , | Leave a comment

Make Solr / sunspot_rails, Cucumber and VCR bestest buddies

After spending the morning banging my head against another Cucumber problem, I thought the best way to spend an afternoon would be to run into another hilarious jape that Rails 3 threw at me.

Posted in Ruby | Tagged , | Leave a comment

Always define controller action methods in Rails 3

This morning was spent puzzling over a strange hard-to-reproduce Cucumber test failure in a project I have been upgrading from Rails 2.3.x to 3.0.3. It was only occurring after certain steps had been taken in previous Scenarios, and not when … Continue reading

Posted in Ruby | Tagged , | Leave a comment

ActiveRecord errors full_messages i18n incompatibility

If you’re running a Rails 2 app on a system with the latest i18n gem, ActiveRecord’s object.errors.full_messages spits out the string “{{attribute}} {{message}}”. You might notice that this is the old interpolation syntax for internationalisation in Rails 2. The latest … Continue reading

Posted in Ruby | Leave a comment

Notes on a Rails 3 upgrade

Most scary output from console is warning rather than error. RSpec 2 doesn’t have have_tag method. Now using webrat’s have_selector. Plugin to help with upgrade only relevant to Rails 2 project, which seems silly. Should use ‘extend ActiveModel::Naming’ in non-ActiveRecord … Continue reading

Posted in Ruby | Tagged | Leave a comment

Pong in HTML5 Canvas and YUI3, with tests!

In case you’re one of my clients, you might be wondering why I’ve been slacking off recently. Here’s why: I’ve been teaching myself ‘grown up’ JavaScript under instruction of Douglas Crockford (in book and video form, obviously). Crockford never mentions … Continue reading

Posted in JavaScript, Releases | Tagged , , , , , | 7 Comments

Setting 503 response code for Apache default virtual host

I know I promised my next post would be a tutorial on Chef, but this is kinda related. When new Rails servers are spinning up, I want Apache to respond to any requests with 503, both for SEO purposes in … Continue reading

Posted in DevOps | Tagged , | Leave a comment