ruby-changes:36707
From: nobu <ko1@a...>
Date: Sat, 13 Dec 2014 04:59:42 +0900 (JST)
Subject: [ruby-changes:36707] nobu:r48788 (trunk): erb: suppress warnings
nobu 2014-12-13 04:59:22 +0900 (Sat, 13 Dec 2014) New Revision: 48788 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48788 Log: erb: suppress warnings * bin/erb (ERB::Main#run): get rid of shadowing outer local variables. [ruby-core:65772] [Feature #10395] Modified files: trunk/ChangeLog trunk/bin/erb trunk/test/erb/test_erb_command.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48787) +++ ChangeLog (revision 48788) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Dec 13 04:59:20 2014 Nobuyoshi Nakada <nobu@r...> + + * 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 <kou@c...> * gems/bundled_gems: Upgrade to test-unit 3.0.8. assert_throw and Index: bin/erb =================================================================== --- bin/erb (revision 48787) +++ bin/erb (revision 48788) @@ -141,7 +141,7 @@ EOU https://github.com/ruby/ruby/blob/trunk/bin/erb#L141 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 Index: test/erb/test_erb_command.rb =================================================================== --- test/erb/test_erb_command.rb (revision 48787) +++ test/erb/test_erb_command.rb (revision 48788) @@ -3,7 +3,8 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/erb/test_erb_command.rb#L3 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/