Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix initializer example
- Replace the use of `generate` with `init`
- Correctly reference `name` var
  • Loading branch information
robdodson committed Sep 16, 2012
1 parent 10da16b commit 1268b23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/cli/generators.md
Expand Up @@ -221,7 +221,7 @@ lib/generators/initializer/templates/initializer.js with the following content:
And now let’s change the generator to copy this template when invoked: And now let’s change the generator to copy this template when invoked:


var util = require('util'), var util = require('util'),
yeoman = require('../../../'); yeoman = require('yeoman');


module.exports = Generator; module.exports = Generator;


Expand All @@ -233,12 +233,12 @@ And now let’s change the generator to copy this template when invoked:
util.inherits(Generator, yeoman.generatos.NamedBase); util.inherits(Generator, yeoman.generatos.NamedBase);


Generator.prototype.copyInitializerFile = function() { Generator.prototype.copyInitializerFile = function() {
this.copy('initializer.js', 'config/initializers/' + name + '.js'); this.copy('initializer.js', 'config/initializers/' + this.name + '.js');
}; };


And let’s execute our generator: And let’s execute our generator:


$ yeoman generate initializer core_extensions $ yeoman init initializer core_extensions


We can see that now an initializer named `core_extensions` was created at We can see that now an initializer named `core_extensions` was created at
`config/initializers/core_extensions.js` with the contents of our template. That `config/initializers/core_extensions.js` with the contents of our template. That
Expand All @@ -249,7 +249,7 @@ we gave. The property `name` is automatically created when we inherit from


### Generators Lookup ### Generators Lookup


When you run `yeoman generate initializer core_extensions` yeoman requires these When you run `yeoman init initializer core_extensions` yeoman requires these
paths in turn until one is found: paths in turn until one is found:


lib/generators/initializer/index.js lib/generators/initializer/index.js
Expand Down

0 comments on commit 1268b23

Please sign in to comment.