I just released a gem that provides a nice little example of how to
take advantage of JRuby’s ability to use a Java library when it makes
sense. It’s not exactly a masterpiece, but it does demonstrate some
techniques that might be useful to other gem authors who are
interested in taking advantage of the JRuby platform when building
Ruby libraries around Java.
This would be really sweet as a rake task to add as part of creating a
war
file for deploying to an app server. We use YUI-compressor now in a
Java
only app and really love it. Another cool feature would be able to have
a
rails app automatically serve (and cache) the compressed Javascript and
CSS
in production, but just have the uncompressed served in Dev.
For anyone that uses something like JSMin, we found that YUI compressor
consistently yields higher compression levels and is completely safe. I
don’t think they’ve had to fix a bug in like 2 years.
One comment from me: don’t use autoload. It seems like it should work
well, but ultimately it introduces a subtle thread-safety issue into
your library.
The rest looks pretty good at a glance A nice example of how easy
it is to use Java libs from Ruby!