3 var util = require('util');
4 var Orchestrator = require('orchestrator');
5 var gutil = require('gulp-util');
6 var deprecated = require('deprecated');
7 var vfs = require('vinyl-fs');
10 Orchestrator.call(this);
12 util.inherits(Gulp, Orchestrator);
14 Gulp.prototype.task = Gulp.prototype.add;
15 Gulp.prototype.run = function() {
16 // `run()` is deprecated as of 3.5 and will be removed in 4.0
17 // Use task dependencies instead
19 // Impose our opinion of "default" tasks onto orchestrator
20 var tasks = arguments.length ? arguments : ['default'];
22 this.start.apply(this, tasks);
25 Gulp.prototype.src = vfs.src;
26 Gulp.prototype.dest = vfs.dest;
27 Gulp.prototype.watch = function(glob, opt, fn) {
28 if (typeof opt === 'function' || Array.isArray(opt)) {
33 // Array of tasks given
34 if (Array.isArray(fn)) {
35 return vfs.watch(glob, opt, function() {
36 this.start.apply(this, fn);
40 return vfs.watch(glob, opt, fn);
43 // Let people use this class from our instance
44 Gulp.prototype.Gulp = Gulp;
47 deprecated.field('gulp.env has been deprecated. ' +
48 'Use your own CLI parser instead. ' +
49 'We recommend using yargs or minimist.',
56 Gulp.prototype.run = deprecated.method('gulp.run() has been deprecated. ' +
57 'Use task dependencies or gulp.watch task triggering instead.',
62 var inst = new Gulp();
63 module.exports = inst;