prep for 0.4

This commit is contained in:
Tyler Kellen 2012-10-03 13:14:12 -05:00
parent 8b343429da
commit 3996790fa2
9 changed files with 49 additions and 124 deletions

43
Gruntfile.js Normal file
View File

@ -0,0 +1,43 @@
/*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js'
],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
es5: true
}
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// By default, lint task.
grunt.registerTask('default', 'jshint');
};

View File

@ -1,4 +1,4 @@
Copyright (c) 2012 "Cowboy" Ben Alman, contributors.
Copyright (c) 2012 "Cowboy" Ben Alman, contributors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -1,26 +1,3 @@
# grunt-contrib-watch (not released)
# grunt-contrib-watch (unreleased, for grunt v0.4.0a)
> Your description here.
## Getting Started
Install this grunt plugin next to your project's [grunt.js gruntfile][getting_started] with: `npm install grunt-contrib-watch`
Then add this line to your project's `grunt.js` gruntfile:
```javascript
grunt.loadNpmTasks('grunt-contrib-watch');
```
[grunt]: https://github.com/cowboy/grunt
[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
### Overview
## Release History
* 2012/09/xx - v0.2.0 - notation
--
Task submitted by ["Cowboy" Ben Alman](https://github.com/cowboy).
> Run tasks whenever watched files change.

View File

@ -1,65 +0,0 @@
/*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2012 Sindre Sorhus, contributors
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt-contrib-watch/blob/master/LICENSE-MIT
*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
lint: {
all: ['grunt.js', 'tasks/*.js', '<config:nodeunit.tasks>']
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
es5: true
}
},
// Before generating any new files, remove any previously-created files.
clean: {
test: ['tmp']
},
// Configuration to be run (and then tested).
watch: {
},
// Unit tests.
nodeunit: {
tasks: ['test/*_test.js']
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// The clean plugin helps in testing.
grunt.loadNpmTasks('grunt-contrib-clean');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.renameTask('test', 'nodeunit');
grunt.registerTask('test', 'clean watch nodeunit');
// By default, lint and run all tests.
grunt.registerTask('default', 'lint test');
};

View File

@ -1,7 +1,7 @@
{
"name": "grunt-contrib-watch",
"description": "Your description here.",
"version": "0.2.0",
"description": "Run tasks whenever watched files change.",
"version": "0.4.0",
"homepage": "https://github.com/gruntjs/grunt-contrib-watch",
"author": {
"name": "Grunt Team",
@ -28,7 +28,7 @@
"test": "grunt test"
},
"dependencies": {
"grunt-contrib-lib": "~0.2.0"
"grunt-contrib-lib": "~0.4.0a"
},
"devDependencies": {
"grunt": "~0.3.15",

View File

@ -4,27 +4,13 @@
*
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt-contrib-watch/blob/master/LICENSE-MIT
*/
module.exports = function(grunt) {
'use strict';
// TODO: ditch this when grunt v0.4 is released
grunt.util = grunt.util || grunt.utils;
var _ = grunt.util._;
var helpers = require('grunt-contrib-lib').init(grunt);
grunt.registerMultiTask('watch', '', function() {
var helpers = require('grunt-contrib-lib').init(grunt);
var options = helpers.options(this, {namespace: 'JST'});
grunt.verbose.writeflags(options, 'Options');
// TODO: ditch this when grunt v0.4 is released
this.files = this.files || helpers.normalizeMultiTaskFiles(this.data, this.target);
});

View File

@ -1 +0,0 @@
body{}

View File

@ -1 +0,0 @@
body{}

View File

@ -1,14 +0,0 @@
var grunt = require('grunt');
exports.watch = {
compile: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/compile.css');
var expected = grunt.file.read('test/expected/compile.css');
test.equal(actual, expected, 'should compile watch to css using watch');
test.done();
}
};