Fix for top level options. Fixes GH-56. Bump v0.3.1

This commit is contained in:
Kyle Robinson Young 2013-02-28 10:15:06 -08:00
parent e86fd7df90
commit 856d3d0bc3
4 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,7 @@
v0.3.1:
date: 2013-02-28
changes:
- Fix for top level options.
v0.3.0: v0.3.0:
date: 2013-02-27 date: 2013-02-27
changes: changes:

View File

@ -175,6 +175,7 @@ Spawning does cause a performance hit (usually 500ms for most environments). It
## Release History ## Release History
* 2013-02-27v0.3.1Fix for top level options.
* 2013-02-26v0.3.0nospawn option added to run tasks without spawning as child processes. Watch emits 'watch' events upon files being triggered with grunt.event. Completion time in seconds and date/time shown after tasks ran. Negate file patterns fixed. Tasks debounced individually to handle simultaneous triggering for multiple targets. Errors handled better and viewable with --stack cli option. Code complexity reduced making the watch task code easier to read. * 2013-02-26v0.3.0nospawn option added to run tasks without spawning as child processes. Watch emits 'watch' events upon files being triggered with grunt.event. Completion time in seconds and date/time shown after tasks ran. Negate file patterns fixed. Tasks debounced individually to handle simultaneous triggering for multiple targets. Errors handled better and viewable with --stack cli option. Code complexity reduced making the watch task code easier to read.
* 2013-02-14v0.2.0First official release for Grunt 0.4.0. * 2013-02-14v0.2.0First official release for Grunt 0.4.0.
* 2013-01-17v0.2.0rc7Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. * 2013-01-17v0.2.0rc7Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.
@ -190,4 +191,4 @@ Spawning does cause a performance hit (usually 500ms for most environments). It
Task submitted by [Kyle Robinson Young](http://dontkry.com) Task submitted by [Kyle Robinson Young](http://dontkry.com)
*This file was generated on Wed Feb 27 2013 14:08:02.* *This file was generated on Thu Feb 28 2013 10:14:13.*

View File

@ -1,7 +1,7 @@
{ {
"name": "grunt-contrib-watch", "name": "grunt-contrib-watch",
"description": "Run predefined tasks whenever watched file patterns are added, changed or deleted.", "description": "Run predefined tasks whenever watched file patterns are added, changed or deleted.",
"version": "0.3.0", "version": "0.3.1",
"homepage": "https://github.com/gruntjs/grunt-contrib-watch", "homepage": "https://github.com/gruntjs/grunt-contrib-watch",
"author": { "author": {
"name": "Grunt Team", "name": "Grunt Team",

View File

@ -13,19 +13,20 @@ module.exports = function(grunt) {
var Gaze = require('gaze').Gaze; var Gaze = require('gaze').Gaze;
var taskrun = require('./lib/taskrun')(grunt); var taskrun = require('./lib/taskrun')(grunt);
// Default options for the watch task
var defaults = {
interrupt: false,
nospawn: false
};
grunt.registerTask('watch', 'Run predefined tasks whenever watched files change.', function(target) { grunt.registerTask('watch', 'Run predefined tasks whenever watched files change.', function(target) {
var name = this.name || 'watch'; var name = this.name || 'watch';
this.requiresConfig(name); this.requiresConfig(name);
// Default options for the watch task
var defaults = this.options({
interrupt: false,
nospawn: false
});
// Build an array of files/tasks objects // Build an array of files/tasks objects
var watch = grunt.config(name); var watch = grunt.config(name);
var targets = target ? [target] : Object.keys(watch).filter(function(key) { var targets = target ? [target] : Object.keys(watch).filter(function(key) {
if (key === 'options') { return false; }
return typeof watch[key] !== 'string' && !Array.isArray(watch[key]); return typeof watch[key] !== 'string' && !Array.isArray(watch[key]);
}); });