middleman/middleman — pull request #641 by rolftimmermans (2012-10-15 18:55:07+00:00)
Title: Fix asset hash generation in combination with sprockets.

This is a duplicate of #640, but targeted to `3.0-stable`.

---

I was having some problems where the asset hash generated by middleman was not updated when my assets changed.

I'm using middleman-sprockets and include a couple of Javascript file from javascript/site.js. Whenever a dependency is updated but the main Javascript file remains the same the asset hash does not change. This causes problems for visitors whenever something is updated.

Apparently Middleman only looks at the entire result if the file is a template. In my case it's not a template, it's processed by Sprockets.

This PR fixes the problem by simply using a digest of the output in all cases, whether it's a template or not. A test for this scenario is included as well.