Fix rake rdoc when the timestamp file is empty

This happens when rdoc fails during generation as the timestamp
is only written on successful attemps. The file is created anyways though
This commit is contained in:
Earlopain 2024-06-26 17:07:25 +02:00
parent de4d874474
commit 540103c6eb
No known key found for this signature in database
GPG Key ID: 48860312319ADF61

@ -160,8 +160,9 @@ def configure_rdoc_files
# Only generate documentation for files that have been
# changed since the API was generated.
if Dir.exist?(api_dir) && !ENV["ALL"]
last_generation = DateTime.rfc2822(File.open("#{api_dir}/created.rid", &:readline))
timestamp_path = "#{api_dir}/created.rid"
if File.exist?(timestamp_path) && !File.zero?(timestamp_path) && !ENV["ALL"]
last_generation = DateTime.rfc2822(File.open(timestamp_path, &:readline))
rdoc_files.keep_if do |file|
File.mtime(file).to_datetime > last_generation