JRuby compatibility - replace popen with a tempfile #12

Merged
merged 2 commits into from Jul 28, 2011

Projects

None yet

3 participants

Contributor
kares commented Apr 25, 2011

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.

Owner

The patch looks good -- can you make sure that it unlinks (deletes) the tempfile after it's done with it?

Contributor
kares commented May 26, 2011

That should to it, thanks for the review.

+1 for merge. Need JRuby support.

Owner

Whoops ... sorry to have left this on the floor. @kares: for the record, what evironments have you tested this patch on?

Contributor
kares commented Jul 28, 2011

@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)

Contributor
kares commented Jul 28, 2011

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)

@jashkenas jashkenas merged commit 3e4d763 into documentcloud:master Jul 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment