Skip to content

Commit

Permalink
remove File struct to gulp-util
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Dec 8, 2013
1 parent 0732a78 commit 89a894b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 67 deletions.
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ Gulp.prototype.src = require('./lib/createInputStream');
Gulp.prototype.dest = require('./lib/createOutputStream');
Gulp.prototype.watch = require('./lib/watch');

Gulp.prototype.File = require("./lib/File");

var gulp = new Gulp();
gulp.Gulp = Gulp;

Expand Down
17 changes: 0 additions & 17 deletions lib/File.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/createInputStream/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var es = require('event-stream');
var gs = require('glob-stream');

var File = require('../File');
var File = require('gulp-util').File;
var getContents = require('./getContents');
var getStats = require('./getStats');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"glob-stream": "~3.0.0",
"mkdirp": "~0.3.5",
"optimist": "~0.6.0",
"gulp-util": "~1.1.1",
"gulp-util": "~1.2.0",
"gaze": "~0.4.3",
"orchestrator": "~0.1.0",
"resolve": "~0.6.1",
Expand Down
49 changes: 3 additions & 46 deletions test/file-utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('../');
var gutil = require('gulp-util');
var should = require('should');
var path = require('path');
var join = path.join;
Expand All @@ -14,7 +15,7 @@ describe('gulp bufferFile', function() {
it('should return a valid file', function(done) {
var fname = join(__dirname, "./fixtures/test.coffee");
var base = join(__dirname, "./fixtures/");
var file = new gulp.File({
var file = new gutil.File({
base: base,
cwd: __dirname,
path: fname
Expand Down Expand Up @@ -42,7 +43,7 @@ describe('gulp streamFile', function() {
it('should return a valid file', function(done) {
var fname = join(__dirname, "./fixtures/test.coffee");
var base = join(__dirname, "./fixtures/");
var file = new gulp.File({
var file = new gutil.File({
base: base,
cwd: __dirname,
path: fname
Expand Down Expand Up @@ -74,48 +75,4 @@ describe('gulp streamFile', function() {
});
});
});
});

describe('gulp File class', function() {
describe('File()', function() {
it('should return a valid file', function(done) {
var fname = join(__dirname, "./fixtures/test.coffee");
var base = join(__dirname, "./fixtures/");
var file = new gulp.File({
base: base,
cwd: __dirname,
path: fname
});
should.exist(file, 'root');
should.exist(file.relative, 'relative');
should.exist(file.path, 'path');
should.exist(file.cwd, 'cwd');
should.exist(file.base, 'base');
file.path.should.equal(fname);
file.cwd.should.equal(__dirname);
file.base.should.equal(base);
file.relative.should.equal("test.coffee");
done();
});

it('should return a valid file 2', function(done) {
var fname = join(__dirname, "./fixtures/test.coffee");
var base = __dirname;
var file = new gulp.File({
base: base,
cwd: __dirname,
path: fname
});
should.exist(file, 'root');
should.exist(file.relative, 'relative');
should.exist(file.path, 'path');
should.exist(file.cwd, 'cwd');
should.exist(file.base, 'base');
file.path.should.equal(fname);
file.cwd.should.equal(__dirname);
file.base.should.equal(base);
file.relative.should.equal("fixtures/test.coffee");
done();
});
});
});

0 comments on commit 89a894b

Please sign in to comment.