public
Description: Ruby module exclusion functionality
Clone URL: git://github.com/yrashk/rbmodexcl.git
Search Repo:
Class#uninclude has been added
yrashk (author)
Thu Apr 24 13:38:37 -0700 2008
commit  f963d7a955a3aea486972c7cc016e8331267d29d
tree    95e04828feadd35b344b98b95ad228379da20b83
parent  a08f7da742699936126a4a779e848957b781f80c
...
28
29
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -28,3 +28,32 @@ class Object
0
   end
0
 
0
 end
0
+
0
+class Class
0
+
0
+ inline(:C) do |builder|
0
+ builder.c %{
0
+ VALUE uninclude(VALUE mod)
0
+ {
0
+ VALUE p, prev;
0
+ Check_Type(mod, T_MODULE);
0
+ if (mod == rb_mKernel)
0
+ rb_raise(rb_eArgError, "unincluding Kernel is prohibited");
0
+
0
+ p = self;
0
+
0
+ while (p) {
0
+ if (p == mod || RCLASS(p)->m_tbl == RCLASS(mod)->m_tbl) {
0
+ RCLASS(prev)->super = RCLASS(p)->super;
0
+ rb_clear_cache();
0
+ return self;
0
+ }
0
+ prev = p;
0
+ p = RCLASS(p)->super;
0
+ }
0
+ return self;
0
+ }
0
+ }
0
+ end
0
+
0
+end

Comments

    No one has commented yet.