Skip to content

Commit b7ac5d0

Browse files
DimStar77fujii
authored andcommitted
Fix build with Ruby 3.2
https://bugs.webkit.org/show_bug.cgi?id=246743 Reviewed by Ross Kirsling. File.exists has been declared deprecated since Ruby 2.1 (2013) and with Ruby 3.2 gets removed for good. * Source/JavaScriptCore/offlineasm/config.rb: * Source/JavaScriptCore/offlineasm/parser.rb: * Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb: Canonical link: https://commits.webkit.org/257775@main
1 parent 2ba3398 commit b7ac5d0

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Source/JavaScriptCore/offlineasm/config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323

2424
buildProductsDirectory = ENV['BUILT_PRODUCTS_DIR'];
2525
headersFolderPath = ENV['WK_LIBRARY_HEADERS_FOLDER_PATH'];
26-
if buildProductsDirectory and File.exists?(buildProductsDirectory)
26+
if buildProductsDirectory and File.exist?(buildProductsDirectory)
2727
$: << "#{buildProductsDirectory}#{headersFolderPath}/WebKitAdditions/Scripts"
2828
end
2929
sdkRootDirectory = ENV['SDKROOT'];
30-
if sdkRootDirectory and File.exists?(sdkRootDirectory)
30+
if sdkRootDirectory and File.exist?(sdkRootDirectory)
3131
$: << "#{sdkRootDirectory}#{headersFolderPath}/WebKitAdditions/Scripts"
3232
end
3333

Source/JavaScriptCore/offlineasm/parser.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,10 @@ def parseSequence(final, comment)
840840
additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/"
841841
end
842842
fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName
843-
if not File.exists?(fileName)
843+
if not File.exist?(fileName)
844844
fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName
845845
end
846-
fileExists = File.exists?(fileName)
846+
fileExists = File.exist?(fileName)
847847
raise "File not found: #{fileName}" if not fileExists and not isOptional
848848
list << parse(fileName, @options, @sources) if fileExists
849849
else
@@ -876,10 +876,10 @@ def parseIncludes(final, comment, options)
876876
additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/"
877877
end
878878
fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName
879-
if not File.exists?(fileName)
879+
if not File.exist?(fileName)
880880
fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName
881881
end
882-
fileExists = File.exists?(fileName)
882+
fileExists = File.exist?(fileName)
883883
raise "File not found: #{fileName}" if not fileExists and not isOptional
884884
if fileExists
885885
parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options)

Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def run
3636
end
3737

3838
generated_path = File.join tmpdir, output_filename
39-
if !File.exists?(generated_path)
39+
if !File.exist?(generated_path)
4040
puts "ERROR: Generated file does not exist at expected path."
4141
exit 1
4242
end

0 commit comments

Comments
 (0)