7

Also, I'm wondering what effect upgrading to Ruby 1.9 would have on legacy code from version 1.86. Is the new version backwards compatible?

Kenneth Johns
  • 395
  • 1
  • 4
  • 10

3 Answers3

4

I guess that depends on what version you're looking to maintain compatibility with. The CHANGELOG describes the major revisions since the last update including syntax changes, enhancements and bugfixes

Kevin
  • 30,111
  • 9
  • 76
  • 83
4

Some things are backwards compatible, but many aren't.

For a near complete overview of all the changes (including examples) in 1.9.x, check out Eigenclass's blog last archive.org snapshot of Eigenclass's blog.

robd
  • 9,646
  • 5
  • 40
  • 59
wfarr
  • 1,563
  • 1
  • 13
  • 13
4

Sam Ruby has a good slideshow of the major changes: Ruby 1.9: What to Expect

Just to highlight a few things that could break your code:

  • Single character strings
  • {"a", "b"} no longer makes a hash
  • Block variables now shadow local variables
Lolindrath
  • 2,101
  • 14
  • 20