From bdba27ec7247699d01e696a975d71faf529578ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 20 Jan 2023 01:31:10 +0100 Subject: [PATCH] Use `File.exist?` for Ruby 3.2 compatibility (#1216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `File.exists?` has been deprecated and is now removed in Ruby 3.2. https://github.com/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L58 Signed-off-by: Vít Ondruch Co-authored-by: Addisu Z. Taddese --- tools/xmlschema.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/xmlschema.rb b/tools/xmlschema.rb index 221a5bc9f..cadfa59fb 100755 --- a/tools/xmlschema.rb +++ b/tools/xmlschema.rb @@ -265,7 +265,7 @@ def printXSD(_file, _spaces, _elem) if infile.nil? puts "Missing option -i." exit -elsif !File.exists?(infile) +elsif !File.exist?(infile) puts "Input file[#{infile}] does not exist\n" exit end @@ -273,7 +273,7 @@ def printXSD(_file, _spaces, _elem) if $path.nil? puts "Missing option -s." exit -elsif !Dir.exists?($path) +elsif !Dir.exist?($path) puts "SDF source dir[#{$path}] does not exist\n" exit end @@ -281,7 +281,7 @@ def printXSD(_file, _spaces, _elem) if outdir.nil? puts "Missing output directory, option -o." exit -elsif !Dir.exists?(outdir) +elsif !Dir.exist?(outdir) Dir.mkdir(outdir) end