diff --git a/.travis.yml b/.travis.yml index e318d1f..d921660 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - '0.10' + - '4.0.0' after_script: - npm test diff --git a/index.js b/index.js index 6dc02d7..c99c097 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ var through = require("through2"), - gutil = require("gulp-util"), + PluginError = require("plugin-error"), Path = require("path"), changeCase = require("change-case"), colors = require("colors"); @@ -9,7 +9,7 @@ module.exports = function (options) { var out = []; // if necessary check for required options(s), e.g. options hash, etc. if (!options || !changeCase[options.caseName]) { - throw new gutil.PluginError("gulp-check-file-naming-convention", "No options supplied"); + throw new PluginError("gulp-check-file-naming-convention", "No options supplied"); } // parse src path @@ -34,7 +34,7 @@ module.exports = function (options) { // accepting streams is optional this.emit("error", - new gutil.PluginError("gulp-check-file-naming-convention", "Stream content is not supported")); + new PluginError("gulp-check-file-naming-convention", "Stream content is not supported")); return callback(); } @@ -53,7 +53,7 @@ module.exports = function (options) { return through.obj(checkFileNamingConvention, function(callback) { if(out.length > 0) { - this.emit('error', new gutil.PluginError('gulp-check-file-naming-convention', out.join('\n\n'), { + this.emit('error', new PluginError('gulp-check-file-naming-convention', out.join('\n\n'), { showStack: false })); } diff --git a/package.json b/package.json index 1015abf..c25fde5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "through2": "*", - "gulp-util": "~2.2.0", + "plugin-error": "^1.0.1", "change-case": "*", "colors": "~1.0.3" }, @@ -28,7 +28,8 @@ "mocha-lcov-reporter": "*", "istanbul": "*", "event-stream": "*", - "should": "~2.1.0" + "should": "~2.1.0", + "vinyl": "^2.1.0" }, "engines": { "node": ">=0.8.0", diff --git a/test/main.js b/test/main.js index 7258c3f..33126bb 100644 --- a/test/main.js +++ b/test/main.js @@ -9,7 +9,7 @@ require("mocha"); delete require.cache[require.resolve("../")]; -var gutil = require("gulp-util"), +var File = require("vinyl"), checkFileNamingConvention = require("../"); describe("gulp-check-file-naming-convention", function () { @@ -21,12 +21,12 @@ describe("gulp-check-file-naming-convention", function () { stream.on('data', function () {}); stream.on("end", done); - stream.write(new gutil.File({ + stream.write(new File({ path: "test/fixtures/camelCase/testSample.js", cwd: "test/", base: "test/fixtures", })); - stream.write(new gutil.File({ + stream.write(new File({ path: "test/fixtures/camelCase/test.js", cwd: "test/", base: "test/fixtures", @@ -42,7 +42,7 @@ describe("gulp-check-file-naming-convention", function () { stream.on('data', function () {}); stream.on("end", done); - stream.write(new gutil.File({ + stream.write(new File({ path: "test/fixtures/paramCase/test-sample.js", cwd: "test/", base: "test/fixtures", @@ -60,7 +60,7 @@ describe("gulp-check-file-naming-convention", function () { done(); }); - stream.write(new gutil.File({ + stream.write(new File({ path: "test/fixtures/paramCase/testSample.js", cwd: "test/", base: "test/fixtures", @@ -68,7 +68,7 @@ describe("gulp-check-file-naming-convention", function () { stream.end(); }); it("should error on stream", function (done) { - var srcFile = new gutil.File({ + var srcFile = new File({ path: "test/fixtures/hello.txt", cwd: "test/", base: "test/fixtures",