first commit
This commit is contained in:
commit
44abe380e4
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
tmp
|
2
AUTHORS
Normal file
2
AUTHORS
Normal file
@ -0,0 +1,2 @@
|
||||
Ben Alman (http://benalman.com)
|
||||
Kyle Robinson Young (http://dontkry.com)
|
22
LICENSE-MIT
Normal file
22
LICENSE-MIT
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2012 Ben Alman, contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
21
README.md
Normal file
21
README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# grunt-contrib-watch (not released)
|
||||
> Your description here (part of the [grunt-contrib](https://github.com/gruntjs/grunt-contrib) collection). Submitted by [Sindre Sorhus](/sindresorhus).
|
||||
|
||||
## 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/08/xx - v0.2.0 - notation
|
65
grunt.js
Normal file
65
grunt.js
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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');
|
||||
};
|
40
package.json
Normal file
40
package.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "grunt-contrib-watch",
|
||||
"description": "Your description here.",
|
||||
"version": "0.2.0",
|
||||
"homepage": "https://github.com/gruntjs/grunt-contrib-watch",
|
||||
"author": {
|
||||
"name": "Ben Alman",
|
||||
"url": "http://benalman.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/gruntjs/grunt-contrib-watch.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/gruntjs/grunt-contrib-watch/issues"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/gruntjs/grunt-contrib-watch/blob/master/LICENSE-MIT"
|
||||
}
|
||||
],
|
||||
"main": "grunt.js",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"dependencies": {
|
||||
"grunt-contrib-lib": "~0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.3.15",
|
||||
"grunt-contrib-clean": "~0.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"gruntplugin"
|
||||
]
|
||||
}
|
32
tasks/watch.js
Normal file
32
tasks/watch.js
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* grunt-contrib-watch
|
||||
* http://gruntjs.com/
|
||||
*
|
||||
* Copyright (c) 2012 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);
|
||||
|
||||
|
||||
});
|
||||
|
||||
};
|
1
test/expected/compile.css
Normal file
1
test/expected/compile.css
Normal file
@ -0,0 +1 @@
|
||||
body{}
|
1
test/fixtures/compile.sass
vendored
Normal file
1
test/fixtures/compile.sass
vendored
Normal file
@ -0,0 +1 @@
|
||||
body{}
|
14
test/watch_test.js
Normal file
14
test/watch_test.js
Normal file
@ -0,0 +1,14 @@
|
||||
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();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user