code: function(name, val, options) {
          debug('.generator', name, val);
  
          if (this.hasGenerator(name)) {
            return this.getGenerator(name);
          }
  
          this.setGenerator.apply(this, arguments);
          return this.getGenerator(name);
        }
docs: Get and invoke generator `name`, or register generator `name` with
  the given `val` and `options`, then invoke and return the generator
  instance. This method differs from `.register`, which lazily invokes
  generator functions when `.generate` is called.
  
  ```js
  app.generator('foo', function(app, base, env, options) {
  // "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 .generator
  @param {String} `name`
  @param {Function|Object} `fn` Generator function, instance or filepath.
  @return {Object} Returns the generator instance or undefined if not resolved.
  @api public