X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/b17dd01854b7d2dd4caa29ff4e05c03f3ff69890..59df18a47e1431952fcf82ca8ab318c2566370dc:/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 index 000000000..1c8e263e4 --- /dev/null +++ b/cookbooks/chef/libraries/edit_file.rb @@ -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