Ruby Screenshot of the Week #6

I just realized last night that the session slides for my Java One talk are due today! So I did a marathon session, starting at 6am this morning, putting it all together. I just submitted the slides, with a whole 4 minutes to spare before the midnight deadline. That's 18 hours straight with just a short dinner break. Phew.

So I'm going to cheat for this week's Ruby screenshot. Take a look at the following picture; it shows two new NetBeans 6 features applied to Ruby: Local editing file history (with version diffing), and the brand new diff view. I've long thought that the Mac OSX XCode filemerging window reigned supreme, but with the new smooth spline curves and even character diffing within lines, I have a new favorite! This file is not under version control - the local file history feature tracks local edits and lets you diff auto-saved versions.

Full size

I know this is cheating since all I did was bring up a Ruby editor on non-Ruby related functionality. But there have actually been some great improvements in the Ruby support in the last week. First, the Ruby debugger support has landed! Second, native Ruby execution should now be working finally on Unix, including with Rails. There are some other changes too (plus some pending one I'm about to check in). Check the wiki for installation instructions - to get fast debugging you'll need to perform some manual steps.



Cripes, that's downright beautiful!

It's gotta be slow. Tell me it's slow. I want to want it less. : )

Posted by Gulli on March 20, 2007 at 08:21 PM PDT #

Hi Tor,

I know that local history feature is going to be really useful. I just found the "Go To Action/View" shortcut as well which makes me very happy.

A couple of quick questions: Are we going to have a shortcut to the relevant test classes from our controllers and models? And, are you going to support .rjs files in a Rails project?

Posted by james on March 20, 2007 at 11:38 PM PDT #

Nice curves! Is there talk of getting block selection within the IDE?

Posted by Casper on March 21, 2007 at 02:30 AM PDT #

Hi Gulli - actually, it's not slow at all (at least not on my system). Try it!

Hi James - Do you have any specific ideas on how the shortcuts to the tests should work? At one point I was thinking a single key combination could cycle through controller -> helper -> test -> view -> controller.... But maybe that's just annoying. Another possibility is to have a single "test" navigation action, like the action/view which would toggle between them. That should be helpful in non-Rails Ruby projects as well (although unlike JUnit and Rails I'm not sure there's a clean way to find unit tests for a class when they're not embedded in the class.

I'll have to look into .rjs support.

Posted by Tor Norbye on March 21, 2007 at 09:49 AM PDT #

Hi Casper, by "block selection" do you mean rectangular selection, or AST-based ("smart") selection? If the latter - that's in NetBeans 6. (I've added it for Ruby as well). Ctrl-Shift-Up/Down. If it's rectangular selection, I don't know - I've never needed it, but I believe Sandip's line tools module does something like it.

Posted by Tor Norbye on March 21, 2007 at 09:55 AM PDT #

Hello Tor! First: Thanks for such a wonderful Ruby-IDE! I've used NB for Java (of course), C and now - finally - Ruby development! Great - one IDE for all platforms (it's Java, ey?). But i am not able to get the AST-based "smart" selection working in NB on WinXP SP2 (Info: all available Ruby updates are applied; NetBeans IDE Dev (Build 200702191730), 1.5.0_11; Java; HotSpot(TM) Client VM 1.5.0_11-b03; Windows XP version 5.1 running on x86 de_DE (nb); Cp1252). Any hints? Greetings, Andreas

Posted by andreas on March 21, 2007 at 08:36 PM PDT #

Hi Andreas, I think I said the wrong keybinding - on Windows it may be Alt-Shift-Up/Down, not Ctrl-Shift-Up/Down. (Let me know if that still does not work.)

Posted by Tor Norbye on March 22, 2007 at 05:16 AM PDT #

Hello Tor!

Thanks, that's the right combination for Windows.
PLEASE keep up the superb work!

Best regards,

Posted by andreas on March 22, 2007 at 06:56 AM PDT #

Those curves look like their borrowed from meld (

Posted by guest on March 22, 2007 at 12:12 PM PDT #

Hi Tor

Cycling through all controllers/models/views/tests would be a pain :)

I know that radrails/aptana uses ctrl+shift+T as the shortcut to take you through to the relevant test, mapping views and controllers to the appropriate functional tests and models to their unit tests. You may have trouble making the shortcut more fine grained that simply opening the relevant file as there could be many test cases for a particular action/view. Although for functional tests you could jump to the first occurrence of an action request like:

get :new or post :my_non_crud_ajax_widget

You also have the situation where views are not always .rhtml files. Is it possible to bind a shortcut to anything within a particular view directory to the appropriate test? Then the shortcut would work in .rss/.atom/.rjs/.xml/.my_new_microformat files as well.

Another rather neat little action in radrails is the ability to extract a portion of a view to a partial, bound by Ctrl+Alt+X. This simply cuts the highlighted code from your view and asks you for the name of your partial before creating the new file - beginning with an underscore - and pasting the code into it.

Posted by james hoskins on March 22, 2007 at 07:50 PM PDT #

Thanks for all the great Ruby support work Tor!

Posted by Si on March 25, 2007 at 02:46 AM PDT #

Post a Comment:
Comments are closed for this entry.

Tor Norbye


« August 2016