]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/edit_file.rb
Rely on Last-Modified and/or ETag to control chef client downloads
[chef.git] / cookbooks / chef / libraries / edit_file.rb
index 1c8e263e41697f30c73352b092157e48880940f0..ea200c845cc74567c55606ed4fdf264e1b04e24d 100644 (file)
@@ -1,9 +1,11 @@
 class Chef
   class Recipe
     def edit_file(file, &block)
-      ::File.new(file).collect do |line|
-        line = yield line
-      end.join("")
+      Chef::DelayedEvaluator.new do
+        ::File.new(file).collect do |line|
+          line = block.call(line)
+        end.join("")
+      end
     end
   end
 end