jakewins / brew

Maven plugin for compiling coffeescript, haml-js and aggregating AMD-based js projects.
GNU Lesser General Public License v2.1
91 stars 21 forks source link

Problem with loading JS resources from class path #2

Open algirdasrascius opened 13 years ago

algirdasrascius commented 13 years ago

In class com.voltvoodoo.brew.HamlCompiler loading of javascript files form classpath fails when code is run under Mac OS.

The problem is that resource paths are specified with leading slash and loaded using ClassLoader.getResourceAsStream. When method ClassLoader.getResourceAsStream is used to load resource, leading slash should not be used. Leading slash is accepted when method Class.getResourceAsStream is used.

Simplest way to fix this problem is to replace lines 35 and 36 in HamlCompiler.java with:

InputStream inputStream = getClass().getResourceAsStream(filename);
iron9light commented 13 years ago

linux(ubuntu 10.04) has the same problem.