code: function(name, val, options) {
          debug('.setGenerator', name);
  
          if (this.hasGenerator(name)) {
            return this.findGenerator(name);
          }
  
          // ensure local sub-generator paths are resolved
          if (typeof val === 'string' && val.charAt(0) === '.' && this.env) {
            val = path.resolve(this.env.dirname, val);
          }
  
          return generator(name, val, options, this);
        }
docs: Store a generator by file path or instance with the given
  `name` and `options`.
  
  ```js
  app.setGenerator('foo', function(app, base) {
  // "app" - private instance created for generator "foo"
  // "base" - instance shared by all generators
  // "env" - environment object for the generator
  // "options" - options passed to the generator
  });
  ```
  @name .setGenerator
  @param {String} `name` The generator's name
  @param {Object|Function|String} `options` or generator
  @param {Object|Function|String} `generator` Generator function, instance or filepath.
  @return {Object} Returns the generator instance.
  @api public