Quantcast
Channel: Kerry Buckley » Ruby
Browsing latest articles
Browse All 10 View Live

Rails 2.2 Envycast Review

I’ve been a fan of the RailsEnvy guys (Gregg Pollack and Jason Seifer) ever since their “Hi, I’m Ruby on Rails” spoof of the “I’m a Mac” ads, and have been listening to their podcast ever since. I even...

View Article



Image may be NSFW.
Clik here to view.

My (very!) small part in the Array#forty_two controversy

For those outside the Rails community who have no idea what I’m on about, some people got a bit upset about Rails 2.2 defining Array#second up to Array#tenth, so for example you can call foo.fifth...

View Article

API vs RSI

World’s-most-famous-twitterer Stephen Fry has a system for handling follow requests: you tweet using the #followmestephen hashtag, and he wades diligently through them, manually following people. This...

View Article

Helpful message from rspec

Just came across an interesting error message from rspec. I had a spec that looked like this: [ruby] it “should not mass-assign ‘confirmed’” do Blog.new(:confirmed => true).confirmed.should_not...

View Article

A couple of rspec mocking gotchas

Just a couple of things that have caused a bit of head-scratching lately when writing RSpec specs using the built-in mocking framework. Catching StandardError Watch out if the code you’re testing...

View Article


Naresh Jain’s refactoring teaser

Naresh Jain recently posted a refactoring teaser. The original code was in Java, but I thought I’d have a go at refactoring it in Ruby instead. I deliberately didn’t look at Naresh’s solution...

View Article

Comments aren’t always evil

I tend to agree that comments are, in most cases, evil (or at least mildly malevolent), but I did come across one of the exceptions to the rule today. While doing a bit of drive-by refactoring while...

View Article

Managing gems in a Rails project

Over the years I’ve tried a number of approaches for managing gem dependencies in a Rails project. Here’s a quick round-up of what I’ve tried, and the pros and cons of each. Just use what’s on the...

View Article


Memoised remote attribute readers for ActiveRecord

I was recently working with an ActiveRecord class that exposed some attributes retrieved from a remote API, rather than from the database. The rules for handling the remote attributes were as follows:...

View Article


Interesting little rSpec gotcha

This one had Adam and me stumped for a while. Trying to check that a method is only called on objects that respond to it: describe "Foo#call_all_the_things" do let(:foo_1) { stub :foo_1, bar: "hello" }...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images