Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
prepare for npm release
Browse files Browse the repository at this point in the history
* grunt support (I especially use "release")
* travis support
  • Loading branch information
mash committed Oct 25, 2013
1 parent 00cde3d commit 694fd72
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "0.10"
- "0.8"
- "0.6"
38 changes: 38 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,38 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: []
});
grunt.loadNpmTasks('grunt-release'); // dry run: grunt --no-write -v release

grunt.registerTask('default', ['test']);

grunt.registerTask('test', 'run tests', function() {
var done = this.async(),
numberOfTests = 3;

require('child_process').exec(
'make test',
function(error, stdout, stderr) {
grunt.log.verbose.writeln(stdout);
grunt.log.verbose.writeln(stderr);
if (error) {
grunt.log.error(error);
done(false);
}
else {
// detect "Result: PASS"
// of each tests
var passLines = stdout.match(/Result: PASS/g);
if ( ! passLines || (passLines.length != numberOfTests) ) {
grunt.fail.warn( "some tests failed, see log with -v flag" );
done(false);
return;
}
grunt.log.oklns( "All "+ numberOfTests +" tests successful." ).ok();
done(true);
}
}
);
});
};
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -20,6 +20,9 @@
"dependencies" : {
},
"devDependencies" : {
"async" : "*"
"async" : "*",
"grunt" : "~0.4.1",
"grunt-release" : "~0.3.5",
"grunt-contrib-clean" : "~0.4.1"
}
}

0 comments on commit 694fd72

Please sign in to comment.