mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:33:42 +08:00
DEV: Fix methods removed in Ruby 3.2 (#15459)
* File.exists? is deprecated and removed in Ruby 3.2 in favor of File.exist? * Dir.exists? is deprecated and removed in Ruby 3.2 in favor of Dir.exist?
This commit is contained in:
@ -140,7 +140,7 @@ class S3Inventory
|
||||
end
|
||||
|
||||
def download_inventory_file_to_tmp_directory(file)
|
||||
return if File.exists?(file[:filename])
|
||||
return if File.exist?(file[:filename])
|
||||
|
||||
log "Downloading inventory file '#{file[:key]}' to tmp directory..."
|
||||
failure_message = "Failed to inventory file '#{file[:key]}' to tmp directory."
|
||||
@ -219,8 +219,8 @@ class S3Inventory
|
||||
def cleanup!
|
||||
return if @preloaded_inventory_file
|
||||
files.each do |file|
|
||||
File.delete(file[:filename]) if File.exists?(file[:filename])
|
||||
File.delete(file[:filename][0...-3]) if File.exists?(file[:filename][0...-3])
|
||||
File.delete(file[:filename]) if File.exist?(file[:filename])
|
||||
File.delete(file[:filename][0...-3]) if File.exist?(file[:filename][0...-3])
|
||||
end
|
||||
end
|
||||
|
||||
@ -253,7 +253,7 @@ class S3Inventory
|
||||
|
||||
def download_and_decompress_files
|
||||
files.each do |file|
|
||||
next if File.exists?(file[:filename][0...-3])
|
||||
next if File.exist?(file[:filename][0...-3])
|
||||
|
||||
download_inventory_file_to_tmp_directory(file)
|
||||
decompress_inventory_file(file)
|
||||
|
Reference in New Issue
Block a user