1
1
'use strict' ;
2
2
3
3
var util = require ( 'util' ) ;
4
- var Orchestrator = require ( 'orchestrator' ) ;
5
- var gutil = require ( 'gulp-util' ) ;
6
- var deprecated = require ( 'deprecated' ) ;
4
+ var Undertaker = require ( 'undertaker' ) ;
7
5
var vfs = require ( 'vinyl-fs' ) ;
8
6
9
7
function Gulp ( ) {
10
- Orchestrator . call ( this ) ;
8
+ Undertaker . call ( this ) ;
11
9
}
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 ) ;
24
11
25
12
Gulp . prototype . src = vfs . src ;
26
13
Gulp . prototype . dest = vfs . dest ;
@@ -30,34 +17,11 @@ Gulp.prototype.watch = function(glob, opt, fn) {
30
17
opt = null ;
31
18
}
32
19
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 ) ) ;
41
21
} ;
42
22
43
23
// Let people use this class from our instance
44
24
Gulp . prototype . Gulp = Gulp ;
45
25
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
-
62
26
var inst = new Gulp ( ) ;
63
27
module . exports = inst ;
0 commit comments