ruby-changes:55458
From: naruse <ko1@a...>
Date: Sun, 21 Apr 2019 14:48:43 +0900 (JST)
Subject: [ruby-changes:55458] naruse:r67679 (trunk): suppress redefinition warnings
naruse 2019-04-21 14:48:35 +0900 (Sun, 21 Apr 2019) New Revision: 67679 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67679 Log: suppress redefinition warnings Modified files: trunk/lib/irb/workspace.rb Index: lib/irb/workspace.rb =================================================================== --- lib/irb/workspace.rb (revision 67678) +++ lib/irb/workspace.rb (revision 67679) @@ -49,7 +49,7 @@ EOF https://github.com/ruby/ruby/blob/trunk/lib/irb/workspace.rb#L49 @binding = BINDING_QUEUE.pop when 3 # binding in function on TOPLEVEL_BINDING(default) - @binding = eval("def irb_binding; private; binding; end; irb_binding", + @binding = eval("self.class.remove_method(:irb_binding) if defined?(irb_binding); def irb_binding; private; binding; end; irb_binding", TOPLEVEL_BINDING, __FILE__, __LINE__ - 3) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/