Posts tagged 'jruby'



JRuby on Roller

This is just a quick follow-up to my previous post on Pluggable renderers and scripting languages in Roller. It took me a while, but I finally made JRuby code work inside a Roller page template. Here's an example JRuby page template that displays most recent blog titles and text in HTML format.

$out.println "<html><head>"
$out.println "<title>#{$model.weblog.name}</title>"
$out.println "</head><body>"
$out.println "<h1>#{$model.weblog.name}</h1>"
$model.weblogEntriesPager.entries.keySet().each {|day|
   $model.weblogEntriesPager.entries.get(day).each {|entry|
      $out.println "<h3>#{entry.title}</h3>"
      $out.println "<p>#{entry.text}</p>"
   }
}
$out.println "</body></html>"

Not the most beautiful thing in the world, I must admit. Any JRuby experts reading along? Is there a simple templating solution that will work in JRuby... something like Groovy Templates? And is there a way to map puts output to a java.io.Writer that will work via BSF?

Pluggable renderers and scripting languages in Roller

My next ApacheCon talk is about Roller and blogs as a web development platform. One of the things I plan to discuss is using scripting languages within Roller, something that's possible now because Roller versions 3.0 and later supports pluggable renderers. It's undocumented and a little hacky right now, but by plugging in your own custom renderers you can add support for new template and scripting languages as alternatives to Roller's built-in Velocity. Want to know more? [Read More]

JRuby on the JavaPosse

Interested in the JRuby project? Then you should check out the JavaPosse podcast interview with JRuby developers Charles Nutter and Thomas Enebo. They cover project status, JRuby vs. CRuby, Ruby on Rails on the JVM and their new jobs at Sun.