0.0.19 • Published 11 years ago

jake-utils v0.0.19

Weekly downloads
53
License
-
Repository
github
Last release
11 years ago

The jake-utils is a collection of useful functions for using Jake.

Note: I do not expect any one else to find it as useful. It does a lot of un-orthodox things like creating global functions and attempting to make everything run synchronously.

Usage

In your Jakefile, simply add the following code near the top:

require('jake-utils');

You will then have a number of functions you an use.

Mocha Tests

My favorite test harness is Mocha.

You can now do something like:

mochaTests({
    directory: "test",
    files    : /test\-.*\.js/,
    coverage : true,
    reporter : 'tap',
    output   : 'test/results.tap'
});

This restores the console.log() before running any of the tests.

Note: Using Mocha with log4js means that your TAP results get wonky when all console.log() calls get interspersed with the TAP code.

Display Messages

You can have obnoxious headers around your tasks, to make it stand out more when you are looking at builds on Jenkins.

task('api', function() {
    start("Generating the Internal Documentation");

    // ...
    
    end("View documents in '%s'", apidest);
});

Lint Analysis using JSHint

We have a nice wrapper around the JSHint utility for analyzing all the files found in the directories specified. For example:

desc("Lints all of the script files in the source directories");
task('lint', function(){
    start("Analyzing the Script Files");

    var codelib    = [ 'services' , 'routes', 'resources' ];
    lint( codelib );

    end();
});
0.0.19

11 years ago

0.0.18

11 years ago

0.0.17

11 years ago

0.0.16

11 years ago

0.0.15

12 years ago

0.0.14

12 years ago

0.0.13

12 years ago

0.0.12

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

12 years ago

0.0.8

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago