End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
FileUtils#uptodate?
uptodate?(new, old_list)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/fileutils.rb, line 155
def uptodate?(new, old_list)
return false unless File.exist?(new)
new_time = File.mtime(new)
old_list.each do |old|
if File.exist?(old)
return false unless new_time > File.mtime(old)
end
end
true
end
Returns true if new is newer than all old_list. Non-existent files are older than any file.
Example
FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \ system 'make hello.o'