<commit_before>require "tempfile"

module RRDiff
  module File
    # File interface to RRDiff
    
    def patch(ofile, dfile)
      nfile = Tempfile.new("nfile")
      RRDiff.patch(ofile.path, dfile.path, nfile.path)
      nfile
    end

    def signature(file)
      sfile = Tempfile.new("sigfile")
      RRDiff.signature(file.path, sfile.path)
      sfile
    end

    def delta(file, sfile)
      dfile = Tempfile.new("delfile")
      RRDiff.delta(file.path, sfile.path, dfile.path)
      dfile
    end

    def diff(ofile, nfile)
    	sfile = signature(ofile)
    	delta(sfile, nfile)
    end
    extend self
  end
end<commit_msg>Switch arguments for delta to avoid confusion<commit_after>require "tempfile"

module RRDiff
  module File
    # File interface to RRDiff
    
    def patch(ofile, dfile)
      nfile = Tempfile.new("nfile")
      RRDiff.patch(ofile.path, dfile.path, nfile.path)
      nfile
    end

    def signature(file)
      sfile = Tempfile.new("sigfile")
      RRDiff.signature(file.path, sfile.path)
      sfile
    end

    def delta(sfile, file)
      dfile = Tempfile.new("delfile")
      RRDiff.delta(file.path, sfile.path, dfile.path)
      dfile
    end

    def diff(ofile, nfile)
    	sfile = signature(ofile)
    	delta(sfile, nfile)
    end
    extend self
  end
end
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.0, 'mean_word_length': 2.456233421750663, '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': '1310922', 'n_tokens_mistral': 473, 'n_tokens_neox': 460, 'n_words': 105}