yeoman/generators — pull request #63 by mklabs (2012-09-22 23:51:16+00:00)
Title: File collision menu, tests for individual generators, mocha:generator and better looking output

A lot of stuff in there. The most relevant points being the file menu collision check on every file writes, and the reworked log output.

* mv *.js lib/
* added file collision menu, checks every file system write,
checking existing file, if it's identical. If it's not, shows up the
file collision menu (Y to overwrite, n to skip, d to compute file diff,
a to overwrite all, q to quit)
* Set arguments required state based on provided defaults.
* Make sure to update the `this.options` hash in generator when
using `this.option()`, setting up default value appropriately.
* Addition of mocha:generator, invoked by the generator one. Stubs
out a new mocha test suite. Arguments can be used to setup file
assertions automatically.
* Added tests for individual generators. Generators making use of
prompts are not tested yet (it requires us pulling in the Runnable
helper from yeoman). `npm test` is happy with 200+ tests.
* add support/ directory, scripts to generate mocha specs for a given
generator. To use `./support/test ` with `` being
the name of the generator. [What it does](https://github.com/mklabs/generators/blob/68888eb155a4fc00bec8e73ac3bbe0d587b5dbe0/support/test#L7-24): it goes into a temporary dir,
trigger the given generator, redirect the output and parse out the
created files, figures out the appropriate `yeoman init mocha:generator
...` command.
* reworked the logging output to be nested and padded depending on the generators / hooks invoked.
* replace old references to new / generate commands by init in USAGE files

Once again, most of the inspiration is coming from Rails generators.

New output:

![Output](https://img.skitch.com/20120923-jxbn2njgk5dp7ttk94i1tx9ek2.png)

Collision example:

![Collision](https://img.skitch.com/20120922-kpjs68bgkshtsru4cwnb64fn82.png)

thx to @sindresorhus for the screenshots! (and feedbacks)

Should close #38 #48 #58