module-cluster 1.4.8 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/README.md +127 -337
  2. data/lib/module-cluster.rb +1 -153
  3. data/lib/module/cluster.rb +341 -0
  4. data/lib/module/cluster/class_support.rb +22 -0
  5. data/lib/module/cluster/cluster.rb +10 -0
  6. data/lib/module/cluster/cluster/cluster_interface.rb +550 -0
  7. data/lib/module/cluster/exception/module_not_in_stack.rb +26 -0
  8. data/lib/module/cluster/instance_controller.rb +14 -0
  9. data/lib/module/cluster/instance_controller/hook_controller.rb +33 -0
  10. data/lib/module/cluster/instance_controller/hook_controller/chain_proxy.rb +511 -0
  11. data/lib/module/cluster/instance_controller/hook_controller/hook_controller_interface.rb +830 -0
  12. data/lib/module/cluster/instance_controller/instance_controller_interface.rb +269 -0
  13. data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy.rb +359 -0
  14. data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb +442 -0
  15. data/lib/module/cluster/module_support.rb +67 -0
  16. data/lib/module/namespaces.rb +13 -0
  17. data/lib/module/requires.rb +32 -0
  18. data/spec/module/cluster/cluster_spec.rb +473 -0
  19. data/spec/module/cluster/instance_controller/hook_controller_spec.rb +922 -0
  20. data/spec/module/cluster/instance_controller/multiple_hook_controller_proxy_spec.rb +1240 -0
  21. data/spec/module/cluster_spec.rb +1794 -0
  22. metadata +27 -98
  23. data/README.rdoc +0 -395
  24. data/lib/module-cluster/ModuleCluster.rb +0 -9
  25. data/lib/module-cluster/ModuleCluster/Define.rb +0 -12
  26. data/lib/module-cluster/ModuleCluster/Define/Block.rb +0 -9
  27. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +0 -83
  28. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +0 -70
  29. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +0 -79
  30. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +0 -21
  31. data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +0 -77
  32. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +0 -78
  33. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +0 -78
  34. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +0 -78
  35. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +0 -36
  36. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +0 -29
  37. data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +0 -45
  38. data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +0 -77
  39. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +0 -78
  40. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +0 -29
  41. data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +0 -56
  42. data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +0 -193
  43. data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +0 -128
  44. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +0 -181
  45. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +0 -185
  46. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +0 -181
  47. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +0 -181
  48. data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +0 -40
  49. data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +0 -45
  50. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +0 -193
  51. data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +0 -209
  52. data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +0 -128
  53. data/lib/module-cluster/ModuleCluster/Define/Status.rb +0 -106
  54. data/lib/module-cluster/ModuleCluster/Suspend.rb +0 -7
  55. data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +0 -315
  56. data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +0 -153
  57. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +0 -77
  58. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +0 -44
  59. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +0 -292
  60. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +0 -24
  61. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +0 -12
  62. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +0 -9
  63. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +0 -36
  64. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +0 -20
  65. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +0 -20
  66. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +0 -36
  67. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +0 -6
  68. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +0 -140
  69. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +0 -110
  70. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +0 -140
  71. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +0 -110
  72. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set.rb +0 -35
  73. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +0 -359
  74. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +0 -55
  75. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +0 -199
  76. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +0 -34
  77. data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +0 -285
  78. data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +0 -254
  79. data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +0 -56
  80. data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +0 -278
  81. data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +0 -230
  82. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +0 -238
  83. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +0 -54
  84. data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +0 -231
  85. data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +0 -54
  86. data/spec/ModuleCluster/Define/Block/Class_spec.rb +0 -224
  87. data/spec/ModuleCluster/Define/Block/Instance_spec.rb +0 -78
  88. data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +0 -54
  89. data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +0 -51
  90. data/spec/ModuleCluster/Define/Block/Module_spec.rb +0 -230
  91. data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +0 -73
  92. data/spec/ModuleCluster/Define/Block_spec.rb +0 -18
  93. data/spec/ModuleCluster/Define/ClassCluster_spec.rb +0 -728
  94. data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +0 -576
  95. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +0 -659
  96. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +0 -678
  97. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +0 -644
  98. data/spec/ModuleCluster/Define/Cluster_spec.rb +0 -708
  99. data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +0 -102
  100. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +0 -728
  101. data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +0 -728
  102. data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +0 -576
  103. data/spec/ModuleCluster/Suspend/Hooks_spec.rb +0 -573
  104. data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +0 -559
  105. data/spec/ModuleCluster_spec.rb +0 -15
  106. data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +0 -386
  107. data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +0 -419
  108. data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +0 -242
