From d09d2e4ae16bfcea7d038c59ce13eb7d2f9a4c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Boutillier?= Date: Fri, 27 Oct 2023 20:08:33 +0200 Subject: [PATCH] Replace exists? by exist? (removed in ruby3.2) --- lib/filepath/filepath.rb | 6 +++--- spec/filepath_spec.rb | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/filepath/filepath.rb b/lib/filepath/filepath.rb index faf399e..4b70122 100644 --- a/lib/filepath/filepath.rb +++ b/lib/filepath/filepath.rb @@ -875,8 +875,8 @@ module MetadataTests define_filetest_method :chardev? - define_filetest_method :exists? - alias :exist? :exists? + define_filetest_method :exist? + alias :exists? :exist? define_filetest_method :readable? @@ -941,7 +941,7 @@ def touch_p module FilesystemTests def mountpoint? - if !directory? || !exists? + if !directory? || !exist? return false end diff --git a/spec/filepath_spec.rb b/spec/filepath_spec.rb index ca1fef8..ea48262 100644 --- a/spec/filepath_spec.rb +++ b/spec/filepath_spec.rb @@ -732,7 +732,7 @@ end after(:each) do - File.delete(ph) if File.exists?(ph) + File.delete(ph) if File.exist?(ph) end describe "#touch" do @@ -790,7 +790,7 @@ end after(:each) do - File.delete(ph) if File.exists?(ph) + File.delete(ph) if File.exist?(ph) end describe "#read" do @@ -874,7 +874,7 @@ end after(:each) do - File.delete(ph) if File.exists?(ph) + File.delete(ph) if File.exist?(ph) end describe "#open" do @@ -957,7 +957,7 @@ end after(:each) do - File.delete(ph) if File.exists?(ph) + File.delete(ph) if File.exist?(ph) end describe "#empty?" do