Skip to content

Commit

Permalink
Use File.exist? for Ruby 3.2 compatibility (#1216)
Browse files Browse the repository at this point in the history
`File.exists?` has been deprecated and is now removed in Ruby 3.2. 

https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L58

Signed-off-by: Vít Ondruch <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
2 people authored and scpeters committed Jan 26, 2023
1 parent 8775d0b commit 6890d65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/xmlschema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,23 @@ 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

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

if outdir.nil?
puts "Missing output directory, option -o."
exit
elsif !Dir.exists?(outdir)
elsif !Dir.exist?(outdir)
Dir.mkdir(outdir)
end

Expand Down

0 comments on commit 6890d65

Please sign in to comment.