lib/devour.js
function plug(name) {
		var part, scope;

		if (!('buffer' in plug.prototype)) {
			plug.prototype.buffer = {};
		}

		part  = name.split('.');
		scope = part.shift();

		if (!(scope in plug.prototype.buffer)) {
			plug.prototype.buffer[scope] = wanted.require('gulp-' + scope);
		}

		scope = plug.prototype.buffer[scope];

		part.forEach(function(p) {
			scope = scope[p];
		});

		//  this may be an a-typical gulp plugin (e.g. sourcemaps) which provides no stream, the implementer probably
		//  knows what to do with this
		if (typeof scope !== 'function') {
			return scope;
		}

		//  invoke the function in the scope with the arguments after the name
		//  this should create a stream
		return scope.apply(null, Array.prototype.slice.call(arguments, 1))
			//  always register an error listener for plugins
			.on('error', function(error) {
				console.error('Error from plugin %s: %s', chalk.red(name), error);
				this.emit('end');
			})
		;
	}
function plug(name) {
		var part, scope;

		if (!('buffer' in plug.prototype)) {
			plug.prototype.buffer = {};
		}

		part  = name.split('.');
		scope = part.shift();

		if (!(scope in plug.prototype.buffer)) {
			plug.prototype.buffer[scope] = wanted.require('gulp-' + scope);
		}

		scope = plug.prototype.buffer[scope];

		part.forEach(function(p) {
			scope = scope[p];
		});

		//  this may be an a-typical gulp plugin (e.g. sourcemaps) which provides no stream, the implementer probably
		//  knows what to do with this
		if (typeof scope !== 'function') {
			return scope;
		}

		//  invoke the function in the scope with the arguments after the name
		//  this should create a stream
		return scope.apply(null, Array.prototype.slice.call(arguments, 1))
			//  always register an error listener for plugins
			.on('error', function(error) {
				console.error('Error from plugin %s: %s', chalk.red(name), error);
				this.emit('end');
			})
		;
	}
function plug ( name ) { var part , scope ; if ( ! ( 'buffer' in plug . prototype ) ) { plug . prototype . buffer = { } ; } part = name . split ( '.' ) ; scope = part . shift ( ) ; if ( ! ( scope in plug . prototype . buffer ) ) { plug . prototype . buffer [ scope ] = wanted . require ( 'gulp-' + scope ) ; } scope = plug . prototype . buffer [ scope ] ; part . forEach ( function ( p ) { scope = scope [ p ] ; } ) ; //  this may be an a-typical gulp plugin (e.g. sourcemaps) which provides no stream, the implementer probably //  knows what to do with this if ( typeof scope !== 'function' ) { return scope ; } //  invoke the function in the scope with the arguments after the name //  this should create a stream return scope . apply ( null , Array . prototype . slice . call ( arguments , 1 ) ) //  always register an error listener for plugins . on ( 'error' , function ( error ) { console . error ( 'Error from plugin %s: %s' , chalk . red ( name ) , error ) ; this . emit ( 'end' ) ; } ) ; }
Obtain a gulp plugin, initialized with given arguments
@name    plug
@access  internal
@param   string  name [automatically prefixed with 'gulp-']
@return  stream  initialized plugin
Obtain a gulp plugin initialized with given arguments