From 00d5d525005346f6d6f6f4802e238e9e12412117 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 24 Nov 2013 10:36:50 +0000 Subject: [PATCH 1/1] Make deferring of edit_file work properly --- cookbooks/chef/libraries/edit_file.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbooks/chef/libraries/edit_file.rb b/cookbooks/chef/libraries/edit_file.rb index e632bcfd4..8a04a8090 100644 --- a/cookbooks/chef/libraries/edit_file.rb +++ b/cookbooks/chef/libraries/edit_file.rb @@ -6,6 +6,10 @@ class Chef @block = block end + def kind_of?(klass) + klass == String || super + end + def to_s ::File.new(@file).collect do |line| line = @block.call(line) @@ -16,7 +20,7 @@ class Chef class Recipe def edit_file(file, &block) - Chef::Util::EditedFile.new(file, block).to_s + Chef::Util::EditedFile.new(file, block) end end end -- 2.43.2