Skip to content

Commit

Permalink
remove file.contents pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Jan 9, 2014
1 parent cde327a commit c29cb15
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 27 deletions.
6 changes: 0 additions & 6 deletions lib/createInputStream/streamFile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
var fs = require('graceful-fs');
var semver = require('semver');

module.exports = function (file, cb) {
file.contents = fs.createReadStream(file.path);

// >0.10 needs this stream fix
if (semver.lt(process.versions.node, '0.10.0')) {
file.contents.pause();
}
cb(null, file);
};
10 changes: 1 addition & 9 deletions lib/createOutputStream/writeFile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var fs = require('graceful-fs');
var semver = require('semver');
var gutil = require('gulp-util');

module.exports = function (writePath, file, cb) {
Expand All @@ -9,15 +8,8 @@ module.exports = function (writePath, file, cb) {
// stream it to disk yo
if (file.isStream()) {
var outStream = fs.createWriteStream(writePath);
file.contents.once('end', function(){
cb(null, file);
});
file.contents.pipe(outStream);

// >0.10 needs this stream fix
if (semver.lt(process.versions.node, '0.10.0')) {
file.contents.resume();
}
cb(null, file);
return;
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"gulp-util": "~2.2.0",
"orchestrator": "~0.3.0",
"resolve": "~0.6.1",
"semver": "~2.2.1",
"findup-sync": "~0.1.2",
"pretty-hrtime": "~0.2.0",
"glob-watcher": "0.0.1",
Expand Down
5 changes: 0 additions & 5 deletions test/file-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var should = require('should');
var path = require('path');
var join = path.join;
var dirname = path.dirname;
var semver = require('semver');
require('mocha');

var bufferFile = require('../lib/createInputStream/bufferFile');
Expand Down Expand Up @@ -68,10 +67,6 @@ describe('gulp streamFile', function() {
buf.should.equal("this is a test");
done();
});
// >0.10 needs this stream fix
if (semver.lt(process.versions.node, '0.10.0')) {
file.contents.resume();
}
});
});
});
Expand Down
6 changes: 0 additions & 6 deletions test/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
var gulp = require('../');
var should = require('should');
var join = require('path').join;
var semver = require('semver');

require('mocha');

Expand Down Expand Up @@ -124,11 +123,6 @@ describe('gulp input stream', function() {
done();
});
join(file.path,'').should.equal(join(__dirname, "./fixtures/test.coffee"));

// >0.10 needs this stream fix
if (semver.lt(process.versions.node, '0.10.0')) {
file.contents.resume();
}
});
});
it('should return a input stream from a deep glob', function(done) {
Expand Down

0 comments on commit c29cb15

Please sign in to comment.