]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/edit_file.rb
Make deferring of edit_file work properly
[chef.git] / cookbooks / chef / libraries / edit_file.rb
index e632bcfd49dbd93f8dafd1caf4c09276b90aa01d..8a04a8090f3e45ce03a13e71bbba768d9b945376 100644 (file)
@@ -6,6 +6,10 @@ class Chef
         @block = block
       end
 
         @block = block
       end
 
+      def kind_of?(klass)
+        klass == String || super
+      end
+
       def to_s
         ::File.new(@file).collect do |line|
           line = @block.call(line)
       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)
 
   class Recipe
     def edit_file(file, &block)
-      Chef::Util::EditedFile.new(file, block).to_s
+      Chef::Util::EditedFile.new(file, block)
     end
   end
 end
     end
   end
 end