Skip to content

Commit

Permalink
.files -> .src, .folder -> .dest, removed .file, updated deps, 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Aug 7, 2013
1 parent 802c34b commit e75bde9
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 75 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ module.exports = gulp = {
});
return this;
},
files: require('./lib/createFilesStream'),
file: require('./lib/createFileStream'),
folder: require('./lib/createFolderStream'),
src: require('./lib/createInputStream'),
dest: require('./lib/createOutputStream'),

watch: require('./lib/watchFile'),
createGlobStream: require('glob-stream').create,
Expand Down
21 changes: 0 additions & 21 deletions lib/createFileStream.js

This file was deleted.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name":"gulp",
"description":"Simple stream-y build helper",
"version":"0.1.0",
"version":"0.2.0",
"homepage":"http://github.com/wearefractal/gulp",
"repository":"git://github.com/wearefractal/gulp.git",
"author":"Fractal <[email protected]> (http://wearefractal.com/)",
Expand All @@ -12,12 +12,12 @@
"gulp":"./bin/gulp"
},
"dependencies":{
"event-stream":"3.0.15",
"event-stream":"3.0.16",
"glob-stream":"0.0.3",
"mkdirp":"0.3.5",
"optimist":"0.6.0",
"gulp-util":"*",
"gaze":"0.4.0"
"gaze":"0.4.1"
},
"devDependencies":{
"mocha":"1.12.0",
Expand Down
14 changes: 7 additions & 7 deletions test/folder.js → test/dest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ var fs = require('fs');

require('mocha');

describe('gulp file collection', function() {
describe('folder()', function() {
describe('gulp output stream', function() {
describe('dest()', function() {
it('should return a stream', function(done) {
var stream = gulp.folder(join(__dirname, "./fixtures/"));
var stream = gulp.dest(join(__dirname, "./fixtures/"));
should.exist(stream);
should.exist(stream.on);
done();
});
it('should return a folder stream that writes files', function(done) {
it('should return a output stream that writes files', function(done) {
var outpath = join(__dirname, "./out-fixtures");
rimraf(outpath, function(err){
should.not.exist(err);
var instream = gulp.files(join(__dirname, "./fixtures/**/*.txt"));
var outstream = gulp.folder(outpath);
var instream = gulp.src(join(__dirname, "./fixtures/**/*.txt"));
var outstream = gulp.dest(outpath);
instream.pipe(outstream);

outstream.on('error', done);
Expand All @@ -42,4 +42,4 @@ describe('gulp file collection', function() {
});
});
});
});
});
32 changes: 0 additions & 32 deletions test/file.js

This file was deleted.

36 changes: 27 additions & 9 deletions test/files.js → test/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ var should = require('should');
var join = require('path').join;
require('mocha');

describe('gulp file collection', function() {
describe('files()', function() {
describe('gulp input stream', function() {
describe('src()', function() {
it('should return a stream', function(done) {
var stream = gulp.files(join(__dirname, "./fixtures/*.coffee"));
var stream = gulp.src(join(__dirname, "./fixtures/*.coffee"));
should.exist(stream);
should.exist(stream.on);
done();
});
it('should return a files stream from a flat glob', function(done) {
var stream = gulp.files(join(__dirname, "./fixtures/*.coffee"));
it('should return a input stream from a flat glob', function(done) {
var stream = gulp.src(join(__dirname, "./fixtures/*.coffee"));
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
Expand All @@ -25,8 +25,8 @@ describe('gulp file collection', function() {
done();
});
});
it('should return a files stream from a deep glob', function(done) {
var stream = gulp.files(join(__dirname, "./fixtures/**/*.jade"));
it('should return a input stream from a deep glob', function(done) {
var stream = gulp.src(join(__dirname, "./fixtures/**/*.jade"));
stream.on('error', done);
stream.on('data', function(file) {
should.exist(file);
Expand All @@ -39,8 +39,8 @@ describe('gulp file collection', function() {
done();
});
});
it('should return a files stream from a deeper glob', function(done) {
var stream = gulp.files(join(__dirname, "./fixtures/**/*.dmc"));
it('should return a input stream from a deeper glob', function(done) {
var stream = gulp.src(join(__dirname, "./fixtures/**/*.dmc"));
var a = 0;
stream.on('error', done);
stream.on('data', function(file) {
Expand All @@ -51,5 +51,23 @@ describe('gulp file collection', function() {
done();
});
});

it('should return a file stream from a flat path', function(done) {
var a = 0;
var stream = gulp.src(join(__dirname, "./fixtures/test.coffee"));
stream.on('error', done);
stream.on('data', function(file) {
++a;
should.exist(file);
should.exist(file.path);
should.exist(file.contents);
file.path.should.equal(join(__dirname, "./fixtures/test.coffee"));
String(file.contents).should.equal("this is a test");
});
stream.on('end', function() {
a.should.equal(1);
done();
});
});
});
});

0 comments on commit e75bde9

Please sign in to comment.