miracle2k/webassets — pull request #237 by ThiefMaster (2013-05-08 18:33:46+00:00)
Title: Allow skipping bundles based on the debug level

Currently there is no nice way to skip a whole bundle e.g. in production mode or in debug mode. Using a custom filter for it is tricky since to handle rebuilds properly `id()` needs to know the current debug state which is not available in that method.

Because of this I implemented a new `Bundle` argument `require_production` that will skip the bundle if necessary. It defaults to `None` and setting it to a boolean value will require either `debug == False` or one of the two non-production debug modes (`debug == True` or `debug == 'merge'`).

While my unit tests pass and everything seems to work fine I'm not completely sure if my `DebugRequirementUpdater` is implemented properly (mostly the usage of `self.__bundle_build_states` to store the information if a bundle has been built the last time). I'm looking forward for feedback on it!