redding/dassets — pull request #39 by kellyredding (2013-04-29 21:59:33+00:00)
Title: Rework digesting and outputting files

So in using Dassets in beta, a few design choices proved to be cumbersome:

* having to output digested files to a dir to check them in seemed unnecessary
* having to run a "digest" cmd every time files changed is a pain

So, to alleviate some of this pain I have reworked both how digesting and outputting (or "caching") digested asset files works:

* the middleware serves matching asset files, if they exists
* first checks if path info looks like a digested asset file (fast)
* if it does, looks up the asset file and checks if it exists (it has source that exists) (slower)
* asset files compile their source content on demand
* this means all assets served by middleware are freshly compiled

* the Dassets `[]` operator also returns asset files
* this means anything accessed with `[]` has been freshly fingerprinted
* removed output file handling in the asset file
* this means that all content and fingerprint is re-computed for each new asset file (or each new `[]` invocation)

* altered the `output_path` config handling
* made it optional and `nil` by default
* source files only write output files if an output path has been configured.