]> git.openstreetmap.org Git - chef.git/commitdiff
Make deferring of edit_file work properly
authorTom Hughes <tom@compton.nu>
Sun, 24 Nov 2013 10:36:50 +0000 (10:36 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 24 Nov 2013 10:39:50 +0000 (10:39 +0000)
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