canjs / can-compile

Compile CanJS Mustache and EJS views for lightning fast production apps
http://daffl.github.com/can-compile
MIT License
35 stars 15 forks source link

Fixed path normalize on Windows, Alternative file extension, can.view.attr #32

Closed srasp closed 9 years ago

srasp commented 9 years ago

Added extension mapping, if you use another view extension as ".mustache", eg. ".mst". Just added "extension" parameter to the options. If can.view.attr is used, it wasn´t take into account. Added an options parameter to maintain used view attrs.

Signed-off-by: srasp sebastian.rasp@promerit.com

daffl commented 9 years ago

Awesome thank you! Two things: The build failed with a JSHint error (the variable i is defined twice in https://github.com/srasp/can-compile/blob/master/lib/compile.js#L51 and https://github.com/srasp/can-compile/blob/master/lib/compile.js#L57).

Could you also add the documentation for the extension parameter (probably somewhere around https://github.com/daffl/can-compile#programmatically) and add it as an option in the command line at https://github.com/daffl/can-compile/blob/master/bin/can-compile#L12).

srasp commented 9 years ago

As you recommended I changed the variable in compile.js and added the parameters to the documentation as well as in the command line at can-compile.

marshallswain commented 9 years ago

@srasp It looks like the automated tests have failed again. You can click the details link to the right of the message that says "The Travis CI build failed" to see what's going on. You can actually run these tests yourself before pushing your code, as well. Have you tried running the tests on your own machine? If you're not familiar with the process, this is how to get it working:

If the tests run without any errors and you're cleaning up anything JSHint says to fix, the Travis CI builder won't balk at your awesome commits.

daffl commented 9 years ago

That's a weird error though. I'll check what's going on.

srasp commented 9 years ago

Sorry guys, now it should work. I had to check if the new option extensions is defined. I´ve updated the test, because on Windows the normilzer method didn´t work. Additonally, I´ve added a test case, to test the alternative file extension.

marshallswain commented 9 years ago

No need to apologize. Thank you for your work.

daffl commented 9 years ago

Awesome, thank you!

daffl commented 9 years ago

Released as version 0.8.0. Thanks again!