From 1a1200697e6d1ac2a3e94cc3885c7200875c881a Mon Sep 17 00:00:00 2001 From: Ben Briggs Date: Thu, 2 Jul 2015 18:01:46 +0100 Subject: [PATCH] Tidy up, bump dependencies. --- LICENSE-MIT | 2 +- README.md | 6 ++++-- index.js | 18 +++++++++--------- package.json | 18 +++++++++--------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/LICENSE-MIT b/LICENSE-MIT index 4799184..fd0e863 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2015 Ben Briggs +Copyright (c) Ben Briggs (http://beneb.info) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/README.md b/README.md index 44b1562..6f6a744 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ *If you have any difficulties with the output of this plugin, please use the [UnCSS tracker][bugs].* -Install via [npm](https://npmjs.org/package/gulp-uncss): +## Install + +With [npm](https://npmjs.org/package/gulp-uncss) do: ``` npm install gulp-uncss --save-dev @@ -94,7 +96,7 @@ to cover it. ## License -MIT © Ben Briggs +MIT © [Ben Briggs](http://beneb.info) [bugs]: https://github.com/giakki/uncss/issues [ci]: https://travis-ci.org/ben-eb/gulp-uncss diff --git a/index.js b/index.js index c8959f3..de425a1 100644 --- a/index.js +++ b/index.js @@ -7,28 +7,28 @@ var uncss = require('uncss'), PLUGIN_NAME = 'gulp-uncss'; -module.exports = function(options) { - var stream = new transform({ objectMode: true }); +module.exports = function (options) { + var stream = new transform({objectMode: true}); // Ignore stylesheets in the HTML files; only use those from the stream options.ignoreSheets = [/\s*/]; - stream._transform = function(file, unused, done) { + stream._transform = function (file, encoding, cb) { if (file.isStream()) { var error = 'Streaming not supported'; - return done(new gutil.PluginError(PLUGIN_NAME, error)); + return cb(new gutil.PluginError(PLUGIN_NAME, error)); } else if (file.isBuffer()) { - options = assign(options, { raw: String(file.contents) }); - uncss(options.html, options, function(err, output) { + options = assign(options, {raw: String(file.contents)}); + uncss(options.html, options, function (err, output) { if (err) { - return done(new gutil.PluginError(PLUGIN_NAME, err)); + return cb(new gutil.PluginError(PLUGIN_NAME, err)); } file.contents = new Buffer(output); - done(null, file); + cb(null, file); }); } else { // Pass through when null - done(null, file); + cb(null, file); } }; diff --git a/package.json b/package.json index 560fccf..1591678 100644 --- a/package.json +++ b/package.json @@ -22,17 +22,17 @@ "gulpplugin" ], "dependencies": { - "gulp-util": "~3.0.1", - "object-assign": "^2.0.0", - "uncss": "^0.12.0" + "gulp-util": "~3.0.6", + "object-assign": "^3.0.0", + "uncss": "^0.12.1" }, "devDependencies": { - "chai": "~1.10.0", - "event-stream": "~3.2.1", - "gulp": "~3.8.10", - "gulp-jshint": "~1.9.0", - "jshint-stylish": "~1.0.0", - "mocha": "~2.1.0", + "chai": "~3.0.0", + "event-stream": "~3.3.1", + "gulp": "~3.9.0", + "gulp-jshint": "~1.11.2", + "jshint-stylish": "~2.0.1", + "mocha": "~2.2.5", "mocha-silent-reporter": "^1.0.0" }, "main": "index.js"