ruby-changes:45778
From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 01:09:00 +0900 (JST)
Subject: [ruby-changes:45778] naruse:r57851 (trunk): suppress warning: shadowing outer local variable - dir & opt
naruse 2017-03-12 01:08:54 +0900 (Sun, 12 Mar 2017) New Revision: 57851 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57851 Log: suppress warning: shadowing outer local variable - dir & opt Modified files: trunk/tool/generic_erb.rb Index: tool/generic_erb.rb =================================================================== --- tool/generic_erb.rb (revision 57850) +++ tool/generic_erb.rb (revision 57851) @@ -39,7 +39,7 @@ end https://github.com/ruby/ruby/blob/trunk/tool/generic_erb.rb#L39 template = ARGV.shift or abort opt.to_s erb = ERB.new(File.read(template), nil, '%-') erb.filename = template -result = source ? erb.src : erb.result +result = source ? erb.src : proc{erb.result}.call if output if ifchange and (vpath.open(output, "rb") {|f| f.read} rescue nil) == result puts "#{output} #{unchanged}" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/