Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

92 lines (78 sloc) 2.272 kB
// Load the basic Geddy toolkit
require('./lib/geddy')
var fs = require('fs')
, createPackageTask
, JSPAT = /\.js$/
, testTask;
namespace('doc', function () {
task('generate', ['doc:clobber'], function () {
var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
'-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
console.log('Generating docs ...');
jake.exec([cmd], function () {
console.log('Done.');
complete();
});
}, {async: true});
task('clobber', function () {
var cmd = 'rm -fr ./doc/**';
jake.exec([cmd], function () {
console.log('Clobbered old docs.');
complete();
});
}, {async: true});
});
desc('Generate docs for Geddy');
task('doc', ['doc:generate']);
desc('Runs the tests.');
task('test', function () {
var dir = process.cwd()
, dirList = fs.readdirSync(dir + '/test')
, fileName
, cmds = [];
for (var i = 0; i < dirList.length; i++) {
fileName = dirList[i];
// Any files ending in '.js'
if (JSPAT.test(fileName)) {
cmds.push('node ./test/' + fileName);
}
}
jake.exec(cmds, function () {
console.log('Tests passed.');
complete();
}, {stdout: true});
}, {async: true});
var p = new jake.NpmPublishTask('geddy', [
'Makefile'
, 'Jakefile'
, 'README.md'
, 'package.json'
, 'bin/**'
, 'deps/**'
, 'lib/**'
, 'templates/**'
, 'test/**'
]);
// TODO: This is hacky -- need a better way to poke Jake to
// set up the package part included in the publish-task
jake.Task['npm:definePackage'].invoke();
testTask = new jake.TestTask('Geddy', function () {
this.testName = 'testBase';
this.testFiles.include('test/*.js');
this.showDescription = false;
});
desc('Run the Geddy tests');
task('test', function () {
var t = jake.Task.testBase;
t.addListener('error', function (e) {
// TODO: Check the type of error, npm-install the libs, and re-run
console.error('If you have errors in the templating tests, ' +
'install jade and handlebars in the base geddy directory.');
throw e;
});
t.invoke();
}, {async: true});
testTask = new jake.TestTask('Geddy model-adapters', function () {
this.testName = 'testModelAdapters'
this.testFiles.include('lib/model/adapters/**/test.js');
});
Jump to Line
Something went wrong with that request. Please try again.