I discovered an interesting difference between two patch levels of the same Ruby (1.8.7)

def index
 respond_to do |format|
  format.html {
   super # call the index method of the superclass
  }
 end
end

This does not produce an error in Ruby 1.8.7 patchlevel 72 (the one that happens to ship with Snow Leopard), but in Ruby patchlevel 249 (the most recent one), it tells me I’m not allowed to do this.

super called outside of method

If you think about it from an OOP perspective it actually makes a lot of sense that this would be illegal programming – super is being called from within a block that is passed to respond_to. So, although the intended meaning appears clear from the way the code is written, the Ruby devs probably saw this as something that should be prohibited and fixed Ruby to make it so. Hence, apps written by programmers unaware of this using earlier patch levels may see this after upgrading to the latest Ruby 1.8.7

By Jason