Wednesday, March 28, 2007

Ruby Screenshot of the Week #7

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.






Since I cheated last week, I'll make up for it by posting several screenshots this week.



First: The continuous builds on deadlock.nbextras.org are back up and running. One of the things you'll find there is a Ruby-only slimmed down version of NetBeans. This might be attractive for those of you who are used to editing Ruby and think of IDEs as overkill. The download is not tiny, but that's because it includes a full installation of JRuby as well as Ruby On Rails and all its supporting libraries. Perhaps we can create a configuration which doesn't JRuby and Rails, since the tool is also perfectly happy to use any existing installations of Ruby and Rails you might point it at.



The configuration is experimental, so menu items etc. might not always be ordered correctly. But if you're a Ruby-only programmer, you'll find it less crowded than the full-featured IDE, and a faster download.



I've tried to improve the Rails support lately, since I've gotten lots of feedback from developers using NetBeans+Ruby with Rails.



Rails projects now have a "Rake Target" action, which is a pull right menu. The pull right shows, hierarchically, all the rake targets available for the project. The target descriptions, if any, are shown as tooltips. Recently executed targets are listed before the hierarchical list of available targets. (Determining the set of targets for the UI is expensive, so it is not kept up to date automatically. There is therefore an explicit user action for refreshing the list when you have edited your Rakefiles or have installed software which adds available targets.)






Database migrations are supported in a similar way. There is a "Migrate Database" context menu (as you can see above). It's a pull right menu which lets you choose either to migrate to the current version, or a specific version (the IDE lists versions that it finds in the migrations directory). You can also "run" any of your migrations files (Shift-F6), and this will run the corresponding migrations target with the version number of the migrations file.



Rails supports lots of additional code generators, performing tasks from generating login pages to localizations and sparklines. The Generator action is now fully aware of generator plugins. They show up in the generator drop down, and usage information is displayed for all generators right there, inlined in the generator dialog. In addition, there is an action for quickly installing more code generators in the Gem Manager.






I just integrated support for running the Mongrel web server, which is popular with many Rails developers. All you need to do now is install Mongrel via the Gem Manager and run your application.






Finally, it's been a few weeks since I added it, but it's useful enough to point out in case you missed it: There is a command for jumping from actions to views and back (Ctrl-Shift-View). It's in the Go To context menu as well.


Saturday, March 24, 2007

nbextras.org is down

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.


Several people have pinged me about this so I thought I would post a blog entry on it:



The machine which was running nbextras.org is down because of hardware failure. It's at home with Trung now who's fixing it. Not sure when it will go back to the ISP and be back online.



The Ruby IDE Installation Instructions refer to kits from deadlock.nbextras.org. You'll have to use the other option for now - the Daily Update Center. It's lagging a bit behind the most recently integrated changes, which unfortunately means it doesn't have the latest and greatest.



I've uploaded a custom build of version 0.45 here (9.3 Mb). It's the contents within the ruby1 cluster. This means that you unzip this content in your user directory (if you've been installing the Ruby support from the update center in the past), or inside the ruby1 cluster in your IDE installation (if you've been downloading full kits from nbextras.org), or inside the extra/ cluster (if you're using an older version of the IDE where ruby1 isn't in the included clusters list, or if you were installing into a separate cluster directory referenced from your netbeans.conf). (By the time you reach this, the Daily Update center may have caught up, so check that option first. The version number on the update center is displayed in the dialog when you select the Ruby feature module.)



One of the new features you'll find (added yesterday) is an enhancement to the occurrences highlighting. Now, if you place the cursor on the declaration line for a method, the exit points for the method are highlighted: the last statement, any return statements, any yield statements, and any raise or fail calls.





Posse Roundup Pictures

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.


Here's a few photos from the Java Posse Roundup 2007.














Here's some of the posters we had on the wall - one for each day, segmented by the different rooms and
timeslots. People could convene talks by writing a topic on a post-it; some of these would get shuffled around.







We had "Lightning Talks" in the evenings - a topic of your choice, limited to 5 minutes.














Here are some photos from the lightning talks.







Joel Neely is talking about the different algorithms
used to spacing between letters in typography, using "Java Posse" as an example.














Here's Joe and Carl. At one point the powerstrip next to my feet had 8 identical Mac power adapters plugged into it...







