middleman/middleman — pull request #371 by bhollis (2012-04-23 08:22:33+00:00)
Title: Speed up builds

Two commits that greatly speed up builds. The first fixes `FileWatcher` in a couple ways - it now ignores the same files `Watcher` does, it correctly uses relative paths so it can detect deleted files, and it introduces `find_new_files` which only looks for new files (rather than triggering a touch on every file under the path), which is way more efficient for the "reload images looking for Compass sprites" step. The problem is that since we rebuild the whole sitemap every time we touch a file, we end up rebuilding it a lot if we touch every image file.

The second change adds an `origin` parameter to `provides_metadata`, allowing us to replace callbacks rather than always appending. This helps in the case of the blog extension, where otherwise every time the sitemap was rebuilt a ton of provides_metadata callbacks got added and the cost of computing metadata quickly came to dominate the build process.