sstephenson / ruby-yui-compressor

A Ruby interface to YUI Compressor for minifying JavaScript and CSS assets.
217 stars 57 forks source link

Better warning when you don't have java installed #1

Closed jwheare closed 11 years ago

jwheare commented 14 years ago

At the moment you just get the "compression failed" RuntimeError in the compress method.

If you poke that exception a bit more it says there was a Broken Pipe error in the Open3.popen3(*command) call which you can then trace to the @command in initialize to see that the java call is failing.

This took me a little while as I'm not that familiar with ruby, and didn't really understand what that popen3 command was doing.

Maybe at a test for java that raises a more descriptive exception earlier on?

tfln commented 14 years ago

seconded. Thanks for the solution :)

anuaimi commented 13 years ago

all that is probably required is to add a puts with the exception message. that is how I found out why the compression was failing (in regards to another issue).

      rescue Exception => e
        puts e.message
        raise RuntimeError, "compression failed"
stevecrozz commented 11 years ago

This issue should be resolved now. I added my comments on https://github.com/sstephenson/ruby-yui-compressor/pull/20