require 'fileutils'FileUtils.compare_file('file1','file2')
returns true if and only if files file1 and file2 are identical.
true
file1
file2