Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shonny-ua committed Jan 2, 2019
1 parent dbd6733 commit 33b1fcd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var through = require('through2');
var path = require('path');

Expand All @@ -20,7 +18,7 @@ function plugin(keepQuantity) {
}
lists[identifier].push({
file: file,
time: file.stat.ctime.getTime()
time: file.stat.mtime.getTime()
});
}
cb();
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-rev-outdated",
"version": "0.1.1",
"version": "1.0.0",
"description": "Old static asset revision files filter",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -43,11 +43,11 @@
"filter"
],
"dependencies": {
"gulp-util": "^3.0.0",
"through2": ">=0.5.1"
"through2": "^3.0.0",
"vinyl": "^2.2.0"
},
"devDependencies": {
"mocha": "*"
"mocha": "^5.2.0"
},
"bugs": {
"url": "https://github.com/shonny-ua/gulp-rev-outdated/issues"
Expand Down
15 changes: 10 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
var assert = require('assert');
var gutil = require('gulp-util');
var assert = require('assert');
var Vinyl = require('vinyl');
var revOutdated = require('./index');
var path = require('path');
var path = require('path');

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

function initStream(stream) {
assets.forEach(function (asset) {
stream.write(new gutil.File({
var dateByTime = new Date(asset.time);
stream.write(new Vinyl({
path: asset.path,
stat: {ctime: new Date(asset.time)},
stat: {
ctime: dateByTime,
mtime: dateByTime,
atime: dateByTime
},
contents: new Buffer(' ')
}));
});
Expand Down

0 comments on commit 33b1fcd

Please sign in to comment.