identical?(source, destination, &block)
public
Checks if the source and the destination file are identical.
If passed a block then the source file is a template that
needs to first be evaluated before being compared to the destination.
Show source
def identical?(source, destination, &block)
return false if File.directory? destination
source = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source)
destination = IO.read(destination)
source == destination
end