mdxp/nodejs-cookbook — pull request #67 by markolson (2013-11-24 04:11:41+00:00)
Title: Download Source and Binary Files to Chef Cache

The application I'm working on has an end-goal of being able to be installed via chef-solo off of a USB key. To that end, we have to make sure that all the packages, tar files, etc.. that our cookbooks download are placed into Chef's Cache (normally `/var/chef/cache`). This changes the `source` and `binary` recipes to do that, as well as pulling out a `raise_if_checksum_mismatch` method to a helper library so that `source` and `binary` can both use it.

I also changed around some of the logic around `install_not_needed`, changing it to use Mixlib:: ShellOut (foodcritic was complaining about that) and using a notifies block to run the SHA256 code only when necessarily. There's still more opportunity to pull out the checksumming and 'already installed' functionality, but it's Good Enough(tm) right now.