5 Commits

Author SHA1 Message Date
Jeff Williams
ec47356ee6 make templates work from relative and absolute paths (#196, #197, #198) 2012-09-23 21:06:36 -07:00
Bob Kerns
dc2ec62e70 Use the java facilities to handle path manipulations portably.
This was causing it to mis-calculate the paths, and end up losing the
output directory entirely, and overwrite the template static files
with themselves, resulting in truncation to zero-length. Of course,
they were also missing in the output.

It was expecting to be able to split paths on
System.getProperty("path.separator"), but that describes how to put a
path together, not how to take one apart, which is more complicated.

In particular, in windows, / is as valid a separator as \ in all but a
few UI contexts.

And since we need to pass / in paths that may get turned into URI's,
it's important to handle this correctly.

Java already provides a File facility to handle these sorts of operations.
This patch makes use of java.io.File to:

1) Find the parent of a File for dirname.
2) Find the name of a File for basename.

It also now makes use of substring for removing the ext for basename,
rather than Array.prototype.slice + join(""). I'm not sure what that
was all about...  It does have the effect of ensuring it's a Javascript
String, but calling String() has the same benefit and is much more clear.

You can put that back if there was a reason for it, but it looks just
confused to me.
2012-09-11 22:57:50 -07:00
Jeff Williams
d091675cfa make 'fs' and 'path' modules more consistent with Node.js 2012-08-19 15:25:02 -07:00
Jannon
2d73440b3d Testing Framework Upgrade Part I
This first part of the testing framework upgrade:

- enhances the jsdoc script to allow switching to debug mode from the command line
- uses Jasmine to run tests
- adds flexibility to run tests from multiple root directories
- does automatic test discovery, so test files can just be created, dropped in an appropriate folder, and run without having to explicity add it to the test runner
- cleans up the test directory layout
- incorporates env.rhino.js which should make it easier to test templates
- is incomplete: this is just a savepoint.  About 1/3 of the tests have been converted.  The rest are still run through the old testrunner
2012-04-30 17:39:50 -07:00
tschaub
71393844ad Use Rhino's require implementation. 2011-09-21 17:37:32 -06:00