tool/generic_erb.rb: Add a hack to prevent "unused variable" warnings

This commit is contained in:
Yusuke Endoh 2022-11-18 14:56:55 +09:00
parent e19afe36ca
commit 417f3cd893

View File

@ -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: '%-')