grunt-console-clean
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -37,2 +37,12 @@ /* | ||
}, | ||
test4: { | ||
options: { | ||
strategy: function (content) { | ||
return '//' + content; | ||
} | ||
}, | ||
files : [ | ||
{ src: ['test/test4/replace.js'], dest: 'test/test4/dist/replace.js' } | ||
] | ||
} | ||
}, | ||
@@ -55,2 +65,3 @@ | ||
test3: ['test/test3/test.js'], | ||
test4: ['test/test4/test.js'] | ||
}, | ||
@@ -74,5 +85,6 @@ | ||
grunt.registerTask('test-3', ['clean', 'console-clean:test3', 'nodeunit:test3']); | ||
grunt.registerTask('test-4', ['clean', 'console-clean:test4', 'nodeunit:test4']); | ||
// By default, lint and run all tests. | ||
grunt.registerTask('default', ['jshint', 'test-1', 'test-2', 'test-3']); | ||
grunt.registerTask('default', ['jshint', 'test-1', 'test-2', 'test-3', 'test-4']); | ||
}; |
{ | ||
"name": "grunt-console-clean", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Plugin for grunt to clean up code from console object", | ||
@@ -47,2 +47,2 @@ "author": "Tomasz Czechowski", | ||
"homepage": "https://github.com/tomaszczechowski/grunt-console-clean" | ||
} | ||
} |
@@ -27,3 +27,3 @@ # grunt-console-clean | ||
*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/outaTiME/grunt-replace/tree/grunt-0.3-stable).* | ||
*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4)* | ||
@@ -36,6 +36,7 @@ ## Console clean | ||
##### variables | ||
Name: allows | ||
Type: `array` | ||
#### variables | ||
Name: **allows** | ||
Type: **`array`** | ||
This option is used to determine "console" object to be unchanged. | ||
@@ -45,6 +46,19 @@ | ||
options : { | ||
allows: ["log", "warn"] | ||
allows: ["log", "warn"] | ||
} | ||
``` | ||
Name: **strategy** | ||
Type: **`function`** | ||
This option is used to modify/comment-out found console object. It allows to change strategy of commeting from "/**/" to e.g. "//". | ||
```javascript | ||
options : { | ||
strategy: function (content) { | ||
return '//' + content; | ||
} | ||
} | ||
``` | ||
### Usage Examples | ||
@@ -51,0 +65,0 @@ |
@@ -35,5 +35,10 @@ /* | ||
){ | ||
var to = options.hasOwnProperty('strategy') | ||
? options.strategy(m[0]) | ||
: '/*' + m[0] + '*/'; | ||
replace.push({ | ||
from: m[0], | ||
to: '/*' + m[0] + '*/' | ||
to: to | ||
}); | ||
@@ -40,0 +45,0 @@ } |
Sorry, the diff of this file is not supported yet
11816
20
188
107