Title: [293913] releases/WebKitGTK/webkit-2.36/Source/WTF
- Revision
- 293913
- Author
- [email protected]
- Date
- 2022-05-06 12:00:22 -0700 (Fri, 06 May 2022)
Log Message
Merge r290331 - Ruby ERB.new compatibility fix
https://bugs.webkit.org/show_bug.cgi?id=237035
Reviewed by Fujii Hironori.
ERB.new has changed its calling convention in newer ruby versions.
This was exposed by https://commits.webkit.org/247450@main, which
tried to silence the warning emitted by newer ruby versions.
Unfortunately, this resulted in failures with older ruby versions
(e.g.
https://build.webkit.org/#/builders/46/builds/11387/steps/8/logs/stdio).
Use the compatibility hack suggested by RuboCop to get this working
across ruby versions (without any warnings).
* Scripts/GeneratePreferences.rb:
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.36/Source/WTF/ChangeLog (293912 => 293913)
--- releases/WebKitGTK/webkit-2.36/Source/WTF/ChangeLog 2022-05-06 18:59:04 UTC (rev 293912)
+++ releases/WebKitGTK/webkit-2.36/Source/WTF/ChangeLog 2022-05-06 19:00:22 UTC (rev 293913)
@@ -1,3 +1,22 @@
+2022-02-22 Angelos Oikonomopoulos <[email protected]>
+
+ Ruby ERB.new compatibility fix
+ https://bugs.webkit.org/show_bug.cgi?id=237035
+
+ Reviewed by Fujii Hironori.
+
+ ERB.new has changed its calling convention in newer ruby versions.
+ This was exposed by https://commits.webkit.org/247450@main, which
+ tried to silence the warning emitted by newer ruby versions.
+ Unfortunately, this resulted in failures with older ruby versions
+ (e.g.
+ https://build.webkit.org/#/builders/46/builds/11387/steps/8/logs/stdio).
+
+ Use the compatibility hack suggested by RuboCop to get this working
+ across ruby versions (without any warnings).
+
+ * Scripts/GeneratePreferences.rb:
+
2022-02-24 Nikolaos Mouchtaris <[email protected]>
REGRESSION(r289683): [GTK][WPE] Scrolling with the mouse wheel doesn't work in twitter after r289683
Modified: releases/WebKitGTK/webkit-2.36/Source/WTF/Scripts/GeneratePreferences.rb (293912 => 293913)
--- releases/WebKitGTK/webkit-2.36/Source/WTF/Scripts/GeneratePreferences.rb 2022-05-06 18:59:04 UTC (rev 293912)
+++ releases/WebKitGTK/webkit-2.36/Source/WTF/Scripts/GeneratePreferences.rb 2022-05-06 19:00:22 UTC (rev 293913)
@@ -228,11 +228,22 @@
result
end
+ def createTemplate(templateString)
+ # Newer versions of ruby deprecate and/or drop passing non-keyword
+ # arguments for trim_mode and friends, so we need to call the constructor
+ # differently depending on what it expects. This solution is suggested by
+ # rubocop's Lint/ErbNewArguments.
+ if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
+ ERB.new(templateString, trim_mode:"-")
+ else
+ ERB.new(templateString, nil, "-")
+ end
+ end
def renderTemplate(templateFile, outputDirectory)
resultFile = File.join(outputDirectory, File.basename(templateFile, ".erb"))
tempResultFile = resultFile + ".tmp"
- output = ERB.new(File.read(templateFile), trim_mode:"-").result(binding)
+ output = createTemplate(File.read(templateFile)).result(binding)
File.open(tempResultFile, "w+") do |f|
f.write(output)
end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes