summaryrefslogtreecommitdiff
path: root/tool/generic_erb.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-11-18 14:56:55 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-11-18 14:56:55 +0900
commit417f3cd89365a12c1cd49f0df842a3dc2eb040b3 (patch)
tree8b39317882d109498d16c39db11f337b71112f5a /tool/generic_erb.rb
parente19afe36ca64b261f25622219d570720fd20a28e (diff)
downloadruby-417f3cd89365a12c1cd49f0df842a3dc2eb040b3.tar.gz
tool/generic_erb.rb: Add a hack to prevent "unused variable" warnings
Diffstat (limited to 'tool/generic_erb.rb')
-rw-r--r--tool/generic_erb.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/tool/generic_erb.rb b/tool/generic_erb.rb
index 47bffd830c..6607d5c256 100644
--- a/tool/generic_erb.rb
+++ b/tool/generic_erb.rb
@@ -23,6 +23,9 @@ end
output = out.path
vpath = out.vpath
+# A hack to prevent "unused variable" warnings
+output, vpath = output, vpath
+
result = templates.map do |template|
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
erb = ERB.new(File.read(template), trim_mode: '%-')