Space Vatican

Ramblings of a curious coder

A Small Difference Between 1.9.2 and 1.9.3

I was looking at moving an application to ruby 1.9.3 and was getting some strange syntax errors along the lines of syntax error, unexpected keyword_do_block on code that was working fine on 1.9.2. I spend quite a few minutes staring at the code which looked completely benign.

It turns out the ruby 1.9.2 is a bit too permissive: it allows you to write an extra comma after your argument list but before the do that marks the start of your block.

1
2
3
  some_method arg1, arg2, do
    ...
  end

ruby 1.9.3 on the other hand won’t accept this.