Friday, January 25, 2008

Aloha Color Theme for NetBeans 6

UPDATE: The Aloha theme is included in the Extra Ruby Themes module
for NetBeans.

UPDATE: Go get the new version for NB 6.1 here.

UPDATE: I've started looking into updating the theme for NB 6.1 (due out in a few days) I'll create a new post and link to the download once it's complete. Thanks for your patience.

I've been giving NetBeans 6 a try lately and I'm enjoying it very much... but I really like the color themes available for TextMate. I'm not a big fan of the defaults and I wanted something different... so I started looking. The Ruby Dark Pastels theme by Jerrett Taylor comes with a plugin download, I found this theme called Fade to Grey by Brasten Sager and then I stumbled upon this color theme by Carmelyne Thompson. The theme Carmelyne created was what I was looking for with a few tweaks. And since I do work with a lot of different file types, I wanted to make sure most if not all the file types held the color theme. So after a few tweaks and writing something to help me create my NetBeans Module file... here are the results:

Aloha Color Theme for NetBeans

Aloha Look






NetBeans Go get NB 6.1 and use the theme on this page instead!!! NetBeans

After the download, open NetBeans and go to Tools > Plugins. In the Download tab, add the AlohaTheme.nbm and install. To use it, just select it from the Fonts & Colors profile "Aloha."

I can't get the CSS to stop painting the keywords neon blue and it can be a little hard on the eyes... if anyone knows how to fix this, please let me know.

Thursday, January 24, 2008

Small, portable http proxy for windows

This is a short one, mostly so I don't forget where to find this tool later.

I needed to monitor some SOAP traffic and do some debugging... just wanted something small, won't take over my work laptop (Win XP) and just show me the HTTP messages raw. Enter TcpTrace, a small footprint http proxy that comes in handy when you need to do some troubleshooting at that level.  Great for junior folks to actually learn something about HTTP protocol and for sticking on your thumb drive and taking with you.

This tool is for windows only, there are plenty for *nix out there... what's your favorite?

Wednesday, January 9, 2008

JRuby / Ruby Continuous Integration with Hudson

Hudson is a great tool for your continuous integration needs. It's very easy to setup and can run/monitor multiple types of tasks. Some have used it for Python and this blog entry will show you how to get Hudson setup quickly for running your Ruby or JRuby tests. (including reporting)

(This step-by-step is assuming you have Java installed on the machine you are using.)

First we'll need to download Hudson here and start our Hudson instance: (just grab the latest stable release)
[sourcecode language='css']
java -jar hudson.war
(see Hudson site for other deployment options.)

Next, grab the CI::Reporter gem we'll need for test results xml formatting :
[sourcecode language='css']
gem install -y ci_reporter
OR for JRuby
jruby -S gem install -y ci_reporter

UPDATE: Make sure you insert the following lines in your Rakefile:
[sourcecode language='ruby']
require rubygems
gem ci_reporter
require ci/reporter/rake/test_unit

Hit your running Hudson instance: http://localhost:8080/ and configure a new build by clicking the "New Job" link. Enter the name of your build and select the "Build a free-style software project" (click OK.)

Configure your SCM data, then scroll down to the "Build" section and select either "Execute Windows batch command" (windows) or "Execute shell" (*nix). This is where we'll call our 'rake test' task using the CI::Reporter gem and specifying a spot for the report XMLs to live:
[sourcecode language='css']
//rake ci:setup:testunit test CI_REPORTS=results
OR for JRuby
//jruby -S rake ci:setup:testunit test CI_REPORTS=results

UPDATE: When using Subversion, it will check things out into a sub directory of your "workspace" (found ~<user running hudson>/.hudson/jobs/<your job name>/workspace) If you are checking out 'trunk' and don't specify a different name for the directory, your shell execution settings should look like this:
(be sure to know how your SCM works before applying the following)
[sourcecode language='ruby']
cd trunk
//rake ci:setup:testunit test CI_REPORTS=results

This will setup the CI::Reporter and place the XMLs in the "results" directory for us.

We are almost done, now under the "Post-build Actions" section, check the "Publish JUnit test result report" box and enter the following in the "Test report XMLs" field:
[sourcecode language='css']

Now click Save and go test it out... Select your newly created job from the Dashboard.

Click the "Build Now" link... done. After a few builds you should see a graph on the job's main page that looks like this:

If you have a failure, you can drill down by clicking the "Test Result" link on an individual build's page.

Clicking on an individual failed test's name will show you the output from that failure

That's all it takes, pretty simple and works like a charm. Now you can go back and play with the other settings Hudson has, triggers, scheduling, job artifacts, notifications... you could even have a job that prepares a build by generating all your static content so your server doesn't have to take the initial hit after startup. (web projects)

If interested, there is a way to create plugins for Hudson.

Tuesday, January 8, 2008

Latest JRuby release is faster

The latest JRuby release (Jruby 1.1RC1) improves on the past numbers showing the recent push for speed. I have been out of the loop for a while but am not surprised to see these improvements.

But speed was not the only thing happening in the JRuby camp lately :
- 143 issues resolved since JRuby 1.1b1
- Landing of Java port of Oniguruma (Joni)
- Most Posix methods supported (e.g. stat, kill, getuid)
- Latest Rubygems 1.0.1, RSpec 1.1.1, and Rake 0.8.1 gems
- Updated standard library to be Ruby 1.8.6 compatible

more details here

Makes one wonder... with JRuby's speed increases, Java integration (remember Java is everywhere) and a great tooling story... when does JRuby replace Rhino as an alternate pre-packaged language in the JDK? (or the JRE for that matter?)