In the afternoons, we'd go up to the world class skiing slopes in Crested Butte.





Finally, if you listened to episode 10x, you might be curious why Carl and Dick couldn't keep a straight face while listening to Joe - because they suddenly found a jackalope starting down at them:







Tuesday, March 20, 2007

Ruby Screenshot of the Week #6

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.


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.



Zzzz


Wednesday, March 14, 2007

NetBeans+Ruby Wiki Documents Available

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.


I have added a number of Ruby Documents to the NetBeans wiki.
You can now find a feature list, as well as instructions for both how to download and install the Ruby support as well as how to build it from scratch. And of course, the todo list!



Perhaps most important to those of you using the Ruby builds is the Recent Changes document, where I try to summarize important changes that are checked in.
As you can see, in the last week, the long startup indexing delays are gone, and code completion is smarter - it now tracks types of variables and fields in local scope - plus it better handles singleton classes.



If you haven't tried the Ruby support yet, the Installation document might be helpful.


Wednesday, March 7, 2007

Skiing

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.





I've spent this week at the Java Posse Roundup 2007 in Crested Butte, Colorado. It's been just amazing. Obviously, the afternoon skiing has been fantastic, but more importantly, the conference itself exceeded all my expectations. It's an Unconference, which is quite different from normal conferences. I certainly had some scepticism that it would be productive, but boy was I wrong. Everyone else I have talked to have had similar experiences. Basically, everyone who showed up has had a lot to contribute, so in the various sessions I've learned a lot and it's been very stimulating and inspiring. We have recorded everything and will be releasing the audio over the next few months, so you can hear for yourselves. But obviously, being part of the conversation is a lot more engaging.



Anyway, it does mean that I've taken a brief pause from my Ruby IDE work. I promise I'll get back to it next week! I have however tracked down one bug - the bug with launched JRuby processes (webrick servers etc.) not getting killed and accumulating on your system. If you're not aware of this bug - check your process list occasionally, and kill orphan ones. Fix coming soon to an update center near you.


Monday, March 5, 2007

NetBeans+Ruby Demos

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.


Roman has created two excellent demos of the new NetBeans + Ruby support. The first one shows Rails support, the second gets into editing. Let me me point out that until now, my focus has been on editing - so the Rails support is very preliminary. The interesting features are in the editing area, but as the Rails demo shows, if you're building a Rails application you should be able to get your work done. (There is an open bug pertaining to process management - launched Ruby processes aren't always killed by the IDE, so keep an eye on your process list for older processes. Yes, it will be fixed!)



Here's a quick hint, since it's not really obvious from the IDE: Use Shift F6 early and often. It "runs" the current file. For a unit test, that will run the tests. In a Rails app, it will open the browser on the "relevant" URL. For example, if you're editing a controller, or a view, or a helper, it will show the associated view.



I recently added a new feature to the editor you can play with: Smart Selection. Press Ctrl-Shift-Up/Down (on the Mac, Command-Shift up/down). It will select progressively larger code blocks based on the parse tree. Within a comment, it first selects the line, then the whole comment block.



Finally, I just integrated a Ruby Gem Manager (available from the Tools menu). This lets you easily see which Ruby gems you have installed, and more importantly upgrade them or install new ones. This assumes there is a gem command next to your Ruby interpreter, which is the case for the bundled JRuby, but maybe not if you're configured NetBeans to run with whatever you have installed in /usr/.



Here's a screenshot of the initial screen - my locally installed gems:






Here's what you get when you click on Install New:






Actually, if you just press Install New you see a much larger list - all available gems. You can filter down the list by typing in the Filter field - regular expressions are okay. Here I've typed rails to see any gems that have "rails" in the name or description.



I'm writing this from San Francisco international airport - I'm waiting for my flight out to Denver for the
Posse Roundup 2007. It's going to be a fantastic week - technical talks, skiing, and of course I'm excited to see the unveiling of Josh Marinacci and Robert Cooper's project.
With all the attention around the Ruby work this week it's bad timing to go off the grid, but at least I can leave by pointing out that this is an open source project, all the code is available and if there's a fatal bug in there, somebody can find it and fix it! Have a great week - I know I will.



P.S. I've seen lots of blog entries around the NetBeans Ruby support lately - thank you all for trying it out and writing about it. I found
this Ruby IDE comparison particularly
interesting.