From 0ef7ac29b0afe2dab01b0a3698ddca10f9983631 Mon Sep 17 00:00:00 2001
From: Bastian Germann <bage@debian.org>
Date: Fri, 7 Feb 2025 21:42:23 +0100
Subject: [PATCH] Replace obsolete File.exists with File.exist

---
 lib/fontcustom/manifest.rb      |  2 +-
 lib/fontcustom/options.rb       | 16 ++++++++--------
 spec/fontcustom/cli_spec.rb     |  2 +-
 spec/fontcustom/watcher_spec.rb |  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/fontcustom/manifest.rb b/lib/fontcustom/manifest.rb
index e817e2c..9d83d13 100644
--- a/lib/fontcustom/manifest.rb
+++ b/lib/fontcustom/manifest.rb
@@ -7,7 +7,7 @@ module Fontcustom
     def initialize(manifest, cli_options = {})
       @manifest = manifest
       @cli_options = symbolize_hash cli_options
-      if File.exists? @manifest
+      if File.exist? @manifest
         reload
         if ! @cli_options.empty? && get(:options) != @cli_options
           set :options, @cli_options
diff --git a/lib/fontcustom/options.rb b/lib/fontcustom/options.rb
index 6a2b29d..6a7f911 100644
--- a/lib/fontcustom/options.rb
+++ b/lib/fontcustom/options.rb
@@ -39,17 +39,17 @@ module Fontcustom
     def set_config_path
       @cli_options[:config] = if @cli_options[:config]
         path = @cli_options[:config]
-        if File.exists?(path) && ! File.directory?(path)
+        if File.exist?(path) && ! File.directory?(path)
           path
-        elsif File.exists? File.join(path, "fontcustom.yml")
+        elsif File.exist? File.join(path, "fontcustom.yml")
           File.join path, "fontcustom.yml"
         else
           raise Fontcustom::Error, "No configuration file found at `#{path}`."
         end
       else
-        if File.exists? "fontcustom.yml"
+        if File.exist? "fontcustom.yml"
           "fontcustom.yml"
-        elsif File.exists? File.join("config", "fontcustom.yml")
+        elsif File.exist? File.join("config", "fontcustom.yml")
           File.join "config", "fontcustom.yml"
         else
           false
@@ -134,7 +134,7 @@ module Fontcustom
 
         @options[:output].each do |key, val|
           @options[:output][key] = val
-          if File.exists?(val) && ! File.directory?(val)
+          if File.exist?(val) && ! File.directory?(val)
             raise Fontcustom::Error,
               "Output `#{@options[:output][key]}` exists but isn't a directory. Check your options."
           end
@@ -145,7 +145,7 @@ module Fontcustom
       else
         if @options[:output].is_a? String
           output = @options[:output]
-          if File.exists?(output) && ! File.directory?(output)
+          if File.exist?(output) && ! File.directory?(output)
             raise Fontcustom::Error,
               "Output `#{output}` exists but isn't a directory. Check your options."
           end
@@ -170,7 +170,7 @@ module Fontcustom
         else
           path = File.expand_path File.join(@options[:input][:templates], template)
         end
-        unless File.exists? path
+        unless File.exist? path
           raise Fontcustom::Error,
             "Custom template `#{template}` wasn't found in `#{@options[:input][:templates]}/`. Check your options."
         end
@@ -178,7 +178,7 @@ module Fontcustom
     end
 
     def check_input(dir)
-      if ! File.exists? dir
+      if ! File.exist? dir
         raise Fontcustom::Error,
           "Input `#{dir}` doesn't exist. Check your options."
       elsif ! File.directory? dir
diff --git a/spec/fontcustom/cli_spec.rb b/spec/fontcustom/cli_spec.rb
index a76ce3f..c34cfd4 100644
--- a/spec/fontcustom/cli_spec.rb
+++ b/spec/fontcustom/cli_spec.rb
@@ -11,7 +11,7 @@ describe Fontcustom::CLI do
 
         expect(Dir.glob(File.join(testdir, "fontcustom", "fontcustom_*\.{ttf,svg,woff,eot}")).length).to eq(4)
         expect(File.read(manifest)).to match(/"fonts":.+fontcustom\/fontcustom_.+\.ttf"/m)
-        expect(File.exists?(preview)).to be_truthy
+        expect(File.exist?(preview)).to be_truthy
       end
     end
 
diff --git a/spec/fontcustom/watcher_spec.rb b/spec/fontcustom/watcher_spec.rb
index 14799ef..47f5fc4 100644
--- a/spec/fontcustom/watcher_spec.rb
+++ b/spec/fontcustom/watcher_spec.rb
@@ -64,7 +64,7 @@ describe Fontcustom::Watcher do
         ensure
           w.send :stop
           new = fixture("shared/vectors/test.svg")
-          FileUtils.rm(new) if File.exists?(new)
+          FileUtils.rm(new) if File.exist?(new)
         end
       end
     end
@@ -113,7 +113,7 @@ describe Fontcustom::Watcher do
         ensure
           w.send :stop
           new = fixture("shared/vectors/non-vector-file")
-          FileUtils.rm(new) if File.exists?(new)
+          FileUtils.rm(new) if File.exist?(new)
         end
       end
     end
