linkedin/inject — pull request #254 by Jakobo (2013-04-24 01:58:58+00:00)
Title: addRule() split into multiple rule handlers

This is the largest refactor for 0.5.0. It takes `addRule` and splits it into multiple methods. addRule() must continue to work as of it's 0.4.x implementation, but it is now deprecated.

* `addModuleRule`: transform a module's identifier based on a string or function (had no similar function)
* `addFileRule`: transform a module's final URL based on a string or function (originally `path` in the addRule structure)
* `addContentRule`: **asynchronous** transform the content returned from download (originally `afterFetch` pointcut)
* `addFetchRule`: Provide an alternative method for fetching content (had no similar function)
* `addPackage`: Map a module ID to a common alias location. This is like npm install for your stateless browser sessions (had no similar function)

Still todo:
1. There's not enough docs yet around the new RulesEngine. Priority was on getting back to test passing
2. addPackage isn't being used by the executor yet to save in multiple locations
3. There is no example for the fetchRule stuff. There was a feature request a while ago to add support for alternate download methods, so this seemed like a pretty simple solution. Especially since everything was being split up.
4. The TreeDownloader needs more documentation.

Early feedback is strongly encouraged. @mattpowell probably has the lead on the review for this.