Ruby 1.9 Support
By Erno Mononen on Apr 16, 2009
Over the past few weeks I've been working on a couple of editing infrastucture related tasks, one of them being switching our parser to use Tom Enebo's jruby-parser project instead of the patched JRuby we used previously. This brings us, among other things, support for Ruby 1.9. Of course, it has been possible to use 1.9 with NB even before, but it wasn't possible to use any new 1.9 syntax without having syntax errors in the editor. The steps for enabling 1.9 support in NB depends on whether you use JRuby or MRI. For JRuby, you need a recent enough version that supports 1.9 -- best to get the latest release, 1.2.0 (note that we already bundle 1.2.0 in 6.7 dev builds). Second, you need to switch JRuby to 1.9 mode, which you can do by using the
-Djruby.compat.version=RUBY1_9switch. If you have a plain Ruby project, you can add it to the JVM Arguments field in Project Properties -> Run. For a Rails project, you need to add
path_to_your_project dir/nbproject/project.properties.(Obviously, there needs to be a more user friendly way to do this). Note that if you want to run JRuby in 1.9 mode from the command line, it is as easy as
jruby --1.9 ...If you use MRI, it is enough to point the project to use a MRI 1.9 platform and the parser will be switched to the 1.9 mode automatically. Now, time for a screenshot of the 1.9 parser in action (see e.g. this document for changes in 1.9): The notable thing in the above screenshot is of course the lack of error stripes in the editor. As always, please give it a try and let me know how it works for you (see here for instructions on how to get a dev build). Also, please note the debugging support for 1.9 is still not there.