Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (74 sloc) 2.106 kb
56c2b46 @larzconwell Updated branch from master
larzconwell authored
1 // Load the basic Geddy toolkit
2 require('./lib/geddy')
3
cb61fff @mde Adding packaging tasks.
mde authored
4 var fs = require('fs')
c389ea9 Move generator Jake tasks into a separate Jakefile.
mde authored
5 , createPackageTask
c2c0c19 Updated tests to use new Jake TestTask.
mde authored
6 , JSPAT = /\.js$/
7 , testTask;
d46b18c @mde Get basic app-scaffold generation working.
mde authored
8
935599a @mde Added Jakefile.
mde authored
9 namespace('doc', function () {
d46b18c @mde Get basic app-scaffold generation working.
mde authored
10 task('generate', ['doc:clobber'], function () {
11 var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
12 '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
935599a @mde Added Jakefile.
mde authored
13 console.log('Generating docs ...');
d05453e @mde Updated doc-generation tasks.
mde authored
14 jake.exec([cmd], function () {
935599a @mde Added Jakefile.
mde authored
15 console.log('Done.');
16 complete();
17 });
f523c7e @mde Use opts instead of async flag.
mde authored
18 }, {async: true});
d46b18c @mde Get basic app-scaffold generation working.
mde authored
19
20 task('clobber', function () {
7f414ae @larzconwell Added new Jade example
larzconwell authored
21 var cmd = 'rm -fr ./doc/**';
d05453e @mde Updated doc-generation tasks.
mde authored
22 jake.exec([cmd], function () {
d46b18c @mde Get basic app-scaffold generation working.
mde authored
23 console.log('Clobbered old docs.');
24 complete();
25 });
f523c7e @mde Use opts instead of async flag.
mde authored
26 }, {async: true});
d46b18c @mde Get basic app-scaffold generation working.
mde authored
27
935599a @mde Added Jakefile.
mde authored
28 });
29
d05453e @mde Updated doc-generation tasks.
mde authored
30 desc('Generate docs for Geddy');
31 task('doc', ['doc:generate']);
32
2d8cfcd @mde kill method is now killWorker.
mde authored
33 var p = new jake.NpmPublishTask('geddy', [
34 'Makefile'
35 , 'Jakefile'
36 , 'README.md'
37 , 'package.json'
7f414ae @larzconwell Added new Jade example
larzconwell authored
38 , 'bin/**'
39 , 'deps/**'
40 , 'lib/**'
41 , 'templates/**'
42 , 'test/**'
2d8cfcd @mde kill method is now killWorker.
mde authored
43 ]);
9f3e51c @mde Added publish task.
mde authored
44
c2c0c19 Updated tests to use new Jake TestTask.
mde authored
45 testTask = new jake.TestTask('Geddy', function () {
d950b22 Stub out a test-task that allows checks for installed libs.
mde authored
46 this.testName = 'testBase';
c2c0c19 Updated tests to use new Jake TestTask.
mde authored
47 this.testFiles.include('test/*.js');
4dbafee Allow leading underscores in camelized strings
mde authored
48 this.testFiles.include('test/**/*.js');
d950b22 Stub out a test-task that allows checks for installed libs.
mde authored
49 this.showDescription = false;
c2c0c19 Updated tests to use new Jake TestTask.
mde authored
50 });
51
d950b22 Stub out a test-task that allows checks for installed libs.
mde authored
52 desc('Run the Geddy tests');
53 task('test', function () {
54 var t = jake.Task.testBase;
8069f81 Fixed test task to install needed libs.
mde authored
55 t.addListener('error', function (err) {
56 var module
57 , cmd
8efe2d2 Unfuck tests
mde authored
58 , errMsg = err.message
59 , match = errMsg.match('Cannot find module')
60 , absModuleName = errMsg.match(/'[a-zA-Z]*'/);
60ad15e @larzconwell Added functionality to make Jake install missing libraries when testing
larzconwell authored
61
8efe2d2 Unfuck tests
mde authored
62 if (match && absModuleName) {
63 module = absModuleName[0].replace(/'/g, '');
8069f81 Fixed test task to install needed libs.
mde authored
64 cmd = 'npm install ' + module;
65 jake.logger.log(module + ' is not installed; Jake will attempt to install it for you.');
66 jake.exec(cmd, function () {
67 jake.logger.log('installed!');
68 t.addListener('complete', function () {
69 complete();
70 });
f945b2e Pass args to test task so you can filter by test filename
mde authored
71 t.invoke.apply(t, arguments);
60ad15e @larzconwell Added functionality to make Jake install missing libraries when testing
larzconwell authored
72 });
8069f81 Fixed test task to install needed libs.
mde authored
73 }
74 else {
75 throw err;
76 }
f1cf5d5 Tests for Riak adapter using Jake's new TestTask
mde authored
77 });
f945b2e Pass args to test task so you can filter by test filename
mde authored
78 t.invoke.apply(t, arguments);
d950b22 Stub out a test-task that allows checks for installed libs.
mde authored
79 }, {async: true});
80
c2c0c19 Updated tests to use new Jake TestTask.
mde authored
81 testTask = new jake.TestTask('Geddy model-adapters', function () {
c389ea9 Move generator Jake tasks into a separate Jakefile.
mde authored
82 this.testName = 'testModelAdapters'
83 this.testFiles.include('lib/model/adapters/**/test.js');
84 });
d46b18c @mde Get basic app-scaffold generation working.
mde authored
85
Something went wrong with that request. Please try again.