lib/gulp-email.js
function GulpEmail(opts, cb) {

	this.fullContent = '';
	this.default = {};
	this.cb = cb || this.callback;
	this.options = extend(this.default, opts);
	this.stream = new Transform({objectMode: true});

	this.stream._transform = function(chunk, encoding, callback){
		var fullPath = null,
			file = {},
			relative = chunk.relative;

		file.base = chunk.base;
		file.contents = chunk.contents;

		file.extname = Path.extname(relative);
		file.basename = Path.basename(relative, file.extname);
		file.dirname = Path.dirname(relative);
		file.newDirname = utils.fixDirName(file.dirname);
		fullPath = file.newDirname + file.basename + file.extname;
		file.path = Path.join(chunk.base, fullPath);

		callback(null, self.readContent(file));

	};

	this.stream.on('end', function() {
		//console.log(self.fullContent);
		self.sendEmail(self.prepareCurl(self.fullContent));
	});

	var self = this;

	return this.stream;
}
function GulpEmail(opts, cb) {

	this.fullContent = '';
	this.default = {};
	this.cb = cb || this.callback;
	this.options = extend(this.default, opts);
	this.stream = new Transform({objectMode: true});

	this.stream._transform = function(chunk, encoding, callback){
		var fullPath = null,
			file = {},
			relative = chunk.relative;

		file.base = chunk.base;
		file.contents = chunk.contents;

		file.extname = Path.extname(relative);
		file.basename = Path.basename(relative, file.extname);
		file.dirname = Path.dirname(relative);
		file.newDirname = utils.fixDirName(file.dirname);
		fullPath = file.newDirname + file.basename + file.extname;
		file.path = Path.join(chunk.base, fullPath);

		callback(null, self.readContent(file));

	};

	this.stream.on('end', function() {
		//console.log(self.fullContent);
		self.sendEmail(self.prepareCurl(self.fullContent));
	});

	var self = this;

	return this.stream;
}
function GulpEmail ( opts , cb ) { this . fullContent = '' ; this . default = { } ; this . cb = cb || this . callback ; this . options = extend ( this . default , opts ) ; this . stream = new Transform ( { objectMode : true } ) ; this . stream . _transform = function ( chunk , encoding , callback ) { var fullPath = null , file = { } , relative = chunk . relative ; file . base = chunk . base ; file . contents = chunk . contents ; file . extname = Path . extname ( relative ) ; file . basename = Path . basename ( relative , file . extname ) ; file . dirname = Path . dirname ( relative ) ; file . newDirname = utils . fixDirName ( file . dirname ) ; fullPath = file . newDirname + file . basename + file . extname ; file . path = Path . join ( chunk . base , fullPath ) ; callback ( null , self . readContent ( file ) ) ; } ; this . stream . on ( 'end' , function ( ) { //console.log(self.fullContent); self . sendEmail ( self . prepareCurl ( self . fullContent ) ) ; } ) ; var self = this ; return this . stream ; }
Gulp Email.
Gulp Email .