Tuesday, February 20, 2007

Ruby Screenshot of the Week #4

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.

If you try code completion on any complicated arbitrary expression, it will show you a number of possible method completions along with the corresponding class. This gives you much the same information as ri:

However, in many contexts, we know the exact type. For example, if you type File. and invoke code completion, NetBeans will show you only the singleton methods of class File (as well as inherited methods and module mixins):

In some cases, we know more than just the class - we know that we're dealing with an instance of that object. In that case we can show all the instance methods too - not just the class methods:

Here's we're applying code completion on a regular expression literal.

This works for all kinds of literals in your code - Strings, regular expressions (shown above), arrays (try [1,2,3].e to see the each method and its documentation for example), hashes, symbols, numbers, ... you can even try it on the "nil" keyword!


  1. Excellent! I guess I can't expect you to do the same for Python by next week? :)

  2. I was getting impatient for the next installment of your Ruby on NB effort. Always an exciting read.
    I tried to get the Ruby modules from CVS but it did not work for me. It would be great if you or someone else were to post a quick how-to to do the same.
    BTW, I know of people who are impatient for an awesome Ruby IDE but don't even know of the NB effort or don't read this blog. My point is, if I could get it to run, I would get major geek points from my buddies. Puhleeze.....

  3. Romain,
    I have had some success downloading daily windows builds from:
    If that's any help.

  4. I haven't really announced this yet because I'm still shaking out bugs - for example, on Windows there are still problems with spaces-in-path for Rails (I just committed a change last night (hopefully shows up on the update center at some point today) which makes normal Ruby projects work on Windows.) But yes, the Daily Update Center should mostly work at this point. If you run into issues, hop onto dev@scripting.netbeans.org.

  5. Finally, someone has provided the link to download the IDE. THANK YOU SO MUCH!!
    Tor, do you mind letting us know when this awesome project will get finalized? Is there a roadmap where I can check on?
    Thanks for all your work!

  6. [Trackback] Tor Norbye is doing a great job integrating a Ruby module on the development version of Netbeans. Since I’m still on the look for my definitive Ruby IDE, I decided to take a look at it, and all I can say is that I liked it very, very much. Never ...

  7. Hey, Tor!
    Thank you very much for the great job! Now, the screenshots you place here are much cooler than my interface here at home. Is it just because you are using Mac, or you are using a theme for Netbeans (if such thing exists - I'm a netbeans newbie)? thanks

  8. It's the Mac - it has beautiful fonts that are rendered beautifully.

  9. Excellent work! I tried NetBeans 6.0M7 + Ruby.
    But a little problem, the lib director of my rails project seems to be ignored by indexing and in project tree list.

  10. Thanks dcaoyuan. I've just checked in a fix for this - lib is now shown and indexed. Keep the bug reports coming! (on dev@scripting.netbeans.org, or via issuezilla, or via e-mail to me.).
    The fix should be in version 0.17.0 of the Rails project module. I just checked in a fix so theoretically within 24 hours the daily update center should have it, although I have seen longer delays (lots of stuff is built and if something is broken not everything else gets updated.)