rails/sprockets-rails — pull request #21 by ndbroadbent (2012-09-27 13:16:42+00:00)
Title: Detect asset changes by saving source_digests in manifest.yml, and speed up non-digest assets

This feature speeds up the asset pipeline by only recompiling assets whose dependencies have changed. It does this by changing `manifest.yml` to include `source_digests` as well as the digests for compiled files.

By computing source digests, we can quickly determine if the asset needs to be recompiled or not. If nothing has changed in the source assets, then compilation is skipped. Please see [this pull request]() on Sprockets for the required changes.

Also, instead of compiling twice for both digest and non-digest assets,
digest assets are now copied with known digests stripped from the body of css and js files.
This means we don't have to process and compress the same files twice.
Please let me know if you can see any problems with this though, since I'm making the assumption that asset paths are the only differences between digest/non-digest assets.

One last thing is that assets are now cleaned up after a compile, since this feature means that you should keep your current assets in place during a deployment.
The assets folder is now scanned for files that don't appear in `manifest.yml` (not including gzipped files and `manifest.yml` itself), and deletes them. It also removes empty directories.
This behavior can be disabled by setting `config.assets.clean_after_precompile = false`.

All the tests are passing for both `sprockets` and `sprockets-rails`. I've added one or two tests, but there already seemed to be decent coverage for the areas I was changing. Please let me know if more tests are needed.

This PR has two dependent PRs: [sprockets #367](https://github.com/sstephenson/sprockets/pull/367) and [rails #TBA]() (guides update)

Thanks for your time!