JRuby actions in JPublish
As some of you already know, JPublish can execute actions written in JRuby. This is all possible through the magic of the BSF :)
I received a lot of questions about how can a JRuby Action use the java objects available in the JPublishContext?
There's nothing simpler than that, in JPublish is easy :) Below is the body of a JRuby Action which will print a message to the designated console log and will populate the page context with the variable "hello". The variable "hello" will be accessible to Velocity or Freemarker during the post action execution rendering process.
HelloJRuby.rb
require 'java'
$syslog.info("HelloJRuby.rb action ...")
$context.put("hello", "Hello World!")
Simple, eh? Use the dollar sign in front of the variables you expect to find in the context.
Also, there is a recent web site with a lot of JRuby news and tips, check it out in case you're interested. Is called JRuby Inside.
Cheers!
James Strachan's favorite Mac applications
James has a nice list of Mac applications and I am using most of them. However, there is one missing: ChocoFlop, a CoreImage-based, realtime, non-destructive, high dynamic range Image and Photo Editing Application for Mac OS X.
Some of ChocoFlop's features:
- Very fast launch time (about 1 or 2 second on cheapest mac mini)
- Written from scratch for Mac OS X 10.4+
- No legacy or compatibility slow code
- Uses all hardware acceleration (CPU and GPU)
- Universal binary for PowerPC and Intel
- Uses CoreImage and custom OpenGL code.
- The download is about one megabyte (zipped) so far and will remain in that range (translation will probably increase this).
Yup, I am using it with no problems and BTW, ChocoFlop and Flop.ca are not related :)
