var util = require('util'); var Orchestrator = require('orchestrator'); var gutil = require('gulp-util'); var deprecated = require('deprecated'); var vfs = require('vinyl-fs');
function Gulp() { Orchestrator.call(this); } util.inherits(Gulp, Orchestrator);
Orchestrator.prototype.task = function (name, dep, fn) { if (dep || fn) { // alias for add, return nothing rather than this this.add(name, dep, fn); } else { return this.tasks[name]; } };
var assign = require('object-assign'); var through = require('through2'); var gs = require('glob-stream'); var File = require('vinyl'); var duplexify = require('duplexify'); var merge = require('merge-stream'); var sourcemaps = require('gulp-sourcemaps'); var filterSince = require('../filterSince'); var isValidGlob = require('is-valid-glob');
var getContents = require('./getContents'); var resolveSymlinks = require('./resolveSymlinks');
function createFile(globFile, enc, cb) { cb(null, new File(globFile)); }
function src(glob, opt) { var options = assign({ read: true, buffer: true, sourcemaps: false, passthrough: false }, opt);
var inputPass;
if (!isValidGlob(glob)) { throw new Error('Invalid glob argument: ' + glob); }
var globStream = gs.create(glob, options);
var outputStream = globStream .pipe(resolveSymlinks()) .pipe(through.obj(createFile));
if (options.since != null) { outputStream = outputStream .pipe(filterSince(options.since)); }
if (options.read !== false) { outputStream = outputStream .pipe(getContents(options)); }