diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f39844..a5a7b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 0.6.2 (28th April 2014) + +* Updated grunt dependency to 0.4.2. +* Fixed example in README of outputting analysis to a file. +* Fixed issue causing task to crash when processing files with large amounts of duplication. + ### 0.6.1 (September 13th 2013) * Fixed typo in documentation example courtesy of [joshmatz](https://github.com/joshmatz). ([#9](https://github.com/peterkeating/grunt-csscss/pull/9)) diff --git a/README.md b/README.md index f24c2ed..587109a 100644 --- a/README.md +++ b/README.md @@ -205,11 +205,13 @@ Example of using the Grunt task to output the analysis from CSSCSS to a local fi ```js csscss: { - options: { - outputJson: true - }, dist: { - 'output.json': ['css/style.css'] + options: { + outputJson: true + }, + files: { + 'output.json': ['css/style.css'] + } } } ``` diff --git a/package.json b/package.json index c94d45a..cba9f46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grunt-csscss", - "version": "0.6.1", + "version": "0.6.2", "description": "Grunt task that executes CSSCSS.", "homepage": "https://github.com/peterkeating/grunt-csscss", "author": { @@ -29,7 +29,7 @@ "test": "grunt" }, "devDependencies": { - "grunt": "~0.4.1", + "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.4.3" }, "keywords": [ diff --git a/tasks/csscss.js b/tasks/csscss.js index cfb49e6..2126400 100644 --- a/tasks/csscss.js +++ b/tasks/csscss.js @@ -34,7 +34,12 @@ module.exports = function(grunt) { * adds the file path as the final argument, this goes into a new array so * the file doesn't get used in the next iteration. */ - var cmdArgs = args.concat([fileToBeAnalyzed]); + var cmdArgs = args.concat([fileToBeAnalyzed]), + + /** + * Stores the output from CSSCSS. + */ + childOutput = ''; /** * Outputs the file that is being analysed. @@ -56,14 +61,6 @@ module.exports = function(grunt) { return grunt.warn('Ruby and csscss have to be installed and in your PATH for this task to run.'); } - innerNext(error); - }); - - /** - * Displays the output and error streams via the parent process. - */ - child.stdout.on('data', function(buf) { - var childOutput = String(buf); grunt.log.writeln(childOutput); /** @@ -79,6 +76,15 @@ module.exports = function(grunt) { if (!(options.outputJson && JSON.parse(childOutput).length === 0)) { hasDuplicates = true; } + + innerNext(error); + }); + + /** + * Displays the output and error streams via the parent process. + */ + child.stdout.on('data', function(buf) { + childOutput += String(buf); }); child.stderr.on('data', function(buf) {