@@ -1,24 +0,0 @@
1
-
2
- module ::ModuleCluster::CascadeFeatures::Subclass
3
-
4
- extend ::ModuleCluster::CascadeFeatures::PerformCascades
5
-
6
- ###############
7
- # inherited #
8
- ###############
9
-
10
- def inherited( hooked_instance )
11
-
12
- ::ModuleCluster::CascadeFeatures.perform_cascades( self,
13
- :inherited,
14
- hooked_instance,
15
- cluster_stack.inherited_hooks )
16
-
17
- # we don't call super because we don't want to run our inherited action multiple times
18
- # that means if you are messing with #inherited on your own (whoever is reading this code)
19
- # then you need to consider the order your #inherited will be inserted in relation to
20
- # the one provided by module-cluster
21
-
22
- end
23
-
24
- end
@@ -1,12 +0,0 @@
1
-
2
- class ::ModuleCluster::ClusterStack
3
-
4
- include Block
5
- include Includes
6
- include Extends
7
- include PrependsIncludes
8
- include PrependsExtends
9
- include Status
10
- include Suspend
11
-
12
- end
@@ -1,9 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Block
3
-
4
- include Class
5
- include Module
6
- include Instance
7
- include Inherited
8
-
9
- end
@@ -1,36 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Block::Class
3
-
4
- ###################
5
- # class_include #
6
- ###################
7
-
8
- def class_include( dependency_module, dependency_method, runtime_block )
9
- include_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
10
- end
11
-
12
- ##################
13
- # class_extend #
14
- ##################
15
-
16
- def class_extend( dependency_module, dependency_method, runtime_block )
17
- extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
18
- end
19
-
20
- ###########################
21
- # prepend_class_include #
22
- ###########################
23
-
24
- def prepend_class_include( dependency_module, dependency_method, runtime_block )
25
- prepend_include_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
26
- end
27
-
28
- ##########################
29
- # prepend_class_extend #
30
- ##########################
31
-
32
- def prepend_class_extend( dependency_module, dependency_method, runtime_block )
33
- prepend_extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
34
- end
35
-
36
- end
@@ -1,20 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Block::Inherited
3
-
4
- #####################
5
- # inherited_hooks #
6
- #####################
7
-
8
- def inherited_hooks
9
- return @inherited_hooks ||= ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new
10
- end
11
-
12
- ##############
13
- # subclass #
14
- ##############
15
-
16
- def subclass( dependency_module, dependency_method, runtime_block )
17
- inherited_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
18
- end
19
-
20
- end
@@ -1,20 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Block::Instance
3
-
4
- #####################
5
- # instance_extend #
6
- #####################
7
-
8
- def instance_extend( dependency_module, dependency_method, runtime_block )
9
- extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
10
- end
11
-
12
- #############################
13
- # prepend_instance_extend #
14
- #############################
15
-
16
- def prepend_instance_extend( dependency_module, dependency_method, runtime_block )
17
- prepend_extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
18
- end
19
-
20
- end
@@ -1,36 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Block::Module
3
-
4
- ####################
5
- # module_include #
6
- ####################
7
-
8
- def module_include( dependency_module, dependency_method, runtime_block )
9
- include_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
10
- end
11
-
12
- ###################
13
- # module_extend #
14
- ###################
15
-
16
- def module_extend( dependency_module, dependency_method, runtime_block )
17
- extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
18
- end
19
-
20
- ############################
21
- # prepend_module_include #
22
- ############################
23
-
24
- def prepend_module_include( dependency_module, dependency_method, runtime_block )
25
- prepend_include_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
26
- end
27
-
28
- ###########################
29
- # prepend_module_extend #
30
- ###########################
31
-
32
- def prepend_module_extend( dependency_module, dependency_method, runtime_block )
33
- prepend_extend_hooks.push( ::ModuleCluster::ClusterStack::Block::Set.new( dependency_module, dependency_method, runtime_block ) )
34
- end
35
-
36
- end
@@ -1,6 +0,0 @@
1
-
2
- ModuleCluster::ClusterStack::Block::Set = Struct.new( :dependency_module,
3
- :method,
4
- :runtime_block,
5
- :suspended,
6
- :name )
@@ -1,140 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Extends
3
-
4
- ##################
5
- # extend_hooks #
6
- ##################
7
-
8
- def extend_hooks
9
- return @extend_hooks ||= ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new
10
- end
11
-
12
- #####################
13
- # extend_includes #
14
- #####################
15
-
16
- def extend_includes( module_instance, method, includes, runtime_includes_block )
17
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include, includes, runtime_includes_block )
18
- extend_hooks.push( new_set )
19
- return new_set
20
- end
21
-
22
- ####################
23
- # extend_extends #
24
- ####################
25
-
26
- def extend_extends( module_instance, method, extends, runtime_extends_block )
27
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :extend, extends, runtime_extends_block )
28
- extend_hooks.push( new_set )
29
- return new_set
30
- end
31
-
32
- #################################
33
- # extend_includes_and_extends #
34
- #################################
35
-
36
- def extend_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
37
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
38
- extend_hooks.push( new_set )
39
- return new_set
40
- end
41
-
42
- ############################
43
- # module_extend_includes #
44
- ############################
45
-
46
- def module_extend_includes( module_instance, method, includes, runtime_includes_block )
47
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include, includes, runtime_includes_block )
48
- extend_hooks.push( new_set )
49
- return new_set
50
- end
51
-
52
- ###########################
53
- # module_extend_extends #
54
- ###########################
55
-
56
- def module_extend_extends( module_instance, method, extends, runtime_extends_block )
57
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :extend, extends, runtime_extends_block )
58
- extend_hooks.push( new_set )
59
- return new_set
60
- end
61
-
62
- ########################################
63
- # module_extend_includes_and_extends #
64
- ########################################
65
-
66
- def module_extend_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
67
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
68
- extend_hooks.push( new_set )
69
- return new_set
70
- end
71
-
72
- ###########################
73
- # class_extend_includes #
74
- ###########################
75
-
76
- def class_extend_includes( module_instance, method, includes, runtime_includes_block )
77
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include, includes, runtime_includes_block )
78
- extend_hooks.push( new_set )
79
- return new_set
80
- end
81
-
82
- ##########################
83
- # class_extend_extends #
84
- ##########################
85
-
86
- def class_extend_extends( module_instance, method, extends, runtime_extends_block )
87
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :extend, extends, runtime_extends_block )
88
- extend_hooks.push( new_set )
89
- return new_set
90
- end
91
-
92
- #######################################
93
- # class_extend_includes_and_extends #
94
- #######################################
95
-
96
- def class_extend_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
97
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
98
- extend_hooks.push( new_set )
99
- return new_set
100
- end
101
-
102
- ##############################
103
- # instance_extend_includes #
104
- ##############################
105
-
106
- def instance_extend_includes( module_instance, method, includes, runtime_includes_block )
107
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include, includes, runtime_includes_block )
108
- extend_hooks.push( new_set )
109
- return new_set
110
- end
111
-
112
- #############################
113
- # instance_extend_extends #
114
- #############################
115
-
116
- def instance_extend_extends( module_instance, method, extends, runtime_extends_block )
117
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :extend, extends, runtime_extends_block )
118
- extend_hooks.push( new_set )
119
- return new_set
120
- end
121
-
122
- ##########################################
123
- # instance_extend_includes_and_extends #
124
- ##########################################
125
-
126
- def instance_extend_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
127
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
128
- extend_hooks.push( new_set )
129
- return new_set
130
- end
131
-
132
- ######################
133
- # has_extend_hook? #
134
- ######################
135
-
136
- def has_extend_hook?( description )
137
- return extend_hooks.hooks_with( description ) || false
138
- end
139
-
140
- end
@@ -1,110 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::Includes
3
-
4
- ###################
5
- # include_hooks #
6
- ###################
7
-
8
- def include_hooks
9
- return @include_hooks ||= ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new
10
- end
11
-
12
- ######################
13
- # include_includes #
14
- ######################
15
-
16
- def include_includes( module_instance, method, includes, runtime_includes_block )
17
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include, includes, runtime_includes_block )
18
- include_hooks.push( new_set )
19
- return new_set
20
- end
21
-
22
- #####################
23
- # include_extends #
24
- #####################
25
-
26
- def include_extends( module_instance, method, extends, runtime_extends_block )
27
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :extend, extends, runtime_extends_block )
28
- include_hooks.push( new_set )
29
- return new_set
30
- end
31
-
32
- ##################################
33
- # include_includes_and_extends #
34
- ##################################
35
-
36
- def include_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
37
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
38
- include_hooks.push( new_set )
39
- return new_set
40
- end
41
-
42
- #############################
43
- # module_include_includes #
44
- #############################
45
-
46
- def module_include_includes( module_instance, method, includes, runtime_includes_block )
47
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include, includes, runtime_includes_block )
48
- include_hooks.push( new_set )
49
- return new_set
50
- end
51
-
52
- ############################
53
- # module_include_extends #
54
- ############################
55
-
56
- def module_include_extends( module_instance, method, extends, runtime_extends_block )
57
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :extend, extends, runtime_extends_block )
58
- include_hooks.push( new_set )
59
- return new_set
60
- end
61
-
62
- #########################################
63
- # module_include_includes_and_extends #
64
- #########################################
65
-
66
- def module_include_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
67
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
68
- include_hooks.push( new_set )
69
- return new_set
70
- end
71
-
72
- ############################
73
- # class_include_includes #
74
- ############################
75
-
76
- def class_include_includes( module_instance, method, includes, runtime_includes_block )
77
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include, includes, runtime_includes_block )
78
- include_hooks.push( new_set )
79
- return new_set
80
- end
81
-
82
- ###########################
83
- # class_include_extends #
84
- ###########################
85
-
86
- def class_include_extends( module_instance, method, extends, runtime_extends_block )
87
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :extend, extends, runtime_extends_block )
88
- include_hooks.push( new_set )
89
- return new_set
90
- end
91
-
92
- ########################################
93
- # class_include_includes_and_extends #
94
- ########################################
95
-
96
- def class_include_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
97
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
98
- include_hooks.push( new_set )
99
- return new_set
100
- end
101
-
102
- #######################
103
- # has_include_hook? #
104
- #######################
105
-
106
- def has_include_hook?( description )
107
- return include_hooks.hooks_with( description ) || false
108
- end
109
-
110
- end
@@ -1,140 +0,0 @@
1
-
2
- module ::ModuleCluster::ClusterStack::PrependsExtends
3
-
4
- #############################
5
- # prepend_extend_hooks #
6
- #############################
7
-
8
- def prepend_extend_hooks
9
- return @prepend_extend_hooks ||= ::ModuleCluster::ClusterStack::Set::MultiSetProxy.new
10
- end
11
-
12
- ##############################
13
- # extend_prepends_includes #
14
- ##############################
15
-
16
- def extend_prepends_includes( module_instance, method, includes, runtime_includes_block )
17
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include, includes, runtime_includes_block )
18
- prepend_extend_hooks.push( new_set )
19
- return new_set
20
- end
21
-
22
- #############################
23
- # extend_prepends_extends #
24
- #############################
25
-
26
- def extend_prepends_extends( module_instance, method, extends, runtime_extends_block )
27
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :extend, extends, runtime_extends_block )
28
- prepend_extend_hooks.push( new_set )
29
- return new_set
30
- end
31
-
32
- ##########################################
33
- # extend_prepends_includes_and_extends #
34
- ##########################################
35
-
36
- def extend_prepends_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
37
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
38
- prepend_extend_hooks.push( new_set )
39
- return new_set
40
- end
41
-
42
- #####################################
43
- # module_extend_prepends_includes #
44
- #####################################
45
-
46
- def module_extend_prepends_includes( module_instance, method, includes, runtime_includes_block )
47
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include, includes, runtime_includes_block )
48
- prepend_extend_hooks.push( new_set )
49
- return new_set
50
- end
51
-
52
- ####################################
53
- # module_extend_prepends_extends #
54
- ####################################
55
-
56
- def module_extend_prepends_extends( module_instance, method, extends, runtime_extends_block )
57
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :extend, extends, runtime_extends_block )
58
- prepend_extend_hooks.push( new_set )
59
- return new_set
60
- end
61
-
62
- #################################################
63
- # module_extend_prepends_includes_and_extends #
64
- #################################################
65
-
66
- def module_extend_prepends_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
67
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
68
- prepend_extend_hooks.push( new_set )
69
- return new_set
70
- end
71
-
72
- ####################################
73
- # class_extend_prepends_includes #
74
- ####################################
75
-
76
- def class_extend_prepends_includes( module_instance, method, includes, runtime_includes_block )
77
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include, includes, runtime_includes_block )
78
- prepend_extend_hooks.push( new_set )
79
- return new_set
80
- end
81
-
82
- ###################################
83
- # class_extend_prepends_extends #
84
- ###################################
85
-
86
- def class_extend_prepends_extends( module_instance, method, extends, runtime_extends_block )
87
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :extend, extends, runtime_extends_block )
88
- prepend_extend_hooks.push( new_set )
89
- return new_set
90
- end
91
-
92
- ################################################
93
- # class_extend_prepends_includes_and_extends #
94
- ################################################
95
-
96
- def class_extend_prepends_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
97
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
98
- prepend_extend_hooks.push( new_set )
99
- return new_set
100
- end
101
-
102
- #######################################
103
- # instance_extend_prepends_includes #
104
- #######################################
105
-
106
- def instance_extend_prepends_includes( module_instance, method, includes, runtime_includes_block )
107
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include, includes, runtime_includes_block )
108
- prepend_extend_hooks.push( new_set )
109
- return new_set
110
- end
111
-
112
- ######################################
113
- # instance_extend_prepends_extends #
114
- ######################################
115
-
116
- def instance_extend_prepends_extends( module_instance, method, extends, runtime_extends_block )
117
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :extend, extends, runtime_extends_block )
118
- prepend_extend_hooks.push( new_set )
119
- return new_set
120
- end
121
-
122
- ###################################################
123
- # instance_extend_prepends_includes_and_extends #
124
- ###################################################
125
-
126
- def instance_extend_prepends_includes_and_extends( module_instance, method, includes_and_extends, runtime_includes_and_extends_block )
127
- new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
128
- prepend_extend_hooks.push( new_set )
129
- return new_set
130
- end
131
-
132
- ##############################
133
- # has_prepend_extend_hook? #
134
- ##############################
135
-
136
- def has_prepend_extend_hook?( description )
137
- return prepend_extend_hooks.hooks_with( description ) || false
138
- end
139
-
140
- end