ender-js/Ender — pull request #158 by jfromaniello (2012-08-31 18:13:20+00:00)
Title: add --amd option to generate ender.js as an AMD whole

My goal with this change is to be able to build with enders a file that I can use later with require.js.

If I build like this:

```
ender build qwery bonzo bean domready --amd
```

It will generate an ender.js like this:

```javascript
define(function(){
var _ender = {};

(function(){
//all enders.
}).call(_ender);

return _ender.ender;
});
```
notice that this work pretty much like the "sandbox" option, in the sense that "provide" and all others are for that particular context.

Then, I can use this with require.js as follows:

```javascript
define("/ender.js", function($){
//do whatever...
});
```

Another thing to notice is that even if most of enders modules also register as AMD modules, they will not register in this case because most of the modules has a header like this:

```javascript
!function (name, context, definition) {
if (typeof module !== 'undefined') module.exports = definition(name, context);
else if (typeof define === 'function' && typeof define.amd === 'object') define(definition);
else context[name] = definition(name, context);
}('bean', this, function (name, context) {
```

enders define module and module.exports. So, it will enter in the first if and the net result is that only ender is registered in the AMD register in this case which is perfect for my usecase.

What do you think?

thanks,