Merge pull request #1376 from tcal-x/ruby-file-exist

"file.exists?" was deprecated with Ruby 2.2.  Use "file.exist?" instead.
This commit is contained in:
Matthias Köfferlein 2023-05-21 21:59:55 +02:00 committed by GitHub
commit 4b43617ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -231,7 +231,7 @@ hs.urls.each do |url|
t = HEADER + xml2html(t) + TAIL
tt = nil
if File.exists?(fn)
if File.exist?(fn)
File.open(fn, "rb") { |f| tt = f.read }
end

View File

@ -72,15 +72,15 @@ class Buddies_TestClass < TestBase
else
out_file = File.join($ut_testtmp, "out_" + bin)
end
if File.exists?(out_file)
if File.exist?(out_file)
File.unlink(out_file)
end
assert_equal(File.exists?(out_file), false)
assert_equal(File.exist?(out_file), false)
in_file = File.join(File.dirname(__FILE__), "test1.gds")
log = bin + "\n" + `#{self.buddy_bin(bin)} #{in_file} #{out_file} 2>&1`
assert_equal(File.exists?(out_file), true)
assert_equal(File.exist?(out_file), true)
assert_equal(log, bin + "\n")
File.open(out_file, "rb") do |file|
@ -96,16 +96,16 @@ class Buddies_TestClass < TestBase
def test_strmxor
out_file = File.join($ut_testtmp, "out")
if File.exists?(out_file)
if File.exist?(out_file)
File.unlink(out_file)
end
assert_equal(File.exists?(out_file), false)
assert_equal(File.exist?(out_file), false)
in_file1 = File.join(File.dirname(__FILE__), "test1.gds")
in_file2 = File.join(File.dirname(__FILE__), "test2.gds")
log = "strmxor\n" + `#{self.buddy_bin("strmxor")} #{in_file1} #{in_file2} #{out_file} 2>&1`
assert_equal(File.exists?(out_file), true)
assert_equal(File.exist?(out_file), true)
assert_equal(log, <<"END")
strmxor
Warning: Layer 1/0 is not present in second layout, but in first
@ -141,15 +141,15 @@ END
def test_strmclip
out_file = File.join($ut_testtmp, "out")
if File.exists?(out_file)
if File.exist?(out_file)
File.unlink(out_file)
end
assert_equal(File.exists?(out_file), false)
assert_equal(File.exist?(out_file), false)
in_file = File.join(File.dirname(__FILE__), "test1.gds")
log = "strmclip\n" + `#{self.buddy_bin("strmclip")} #{in_file} #{out_file} 2>&1`
assert_equal(File.exists?(out_file), true)
assert_equal(File.exist?(out_file), true)
assert_equal(log, "strmclip\n")
end

View File

@ -45,7 +45,7 @@ class KLayoutMain_TestClass < TestBase
def klayout_bin
# special location for MacOS
file = File.join(RBA::Application::instance.inst_path, "klayout.app", "Contents", "MacOS", "klayout")
if !File.exists?(file)
if !File.exist?(file)
file = File.join(RBA::Application::instance.inst_path, "klayout")
end
return file