public
Description: Ruby module exclusion functionality
Clone URL: git://github.com/yrashk/rbmodexcl.git
Prohibit unextending Kernel
yrashk (author)
Wed Apr 23 14:01:47 -0700 2008
commit  a08f7da742699936126a4a779e848957b781f80c
tree    2411e5e01c1c467b39976f7c4649259f85f3b584
parent  b92ec52815b2f5a6bbcb68af7f41b5eb828f82b0
...
8
9
10
11
 
 
 
12
13
14
...
8
9
10
 
11
12
13
14
15
16
0
@@ -8,7 +8,9 @@ class Object
0
       {
0
         VALUE p, prev;
0
         Check_Type(mod, T_MODULE);
0
-
0
+ if (mod == rb_mKernel)
0
+ rb_raise(rb_eArgError, "unextending Kernel is prohibited");
0
+
0
         p = (TYPE(self) == T_CLASS) ? self : rb_singleton_class(self);
0
         
0
         while (p) {

Comments

    No one has commented yet.