[前][次][番号順一覧][スレッド一覧]

ruby-changes:44542

From: nobu <ko1@a...>
Date: Sun, 6 Nov 2016 08:54:28 +0900 (JST)
Subject: [ruby-changes:44542] nobu:r56615 (trunk): e2mmap.rb: suppress a warning

nobu	2016-11-06 08:54:17 +0900 (Sun, 06 Nov 2016)

  New Revision: 56615

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56615

  Log:
    e2mmap.rb: suppress a warning
    
    * lib/e2mmap.rb (bind): eval with the location.  undefine
      predefined method before overwriting to suppress a warning.

  Modified files:
    trunk/lib/e2mmap.rb
Index: lib/e2mmap.rb
===================================================================
--- lib/e2mmap.rb	(revision 56614)
+++ lib/e2mmap.rb	(revision 56615)
@@ -62,16 +62,20 @@ module Exception2MessageMapper https://github.com/ruby/ruby/blob/trunk/lib/e2mmap.rb#L62
   end
 
   def bind(cl)
-    self.module_eval %[
+    self.module_eval "#{<<-"begin;"}\n#{<<-"end;"}", __FILE__, __LINE__+1
+    begin;
       def Raise(err = nil, *rest)
         Exception2MessageMapper.Raise(self.class, err, *rest)
       end
       alias Fail Raise
 
+      class << self
+        undef included
+      end
       def self.included(mod)
         mod.extend Exception2MessageMapper
       end
-    ]
+    end;
   end
 
   # Fail(err, *rest)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]