Tor Norbye's Weblog

Ruby 1.9 has been released. It's a "development" version meaning that you wouldn't want to use it in production, but now is a good time to learn the new ways of doing things such that migrating to Ruby 2.0 will be easier.

Via Ruby Inside, I read
James Edward Gray's recent blog entry
detailing the work he did to update his library to 1.9 - and a number of people leaving comments are also pointing out language changes.

One such change mentioned is case/when statements not allowing colon as a separator. (I don't see this in Ruby Changes Wiki - does anyone have a source for this?). Seems like a a good candidate for a Ruby quickfix:

There are a couple of available fixes:

The first one is just replacing the colon with a then:

The second fix is instead putting the statement on a separate indented line:

Another language change I found in Sam Ruby's post is that you cannot write hashes as lists anymore. Here's a quickfix for that - first the code, this is from webrick's httpstatus class:

Ruby 1.8.5 would output "warning: colon will be obsoleted; use semicolon" if it came across one of these cases with warnings enabled, so this has been in the plans for a while. Surprisingly, 1.8.6 seems to have removed the warning.

"Replace : with ;" would be my preferred quickfix for this, although I'm sure many would disagree.

Hi Scott, thanks - I just checked in a fix (build #6103) which includes a third fix options for this hint which uses a semicolon as you suggested.

Hi Denis, yes, I agree - the problem is as you suspected in the editor infrastructure, but I was just meeting with some of those developers today who are visiting the area and they also want something like that so we'll try to address it soon.

Hi Freeman, thanks, I'll let Dylan know. Last I heard he was rewriting the HAML support from scratch which should make the features must more powerful, similar to the RHTML support.

Hi aph,
By "Is Reformatting in Ruby going to be fixed", are you referring to Ruby files (where I'm not aware of any problems), or problems in ERB/RHTML files? There are several known problems there which will be addressed soon.

Freeman, glad to hear HAML is working for you again.

Yared, sorry, that's a pretty vague question, but go to java.sun.com, I'm sure there are a lot of learning resources there.