diff --git a/index.js b/index.js index 20030d5..6451131 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ var fs = require('fs'); var Readable = require('stream').Readable; -var gutil = require('gulp-util'); +var Vinyl = require('vinyl'); +var PluginError = require('plugin-error'); var _ = require('lodash'); var _s = require('underscore.string'); @@ -23,11 +24,11 @@ module.exports = function (options) { }); if (!options.path) { - throw new gutil.PluginError('gulp-wpstylecss', '`path` is required!'); + throw new PluginError('gulp-wpstylecss', '`path` is required!'); } if (!options.name) { - throw new gutil.PluginError('gulp-wpstylecss', '`name` is required!'); + throw new PluginError('gulp-wpstylecss', '`name` is required!'); } /* @@ -57,11 +58,11 @@ module.exports = function (options) { if (options.tags) { contents += 'Tags: ' + options.tags + '\n'; } - if (options.author) { - contents += 'Author: ' + options.author + '\n'; + if (options.author.name) { + contents += 'Author: ' + options.author.name + '\n'; } - if (options.authorUri) { - contents += 'Author URI: ' + options.authorUri + '\n'; + if (options.author.uri) { + contents += 'Author URI: ' + options.author.uri + '\n'; } if (options.license) { contents += 'License: ' + options.license + '\n'; @@ -74,9 +75,9 @@ module.exports = function (options) { var stream = new Readable({objectMode: true}); - stream.push(new gutil.File({ + stream.push(new Vinyl({ path: options.path, - contents: new Buffer(contents, 'utf8') + contents: new Buffer(contents) })); stream.push(null); diff --git a/package.json b/package.json index 45ad87b..c1b5c20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-wpstylecss", - "version": "0.0.1", + "version": "0.0.2", "description": "A plugin for Gulp", "keywords": [ "gulpplugin", @@ -16,9 +16,10 @@ "coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" }, "dependencies": { - "gulp-util": "~2.2.0", - "lodash": "^2.4.1", - "underscore.string": "^2.3.3" + "lodash": "^4.17.20", + "plugin-error": "^1.0.1", + "underscore.string": "^3.3.5", + "vinyl": "^2.2.1" }, "devDependencies": { "mocha": "*",