opscode/chef — pull request #2179 by sersut (2014-10-07 09:24:14+00:00)
Title: Make FileVendor configuration specific to the two implementations

FileVendor previously was configured by storing a closure/anonymous
function as a class instance variable. This had the following downsides:
* The API was too general, which caused a lot of code repetition
* The block was lazily evaluated, which hid errors and made testing more
difficult
* The closures captured references to classes with references to large
data structures, which complicates GC.

Since we've only ever had the same two implementations of FileVendor, we
can encapsulate configuration of the FileVendor factory by wrapping each
configuration option in a method. As a side benefit, arguments to these
methods will be eagerly evaluated, which makes it easier to detect
errors.