<commit_before>class Chef
  class Util
    class EditedFile
      def initialize(file, block)
        @file = file
        @block = block
      end

      def to_s
        ::File.new(@file).collect do |line|
          line = @block.call(line)
        end.join("")
      end
    end
  end

  class Recipe
    def edit_file(file, &block)
      Chef::Util::EditedFile.new(file, block).to_s
    end
  end
end<commit_msg>Make deferring of edit_file work properly<commit_after>class Chef
  class Util
    class EditedFile
      def initialize(file, block)
        @file = file
        @block = block
      end

      def kind_of?(klass)
        klass == String || super
      end

      def to_s
        ::File.new(@file).collect do |line|
          line = @block.call(line)
        end.join("")
      end
    end
  end

  class Recipe
    def edit_file(file, &block)
      Chef::Util::EditedFile.new(file, block)
    end
  end
end
{'fraction_non_alphanumeric': 0.0972972972972973, 'fraction_numerical': 0.0, 'mean_word_length': 1.9303797468354431, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7232815', 'n_tokens_mistral': 305, 'n_tokens_neox': 297, 'n_words': 80}