Skip to content
Permalink
Browse files
GeneratePreferences.rb: warning: Passing safe_level with the 2nd argu…
…ment of ERB.new is deprecated

https://bugs.webkit.org/show_bug.cgi?id=236684

Reviewed by Yusuke Suzuki.

With Ruby 3.1.0, GeneratePreferences.rb reported the following warnings.
> GeneratePreferences.rb:235: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
> GeneratePreferences.rb:235: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.

* Scripts/GeneratePreferences.rb: Changed to use the keyword argument for ERB.new.



Canonical link: https://commits.webkit.org/247450@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fujii committed Feb 18, 2022
1 parent 229e81e commit 9a644641399b67f95777f49b7ad57cbd55c4697b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
@@ -1,3 +1,16 @@
2022-02-17 Fujii Hironori <Hironori.Fujii@sony.com>

GeneratePreferences.rb: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated
https://bugs.webkit.org/show_bug.cgi?id=236684

Reviewed by Yusuke Suzuki.

With Ruby 3.1.0, GeneratePreferences.rb reported the following warnings.
> GeneratePreferences.rb:235: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
> GeneratePreferences.rb:235: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.

* Scripts/GeneratePreferences.rb: Changed to use the keyword argument for ERB.new.

2022-02-17 Commit Queue <commit-queue@webkit.org>

Unreviewed, reverting r289974.
@@ -232,7 +232,7 @@ def renderTemplate(templateFile, outputDirectory)
resultFile = File.join(outputDirectory, File.basename(templateFile, ".erb"))
tempResultFile = resultFile + ".tmp"

output = ERB.new(File.read(templateFile), 0, "-").result(binding)
output = ERB.new(File.read(templateFile), trim_mode:"-").result(binding)
File.open(tempResultFile, "w+") do |f|
f.write(output)
end

0 comments on commit 9a64464

Please sign in to comment.