Skip to content

Commit 33b1fcd

Browse files
committed
v1.0.0
1 parent dbd6733 commit 33b1fcd

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
'use strict';
2-
var gutil = require('gulp-util');
3-
var PluginError = gutil.PluginError;
42
var through = require('through2');
53
var path = require('path');
64

@@ -20,7 +18,7 @@ function plugin(keepQuantity) {
2018
}
2119
lists[identifier].push({
2220
file: file,
23-
time: file.stat.ctime.getTime()
21+
time: file.stat.mtime.getTime()
2422
});
2523
}
2624
cb();

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gulp-rev-outdated",
3-
"version": "0.1.1",
3+
"version": "1.0.0",
44
"description": "Old static asset revision files filter",
55
"license": "MIT",
66
"repository": {
@@ -43,11 +43,11 @@
4343
"filter"
4444
],
4545
"dependencies": {
46-
"gulp-util": "^3.0.0",
47-
"through2": ">=0.5.1"
46+
"through2": "^3.0.0",
47+
"vinyl": "^2.2.0"
4848
},
4949
"devDependencies": {
50-
"mocha": "*"
50+
"mocha": "^5.2.0"
5151
},
5252
"bugs": {
5353
"url": "https://github.com/shonny-ua/gulp-rev-outdated/issues"

test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
2-
var assert = require('assert');
3-
var gutil = require('gulp-util');
2+
var assert = require('assert');
3+
var Vinyl = require('vinyl');
44
var revOutdated = require('./index');
5-
var path = require('path');
5+
var path = require('path');
66

77
var assets = [
88
{path: 'css/style.css', time: 0},
@@ -127,9 +127,14 @@ it('should filter correct files', function (cb) {
127127

128128
function initStream(stream) {
129129
assets.forEach(function (asset) {
130-
stream.write(new gutil.File({
130+
var dateByTime = new Date(asset.time);
131+
stream.write(new Vinyl({
131132
path: asset.path,
132-
stat: {ctime: new Date(asset.time)},
133+
stat: {
134+
ctime: dateByTime,
135+
mtime: dateByTime,
136+
atime: dateByTime
137+
},
133138
contents: new Buffer(' ')
134139
}));
135140
});

0 commit comments

Comments
 (0)