+22
-3
@@ -33,8 +33,11 @@ /*! | ||
| Base.call(this, {}, options); | ||
| Base.call(this); | ||
| this.use(utils.plugins()); | ||
| this.is('Scaffold'); | ||
| Scaffold.emit('create', this); | ||
| this.on('target', Scaffold.emit.bind(Scaffold, 'target')); | ||
| this.on('files', Scaffold.emit.bind(Scaffold, 'files')); | ||
| this.options = options || {}; | ||
| this.Target = this.options.Target || utils.Target; | ||
| this.targets = {}; | ||
@@ -148,3 +151,5 @@ | ||
| var target = new this.Target(this.options); | ||
| var Target = this.get('Target'); | ||
| var target = new Target(this.options); | ||
| target.on('files', this.emit.bind(this, 'files')); | ||
@@ -164,2 +169,16 @@ utils.define(target, 'name', name); | ||
| /** | ||
| * Get or set the `Target` constructor to use for creating new targets. | ||
| */ | ||
| Object.defineProperty(Scaffold.prototype, 'Target', { | ||
| configurable: true, | ||
| set: function(Target) { | ||
| utils.define(this, '_Target', Target); | ||
| }, | ||
| get: function() { | ||
| return this._Target || this.options.Target || utils.Target; | ||
| } | ||
| }); | ||
| /** | ||
| * Expose `Scaffold` | ||
@@ -166,0 +185,0 @@ */ |
+6
-6
| { | ||
| "name": "scaffold", | ||
| "description": "Conventions and API for creating declarative configuration objects for project scaffolds - similar in format to a grunt task, but more portable, generic and can be used by any build system or generator - even gulp.", | ||
| "version": "0.2.7", | ||
| "version": "0.2.8", | ||
| "homepage": "https://github.com/jonschlinkert/scaffold", | ||
@@ -24,6 +24,6 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
| "dependencies": { | ||
| "base": "^0.11.0", | ||
| "base": "^0.11.1", | ||
| "base-plugins": "^0.4.13", | ||
| "define-property": "^0.2.5", | ||
| "expand-target": "^0.6.3", | ||
| "expand-target": "^0.6.4", | ||
| "expand-utils": "^0.2.1", | ||
@@ -40,8 +40,8 @@ "extend-shallow": "^2.0.1", | ||
| "gulp-format-md": "^0.1.9", | ||
| "gulp-istanbul": "^0.10.4", | ||
| "gulp-istanbul": "^1.0.0", | ||
| "gulp-mocha": "^2.2.0", | ||
| "mocha": "^2.5.3", | ||
| "repeat-string": "^1.5.4", | ||
| "should": "^9.0.0", | ||
| "stringify-object": "^2.3.1" | ||
| "should": "^9.0.2", | ||
| "stringify-object": "^2.4.0" | ||
| }, | ||
@@ -48,0 +48,0 @@ "keywords": [ |
7684
6.1%175
9.38%Updated
Updated