]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/edit_file.rb
Update chef client to 18.4.2
[chef.git] / cookbooks / chef / libraries / edit_file.rb
index a3c892d719f4332c696813364dc7ac85ecdac343..7de56267f3628b62f639ce6afdc1d6b267accb0a 100644 (file)
@@ -1,11 +1,15 @@
-class Chef
-  class Recipe
-    def edit_file(file, &block)
-      Chef::DelayedEvaluator.new do
-        ::File.new(file).collect do |line|
-          block.call(line)
-        end.join("")
+module OpenStreetMap
+  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
+
+Chef::DSL::Recipe.include(OpenStreetMap::Mixin::EditFile)