It's a bit shamy closure-compiler does not work on JRuby (due to fork).
Now the #10 is not the right way as the compiler Java code does a System.exit once done and thus it'll exit the current JVM process which is not desired.
If the popen is replaced with a Tempfile that is passed as a --js argument while invoking the compiler using "`" it works nicely on JRuby as well as Ruby + no Windows hustle necessary.
use Temfile instead of POpen piping (for JRuby compatibility)
The patch looks good -- can you make sure that it unlinks (deletes) the tempfile after it's done with it?
ensure tempfile is deleted
That should to it, thanks for the review.
+1 for merge. Need JRuby support.
Whoops ... sorry to have left this on the floor. @kares: for the record, what evironments have you tested this patch on?
@jashkenas i've only tested on linux, test pass for me using the following rubies:
ruby 1.8.7 (2011-02-18 patchlevel 334)
ruby 1.9.2p180 (2011-02-18 revision 30909)
jruby 1.6.2 (ruby-1.8.7-p330)
just to be sure I installed ruby on a vm with win7.
all test passed with ruby 1.8.7 (2011-02-18 patchlevel 334)