From 8326a747f991be50b3cf0ab9eab8c091f904e14c Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 12 Dec 2014 19:59:22 +0000 Subject: [PATCH] erb: suppress warnings * bin/erb (ERB::Main#run): get rid of shadowing outer local variables. [ruby-core:65772] [Feature #10395] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bin/erb | 2 +- test/erb/test_erb_command.rb | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f02df68eb..ddc6216e62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 13 04:59:20 2014 Nobuyoshi Nakada + + * bin/erb (ERB::Main#run): get rid of shadowing outer local + variables. [ruby-core:65772] [Feature #10395] + Fri Dec 12 21:56:44 2014 Kouhei Sutou * gems/bundled_gems: Upgrade to test-unit 3.0.8. assert_throw and diff --git a/bin/erb b/bin/erb index d6d7610aff..1ba49c9dc1 100755 --- a/bin/erb +++ b/bin/erb @@ -141,7 +141,7 @@ EOU bind = TOPLEVEL_BINDING.taint if variables enc = erb.encoding - variables.each do |var, val| + for var, val in variables do val = val.encode(enc) if val bind.local_variable_set(var, val) end diff --git a/test/erb/test_erb_command.rb b/test/erb/test_erb_command.rb index a21feb004d..abc8fdbe25 100644 --- a/test/erb/test_erb_command.rb +++ b/test/erb/test_erb_command.rb @@ -3,7 +3,8 @@ require 'test/unit' class TestErbCommand < Test::Unit::TestCase def test_var - assert_in_out_err([File.expand_path("../../../bin/erb", __FILE__), + assert_in_out_err(["-w", + File.expand_path("../../../bin/erb", __FILE__), "var=hoge"], "<%=var%>", ["hoge"]) end