grunt-regarde
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -30,3 +30,3 @@ 'use strict'; | ||
} | ||
_this.events.on('regarde:close', function() { | ||
_this.events.on('regarde:close', function () { | ||
watcher.close(); | ||
@@ -33,0 +33,0 @@ }); |
@@ -80,4 +80,4 @@ 'use strict'; | ||
// run target tasks | ||
var fstring = grunt.util._.reduce(changed, function (memo, it) { return memo + ":" + it; }, ""); | ||
tasks = grunt.util._.map(tasks, function (t) { return t + fstring; }); | ||
grunt.regarde = grunt.regarde || {}; | ||
grunt.regarde.changed = changed; | ||
grunt.task.run(tasks).mark(); | ||
@@ -84,0 +84,0 @@ // grunt.task.start(); |
{ | ||
"name": "grunt-regarde", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Observe a set of files for changes", | ||
@@ -20,19 +20,18 @@ "homepage": "https://github.com/yeoman/grunt-regarde", | ||
"author": "Frederick Ros", | ||
"main": "Gruntfile.js", | ||
"dependencies": { | ||
"gaze" : "~0.3.1" | ||
"gaze": "~0.3.1" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.0", | ||
"mocha": "~1.7.4", | ||
"mkdirp": "~0.3.1", | ||
"rimraf": "~2.0.1", | ||
"grunt-contrib-jshint": "~0.1.0", | ||
"eventemitter2": "~0.4.11", | ||
"minimatch": "~0.2.9" | ||
"grunt": "~0.4.0", | ||
"mocha": "~1.7.4", | ||
"mkdirp": "~0.3.1", | ||
"rimraf": "~2.0.1", | ||
"grunt-contrib-jshint": "~0.1.1", | ||
"eventemitter2": "~0.4.11", | ||
"minimatch": "~0.2.9" | ||
}, | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"node": ">=0.8.0" | ||
}, | ||
"license": "BSD" | ||
} |
@@ -8,4 +8,4 @@ 'use strict'; | ||
grunt.registerTask('regardeReset', 'Reset the initialized status .. For test purpose ONLY', function (target) { | ||
grunt.log.writeln("Resetting initialized state"); | ||
grunt.registerTask('regardeReset', 'Reset the initialized status .. For test purpose ONLY', function () { | ||
grunt.log.writeln('Resetting initialized state'); | ||
initialized = false; | ||
@@ -12,0 +12,0 @@ }); |
@@ -7,3 +7,2 @@ 'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
@@ -57,3 +56,3 @@ grunt.task.init([]); | ||
grunt.event.on('regarde:file:changed', function (name, file) { | ||
assert.equal(name, "fred"); | ||
assert.equal(name, 'fred'); | ||
assert(file.match(/(fred|john)\.txt$/)); | ||
@@ -89,3 +88,3 @@ changed.push(file); | ||
grunt.event.on('regarde:file:changed', function (name, file) { | ||
assert.equal(name, "fred"); | ||
assert.equal(name, 'fred'); | ||
assert(file.match(/fred\.txt$/)); | ||
@@ -92,0 +91,0 @@ grunt.event.emit('regarde:close'); |
@@ -139,4 +139,20 @@ 'use strict'; | ||
}); | ||
it('should convey files changed through a variable of grunt', function (done) { | ||
var changedFiles = ['bar', 'baz', 'boo']; | ||
var task = { mark: function () {}}; | ||
grunt.task = { | ||
run: function () { | ||
assert.equal(grunt.regarde.changed, changedFiles); | ||
done(); | ||
return task; | ||
}, | ||
current: { nameArgs: 'foo:bar' } | ||
}; | ||
utils.launchTasks(grunt, ['foo'], false, changedFiles); | ||
}); | ||
}); | ||
}); |
23616
564
83