Skip to content

Commit b74cfc3

Browse files
author
Andrzej Ladomirski
committed
gulp-util changed
1 parent 371a4ce commit b74cfc3

File tree

4 files changed

+2392
-10
lines changed

4 files changed

+2392
-10
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

3-
var gutil = require('gulp-util');
3+
// var gutil = require('gulp-util');
4+
var PluginError = require('plugin-error');
45
var through = require('through2');
56
var csslint = require('csslint').CSSLint;
67
var RcLoader = require('rcloader');
@@ -16,7 +17,7 @@ var cssLintPlugin = function(options) {
1617
var rcLoader = new RcLoader('.csslintrc', options, { loader: 'async' });
1718
return through.obj(function(file, enc, cb) {
1819
if (file.isNull()) return cb(null, file); // pass along
19-
if (file.isStream()) return cb(new gutil.PluginError('gulp-csslint: Streaming not supported'), file);
20+
if (file.isStream()) return cb(new PluginError('gulp-csslint: Streaming not supported'), file);
2021

2122
var ruleset = {};
2223
// Build a list of all available rules
@@ -139,7 +140,7 @@ cssLintPlugin.failFormatter = function() {
139140
return cb(null, file);
140141
}
141142

142-
return cb(new gutil.PluginError('gulp-csslint', 'CSSLint failed for ' + file.relative), file);
143+
return cb(new PluginError('gulp-csslint', 'CSSLint failed for ' + file.relative), file);
143144
});
144145
};
145146

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
],
99
"dependencies": {
1010
"csslint": "^1.0.2",
11-
"gulp-util": "^3.0.7",
11+
"fancy-log": "^1.3.2",
12+
"plugin-error": "^1.0.1",
1213
"rcloader": "^0.2.1",
13-
"through2": "^2.0.1"
14+
"through2": "^2.0.1",
15+
"vinyl": "^2.1.0"
1416
},
1517
"devDependencies": {
1618
"coveralls": "^2.11.12",

test/main.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
var cssLintPlugin = require('../');
44
var cssLint = require('csslint').CSSLint;
55
var should = require('should');
6-
var gutil = require('gulp-util');
6+
var fancyLog = require('fancy-log');
7+
var Vinyl = require('vinyl');
78
var fs = require('fs');
89
var path = require('path');
910
var sinon = require('sinon');
1011

1112
var getFile = function(filePath) {
1213
filePath = 'test/' + filePath;
13-
return new gutil.File({
14+
return new Vinyl({
1415
path: filePath,
1516
cwd: 'test/',
1617
base: path.dirname(filePath),
@@ -408,7 +409,7 @@ describe('gulp-csslint', function() {
408409
}
409410
});
410411

411-
sinon.stub(gutil, 'log');
412+
sinon.stub(fancyLog, 'info');
412413

413414
formatterStream.on('data', function() {
414415
++a;
@@ -423,9 +424,9 @@ describe('gulp-csslint', function() {
423424
formatterStream.once('end', function() {
424425
fs.writeFile('test-output.xml', output, function() {
425426
a.should.equal(1);
426-
sinon.assert.notCalled(gutil.log);
427+
sinon.assert.notCalled(fancyLog.info);
427428

428-
gutil.log.restore();
429+
fancyLog.info.restore();
429430

430431
fs.readFile('test-output.xml', function(err, content) {
431432
(err === null).should.be.true;

0 commit comments

Comments
 (0)