yeoman/generators — pull request #49 by Couto (2012-09-15 14:13:07+00:00)
Title: Match application namespace

When creating Backbone components through `yeoman init backbone:model`
the namespaces didn't match with the current one, also when creating
multiple router instances, their names would overlap each other.

example:

```
window.appName = {
Models: {},
Collections: {},
Views: {},
Routers: {},
init: function() {
console.log('Hello from Backbone!');
}
};
```

```
yeoman init backbone:model user
```

The new model would live the `appName.userModel` namespace instead of `appName.Models.userModel`

About the Router.
It's possible to have multiple Router instances, although uncommon.
the current Namespace model allows it by having `window.appName.Routers`, however when doing `yeoman init backbone:router widgetX` the generated file would be

```
appName.Router = Backbone.Router.extend({

});
```

This doesn't match the current namespace and doesn't allow multiple instances of the Router, since they would overwrite each other.

This situation has been fixed by generating a file with the current content:

```
appName.Routers.widgetXRouter = Backbone.Router.extend({

});
```

Feel free to disagree ;)