Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update for Grunt 0.4.0 release

  • Loading branch information...
commit f6df7b34d35528ca3c8f563153ba0348470cc64f 1 parent 27de0f5
@bustardcelly authored
View
4 CHANGELOG
@@ -0,0 +1,4 @@
+0.4.0:
+ date: 2013-02-28
+ changes:
+ - Grunt 0.4.0 compliant.
View
10 Gruntfile.js
@@ -37,7 +37,9 @@ module.exports = function(grunt) {
tests: ['test/*_test.js']
},
forever: {
- main: './test/fixtures/index.js'
+ options: {
+ index: './test/fixtures/index.js'
+ }
}
});
@@ -52,10 +54,6 @@ module.exports = function(grunt) {
// By default, lint and run all tests.
grunt.registerTask('test', ['nodeunit']);
- grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
+ grunt.registerTask('default', ['jshint', 'test']);
- // grunt.registerHelper('forever', function(operation) {
- // grunt.task.run('forever:' + operation);
- // });
-
};
View
3  README.md
@@ -3,6 +3,9 @@ grunt-forever [![Build Status](https://travis-ci.org/bustardcelly/grunt-forever.
> forever task for grunt to start, stop and restart an application as a daemon.
+## Updated for Grunt 0.4.0
+This grunt task plugin has been updated to work with [Grunt 0.4.0](https://github.com/gruntjs/grunt/wiki/Getting-started) release. The working version for Grunt 0.3.x has been tagged [0.2.2](https://github.com/bustardcelly/grunt-forever/tree/0.2.2).
+
## Getting Started
Install this grunt plugin next to your project's [grunt.js gruntfile](https://github.com/gruntjs/grunt/blob/master/docs/getting_started.md) with: `npm install grunt-forever`
View
7 package.json
@@ -20,9 +20,9 @@
"url": "https://github.com/bustardcelly/grunt-forever/blob/master/LICENSE-MIT"
}
],
- "main": "grunt.js",
+ "main": "Gruntfile.js",
"engines": {
- "node": "*"
+ "node": ">= 0.8.0"
},
"scripts": {
"test": "grunt test"
@@ -36,6 +36,9 @@
"grunt-contrib-nodeunit": "~0.1.2",
"grunt-contrib-internal": "~0.4.3"
},
+ "peerDependencies": {
+ "grunt": "~0.4.0"
+ },
"keywords": [
"forever",
"forevergrunt",
View
6 tasks/forever-task.js
@@ -140,7 +140,7 @@ function restartOnProcess( index ) {
if(typeof process !== 'undefined') {
log(forever.format(true,[process]));
- forever.restart( ndex)
+ forever.restart( index)
.on('error', function(message) {
error('Error restarting ' + index + '. [REASON] :: ' + message);
done(false);
@@ -164,12 +164,12 @@ module.exports = function(grunt) {
gruntRef = grunt;
grunt.registerTask( 'forever', 'Starts node app as a daemon.', function(target) {
- var index = grunt.config('forever.main') || 'index.js',
+ var index = this.options().index || 'index.js',
operation = target;
try {
if(commandMap.hasOwnProperty(operation)) {
- commandMap[operation].call( this, index );
+ commandMap[operation].call(this, index);
}
else {
warn('Operation ' + operation + ' is not supported currently. Only forever:start, forever:stop or forever:restart.');
View
19 test/forever_test.js
@@ -21,19 +21,10 @@ var grunt = require('grunt'),
test.ifError(value)
*/
-grunt.registerHelper('plugin', function() {
- return 'plugin!!!';
-});
-
-exports['test'] = {
- setUp: function(done) {
- // setup here
- done();
- },
- 'helper': function(test) {
+exports.forever = {
+ document: function(test) {
test.expect(1);
- // tests here
- test.equal(grunt.helper('plugin'), 'plugin!!!', 'should return the correct value.');
+ test.ok(true, 'Due to the asynchronous nature of the forever task, test setup is proving to be difficult. Need to find a way to pause setup and teardown until forever has started/stopped.');
test.done();
}
};
@@ -42,7 +33,7 @@ exports['test'] = {
/*
exports['forever'] = {
setUp: function(done) {
- grunt.task.directive('<forever:start>');
+ grunt.task.run('forever:start');
forever.list(false, function(context, list) {
done();
});
@@ -74,7 +65,7 @@ exports['forever'] = {
test.done();
},
tearDown: function(done) {
- grunt.task.directive('<forever:stop>');
+ grunt.task.run('forever:stop');
done();
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.