Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '0.10'
- '4.0.0'
after_script:
- npm test
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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
Expand All @@ -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();
}

Expand All @@ -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
}));
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"through2": "*",
"gulp-util": "~2.2.0",
"plugin-error": "^1.0.1",
"change-case": "*",
"colors": "~1.0.3"
},
Expand All @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -60,15 +60,15 @@ 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",
}));
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",
Expand Down