What Makes the Hassle Worthwhile

Apr 2, 2012 10:34 PM

Tags: domino ruby

I've been toying with my Ruby servlet a bit this evening and it didn't take long to start having some fun. For example, here's a snippet from a page I'm building with Markaby, which is an aging little library that makes building HTML pages declaratively a cinch:

$database.views.sort { |a, b| a.name <=> b.name }.each do |view|
li { a view.name } unless view.name =~ /^\(.*\)$/
end

That prints out the names of all the non-hidden views in the database, sorted alphabetically, inside an HTML list. That's barely scratching the surface and not often useful, of course, but it's a proof of concept.. Server JavaScript can do some cool things, but the required syntax makes it a classless language by comparison.

I also realized earlier today that the same idea here can be translated to writing agents in Ruby by creating them as Java agents and putting the Ruby code in attached Resource files. It's a BIT of a hassle, in that I can't use the WebDAV trick to edit the scripts with TextMate, and it seems like I have to manually rebuild the agent whenever I change the script file, but that's not too bad. I'll probably try it out on some non-critical agents on my dev server to see if there are any critical memory issues.

Next step: figuring out this newfangled OSGi doohickey.

Commenter Photo

Tim Tripcony - Apr 3, 2012 12:47 AM

I've been following your efforts, and would be curious to see the work you've already done ported to a JSF EL Resolver, perhaps via JRuby... this would allow developers to use Ruby expressions in their XPage applications. Any interest in attempting this?

Commenter Photo

Jesse Gallagher - Apr 3, 2012 10:07 AM

Oh, I'm definitely interested. I've shied away from wading into the JSF runtime so far, though, at least until I get more comfortable with the plumbing. I'll give it a shot eventually, since getting it to work well would be immediately practical.

New Comment