]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/edit_file.rb
Merge remote-tracking branch 'github/pull/440'
[chef.git] / cookbooks / chef / libraries / edit_file.rb
index ea200c845cc74567c55606ed4fdf264e1b04e24d..bfbec455cebc82d00acc90725b70b627c9e3f36a 100644 (file)
@@ -1,11 +1,17 @@
 class Chef
 class Chef
-  class Recipe
-    def edit_file(file, &block)
-      Chef::DelayedEvaluator.new do
-        ::File.new(file).collect do |line|
-          line = block.call(line)
-        end.join("")
+  module Mixin
+    module EditFile
+      def edit_file(file, &_block)
+        Chef::DelayedEvaluator.new do
+          ::File.new(file).collect do |line|
+            yield line
+          end.join("")
+        end
       end
     end
   end
       end
     end
   end
+
+  class Recipe
+    include Chef::Mixin::EditFile
+  end
 end
 end