11'use strict' ;
22
33var util = require ( 'util' ) ;
4- var Orchestrator = require ( 'orchestrator' ) ;
5- var gutil = require ( 'gulp-util' ) ;
6- var deprecated = require ( 'deprecated' ) ;
4+ var Undertaker = require ( 'undertaker' ) ;
75var vfs = require ( 'vinyl-fs' ) ;
86
97function Gulp ( ) {
10- Orchestrator . call ( this ) ;
8+ Undertaker . call ( this ) ;
119}
12- util . inherits ( Gulp , Orchestrator ) ;
13-
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
18-
19- // Impose our opinion of "default" tasks onto orchestrator
20- var tasks = arguments . length ? arguments : [ 'default' ] ;
21-
22- this . start . apply ( this , tasks ) ;
23- } ;
10+ util . inherits ( Gulp , Undertaker ) ;
2411
2512Gulp . prototype . src = vfs . src ;
2613Gulp . prototype . dest = vfs . dest ;
@@ -30,34 +17,11 @@ Gulp.prototype.watch = function(glob, opt, fn) {
3017 opt = null ;
3118 }
3219
33- // Array of tasks given
34- if ( Array . isArray ( fn ) ) {
35- return vfs . watch ( glob , opt , function ( ) {
36- this . start . apply ( this , fn ) ;
37- } . bind ( this ) ) ;
38- }
39-
40- return vfs . watch ( glob , opt , fn ) ;
20+ return vfs . watch ( glob , opt , this . parallel ( fn ) ) ;
4121} ;
4222
4323// Let people use this class from our instance
4424Gulp . prototype . Gulp = Gulp ;
4525
46- // Deprecations
47- deprecated . field ( 'gulp.env has been deprecated. ' +
48- 'Use your own CLI parser instead. ' +
49- 'We recommend using yargs or minimist.' ,
50- console . warn ,
51- Gulp . prototype ,
52- 'env' ,
53- gutil . env
54- ) ;
55-
56- Gulp . prototype . run = deprecated . method ( 'gulp.run() has been deprecated. ' +
57- 'Use task dependencies or gulp.watch task triggering instead.' ,
58- console . warn ,
59- Gulp . prototype . run
60- ) ;
61-
6226var inst = new Gulp ( ) ;
6327module . exports = inst ;
0 commit comments