]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/edit_file.rb
Replace content_from_file extension with simpler edit_file technique
[chef.git] / cookbooks / chef / libraries / edit_file.rb
diff --git a/cookbooks/chef/libraries/edit_file.rb b/cookbooks/chef/libraries/edit_file.rb
new file mode 100644 (file)
index 0000000..1c8e263
--- /dev/null
@@ -0,0 +1,9 @@
+class Chef
+  class Recipe
+    def edit_file(file, &block)
+      ::File.new(file).collect do |line|
+        line = yield line
+      end.join("")
+    end
+  end
+end