The Source for Java Technology Collaboration
User: Password:



Gregg Sporar's Blog

November 2007 Archives


Ruby Tuesday

Posted by gsporar on November 16, 2007 at 10:21 AM | Permalink | Comments (0)

Key disclaimer: I am not a Ruby expert. These days I am mostly a Java guy, but I am learning Ruby. And enjoying it. My interest in it dates back to before any support was added to the NetBeans IDE for doing Ruby development.

Once the support was added it was nice to be able to have things like code completion and some refactoring features, etc. Back in September I did a quick 10-minute demo of some of the Ruby support at the Lone Star Ruby Conference. I also met Keith Lancaster, the founder of the Houston Ruby and Rails User Group.

Keith invited me to do a presentation and that's how I ended up in Houston on a Tuesday night showing the Ruby and Rails features of the NetBeans IDE. It was a lot of fun - a very interactive session with many questions. Doing these sorts of presentations/demos is the best part of my job and one of the reasons I like it so much is that I end up learning new things along the way.

There were some questions that I could not answer, so after I got back home I got some answers from Tor Norbye, one of the developers of the Ruby support in NetBeans. Brian suggested I add the questions and answers to the NetBeans Ruby FAQ, which I have done. (Side note: the main NetBeans Ruby wiki page also has some great info. as does the main documentation page.)

  • What's with the contents of ruby1/rubystubs?
    These stub methods are used by the IDE regardless of which Ruby interpreter you have configured. That's where I got confused - in my haste I misread the path which is why I had mistakenly thought these files were in the JRuby directory. More details here.

  • Is there automated support for creating the self.down method of a Rails migration?
    Unfortunately, for now the answer is no.

  • Can the IDE's generate dialog also run the Rails "delete" operations?
    Unfortunately, again the answer is no, but this will hopefully be fixed soon.

  • Is there a way to turn off the "logical" Project view on Rails projects?
    This is a good example of where I learned something new. Most of the attendees would prefer that the IDE's Project tab display something flatter - more like the way its Files tab displays a Rails project. I did not realize that option was available, but it is. :-)

  • Is there a default keyboard shortcut for the Rails generate dialog?
    This is a bit tricky.... If you right-click a Rails project the context menu includes an entry called "Generate" which brings up a dialog that provides easy access to the Rails generator scripts. There is no keyboard shortcut listed for that context menu entry. You can add one easily enough, however, it turns out that there is a default keyboard shortcut available when you are editing a .rb file in a Rails project.

  • How can I run IRB with native Ruby?
    In NetBeans IDE 6.0, you cannot run the IRB shell with native Ruby - it always uses the JRuby that is bundled with the IDE. In newer daily builds, however, there is a workaround.

The answer to that last question about IRB brings up an interesting point. The feature set in NetBeans IDE 6.0 is frozen - the final bits will be available in just a few weeks. Work continues, however, on new features. Some of those new features will eventually be put on the beta update center (choose Tools > Plugins within the IDE to install plugins from an update center). But if you want to live on the edge, you can always install a nightly build. Or if you really want to be on the edge - install a build with just the Ruby pack from the continuous build server.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds