yeoman/generator — pull request #688 by stefanbuck (2014-10-30 23:03:29+00:00)
Title: store prompt answers in a global config file

In addition to this previous Pull Request https://github.com/yeoman/generator/pull/579.

This Pull Request, adds the ability to save the answers from a inquire prompt in a global config file `.yo-rc-global.json`. The answer will be set in the future as the default answer.

To enable this feature just set `store: true` on each prompt which you want to save. The default value is set to `false`.
```
var prompts = [{
type: 'input',
name: 'githubUsername',
message: 'What is your GitHub username',
store: true
},
{
type: 'list',
name: 'licence',
message: 'Choose a licence',
choices: ['MIT', 'GPL', 'Apache'],
store: true
},{
type: 'password',
name: 'password',
message: 'Your password'
// Will not saved
}
];

this.prompt(prompts, callback);
```

You can clear the global cache directly from your yo cli. Take a look at the related PullRequest https://github.com/yeoman/yo/pull/

### Changes i did

The `storage.js` takes now a third (optional) argument `version` in his constructor. This is need to bind the answers to a specify generator version.

The structure of `.yo-rc-global.json` looks like this
```
{
"generator-node-gulp": {
"0.5.3": {
"promptValues": {
"githubUsername": "stefanbuck",
"authorName": "Stefan Buck",
"modules": [
"jscsModule",
"istanbulModule"
],
"dependencies": [
"lodash",
"debug"
]
}
}
}
}
```