Skip to content

Commit

Permalink
Ruby 3.2 removed File.exists?
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268604

Reviewed by Ross Kirsling.

`File.exists?` was deprecated since Ruby 2.1. And, Ruby 3.2 finally
removed File.exists? Use `File.exist?` instead.

* Tools/Scripts/check-for-inappropriate-macros-in-external-headers:
* Tools/Scripts/run-jsc-stress-tests:
* Tools/Scripts/run-testmem:
* Tools/Scripts/webkitruby/jsc-stress-test-writer-playstation.rb:
* Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:

Canonical link: https://commits.webkit.org/274040@main
  • Loading branch information
fujii committed Feb 3, 2024
1 parent 36b3983 commit 3b4f0c1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def framework_headers_for_path(framework, path)
full_path = File.join Dir.pwd, framework, $is_shallow_bundle ? "" : "Versions/A/", path
if File.directory? full_path
Dir.glob "#{full_path}/**/*.h"
elsif File.exists? full_path
elsif File.exist? full_path
[full_path]
else
print_error "path '#{full_path}' for argument '#{path}' does not exist."
Expand Down
4 changes: 2 additions & 2 deletions Tools/Scripts/run-jsc-stress-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2501,10 +2501,10 @@ def prepareBundle
# Check for and copy JavaScriptCore.dll and WTF.dll for dynamic builds
javaScriptCoreDLLPath = File.join(originalJSCDir, "JavaScriptCore.dll")
wtfDLLPath = File.join(originalJSCDir, "WTF.dll")
if (File.exists?(javaScriptCoreDLLPath))
if (File.exist?(javaScriptCoreDLLPath))
source = source + [javaScriptCoreDLLPath]
end
if (File.exists?(wtfDLLPath))
if (File.exist?(wtfDLLPath))
source = source + [wtfDLLPath]
end

Expand Down
2 changes: 1 addition & 1 deletion Tools/Scripts/run-testmem
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ end

def getTestmemPath
path = Pathname.new(getBuildDirectory).join("testmem").to_s
if !File.exists?(path) && !$dryRun
if !File.exist?(path) && !$dryRun
puts "Error: no testmem binary found in <build>/Release"
exit 1
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def diffErrorHandler(expectedFilename)
outp.puts " print " + prefixString("out", plan.name) + "\n"
outp.puts " print " + prefixString("\"ERROR: Unexpected exit code \#{status}\\n\"", plan.name) + "\n"
outp.puts " " + plan.failCommand
outp.puts "elsif File.exists?(\"../#{Shellwords.shellescape(expectedFilename)}\")\n"
outp.puts "elsif File.exist?(\"../#{Shellwords.shellescape(expectedFilename)}\")\n"
outp.puts getDiff("../#{Shellwords.shellescape(expectedFilename)}", outputFilename)
outp.puts " if isDifferent\n"
outp.puts " print " + prefixString("\"DIFF FAILURE!\\n\"", plan.name) + "\n"
Expand Down
2 changes: 1 addition & 1 deletion Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def diffErrorHandler(expectedFilename)
outp.puts " print " + prefixString("out", plan.name) + "\n"
outp.puts " print " + prefixString("\"ERROR: Unexpected exit code \#{status.exitstatus}\\n\"", plan.name) + "\n"
outp.puts " " + plan.failCommand
outp.puts "elsif File.exists?(\"../#{Shellwords.shellescape(expectedFilename)}\")\n"
outp.puts "elsif File.exist?(\"../#{Shellwords.shellescape(expectedFilename)}\")\n"
outp.puts getDiff("../#{Shellwords.shellescape(expectedFilename)}", outputFilename)
outp.puts " if isDifferent\n"
outp.puts " print " + prefixString("\"DIFF FAILURE!\\n\"", plan.name) + "\n"
Expand Down

0 comments on commit 3b4f0c1

Please sign in to comment.