Skip to content
This repository
branch: v0.5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 86 lines (74 sloc) 2.106 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
// 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']);

var p = new jake.NpmPublishTask('geddy', [
  'Makefile'
, 'Jakefile'
, 'README.md'
, 'package.json'
, 'bin/**'
, 'deps/**'
, 'lib/**'
, 'templates/**'
, 'test/**'
]);

testTask = new jake.TestTask('Geddy', function () {
  this.testName = 'testBase';
  this.testFiles.include('test/*.js');
  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 (err) {
    var module
      , cmd
      , errMsg = err.message
      , match = errMsg.match('Cannot find module')
      , absModuleName = errMsg.match(/'[a-zA-Z]*'/);

    if (match && absModuleName) {
      module = absModuleName[0].replace(/'/g, '');
      cmd = 'npm install ' + module;
      jake.logger.log(module + ' is not installed; Jake will attempt to install it for you.');
      jake.exec(cmd, function () {
        jake.logger.log('installed!');
        t.addListener('complete', function () {
          complete();
        });
        t.invoke.apply(t, arguments);
      });
    }
    else {
      throw err;
    }
  });
  t.invoke.apply(t, arguments);
}, {async: true});

testTask = new jake.TestTask('Geddy model-adapters', function () {
  this.testName = 'testModelAdapters'
  this.testFiles.include('lib/model/adapters/**/test.js');
});

Something went wrong with that request. Please try again.