redding/dassets — pull request #44 by kellyredding (2013-05-01 15:46:13+00:00)
Title: `SourceCache` cache handling

This updates the source cache to take a cache object. If given, it
will cache any source data accessed in the cache. If none is given
it uses its own `NoCache` which is a pass-thru no-op.

This also adds a `Dassets::DefaultCache` object that is the default
cache used by the source cache. It is a thread-safe, in-memory cache
that has the special behavior of only caching the fingerprint source
data.

This goal of this whole setup is to not force you to recompile source
everytime you access the asset file href. The cache is keys based off
of source mtime. This means source data will only be recomputed is the
mtime of the source has changed.

Dassets is setup so that custom caches (like a redis based cache) can
be injected as desired.

@jcredding ready for review.