assemble/assemble — pull request #156 by doowb (2013-05-12 23:06:55+00:00)
Title: Adding init method to assemble.engine and exposing engine on assemb.engine

Engines can now provide an init function that takes in options (these are the options from the assemble task/target).

Optionally, a user of assemble can override the init function in the task/target options by providing an initializeEngine function that takes the engine and the options...

```js
assemble: {
options: {
engine: 'consolidate',
initializeEngine: function(engine, options) {
engine.engine.swig.init(options);
}
}
}
```

It also kind of looks weird doing the `engine.engine` syntax, but I'm not sure how else to describe this...

Assemble will attempt to load an engine and automatically add it's own wrapper methods around it, while holding an instance of the engine. This is a way for engine plugin authors to write adapters between other engines and assemble's wrapper. To make these functions on the options useful, we've exposed the underlying engine through the assemble.engine object so developers can use the raw engine. This works better for cases like using consolidate where the engine is consolidate, but the developer wants to use another engine (handlebars, swig, mustache, etc...).

This probably needs more work. Any feedback is welcome.