« Previous month (Jan 2007) | Main | Next month (Mar 2007) »

20070227 Tuesday February 27, 2007

Ruby Screenshot of the Week #5

Tim Bray just posted an entry on his first experiments with the Ruby and NetBeans support and in particular, talks about the syntax highlighting. I was already planning on spending this week's screenshot on the highlighting features, so I'll use Tim's ape.rb source code and show you a few more details:

Notice the following:

Regarding the color choices, I should point out that these colors are consistent with the new colors in the Java support in NetBeans 6 - parameters are orange, fields green, unused items gray, and so on.

In doing this screenshot I noticed a couple of bugs I'm off to fix now!

(2007-02-27 14:02:59.0) Permalink Comments [9]

20070220 Tuesday February 20, 2007

Ruby Screenshot of the Week #4

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!

(2007-02-20 17:34:23.0) Permalink Comments [10]

20070202 Friday February 02, 2007

Ruby Screenshot of the Week #3

Yes, the code is now in CVS. Please note that this is under active development. There are known bugs and instability. This is for early adopters only! As things get more stable we'll be making more official builds for a broader audience. I'll post a feature list here soon so you know what you can play with.

Did I mention that this may be unstable? Okay, good. I've posted screenshots here before, but remember that screenshots will show a particular case known to work, not a feature working in all conditions... Don't rush into this with high expectations. I will however be doing my best to fix bugs and add features. Please file bugs with Issuezilla in the scripting category with ruby as a sub category. Join the mailing lists to provide feedback and participate.

Did I mention that this is for early-adopter types only at this stage? Okay, good.

If you felt cheated by the above screenshot, here's another one. Can't remember the escapes in a Regular Expression? No problem!

This is not particular to regular expressions. Try it on dollar variables, or in literal strings. Here's another example:

(2007-02-02 13:53:31.0) Permalink Comments [9]