class Diffy::Diff

def diff_bin

def diff_bin
  return @@bin if @@bin
  if @@bin = ENV['DIFFY_DIFF']
    # system() trick from Minitest
    raise "Can't execute diff program '#@@bin'" unless system(@@bin, __FILE__, __FILE__)
    return @@bin
  end
  diffs = ['diff', 'ldiff']
  diffs.first << '.exe' if WINDOWS  # ldiff does not have exe extension
  @@bin = diffs.find { |name| system(name, __FILE__, __FILE__) }
  if @@bin.nil?
    raise "Can't find a diff executable in PATH #{ENV['PATH']}"
  end
  @@bin
end