ariatemplates/ariatemplates — pull request #108 by mathbruyen (2012-08-13 13:41:51+00:00)
Title: Allow classes and templates to be unloaded together with their parents

When unloading a template, a class or a CSS, it would be useful to be able to unload also its parents.

In order not to unload core AT stuff, users have to provide a closure that restricts unloading to their code base, based on the classpath of the related entity. The closure takes the classpath in argument (maybe file type could be useful too like js/css/tpl) and returns a boolean, the resource is actually unloaded only if it returns true. For example to unload code that is inside a given package:
```js
function (classpath) {
return (classpath.indexOf("my.root.classpath") === 0)
}
```

Attached commit is mostly scratching, the same mecanism should be applied to CSS and resources unloading too, and code cleaned (like the true callback, and no tests). I removed the CSS unloading part in TemplateManager because despite the comment, it seems it is handled in ClassMgr.

If the callback approach is too broad and considered too dangerous, a more constrained way of doing so would be to require the package name in which to unload entities.