Closed jwilsonsprings closed 14 years ago
Oh man ... I know this problem only too well. It's extremely difficult, using the Ruby standard library, to read the exit status, as well as stdout and stderr from a child process, and to do in on Windows as well as Nix. The ruby-yui-compressor
gem simply ignores stderr and failed compilation. I had to jump through hoops with the closure-compiler
gem, in order to get a nearly cross-plaform version of popen
to work:
http://github.com/documentcloud/closure-compiler/blob/master/lib/closure/popen.rb
So, I'd say that the easy fix would be to use the Closure Compiler instead, which will throw an exception with the syntax error and line number. You can use it by adding a line to the top of your assets.yml
.
javascript_compressor: closure
I've pinged sstephenson about the YUI Compressor error problem before, but he didn't write back. Your other option is to open a ruby-yui-compressor
ticket to get it fixed.
First, love this package. Second, I noticed while integrating this with my site, I made a typo in one of my .js files. When it gets compressed via jammit, it just produces a zero length file. No errors, nothing...
I looked thru source and did not find anything obvious about how to make the ruby-yui-compressor generate errors (or whatever) when it compresses and discovers a problem.
Suggestions?