module-cluster 1.4.4 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/README.md +21 -0
  2. data/README.rdoc +21 -0
  3. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +83 -0
  4. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +70 -0
  5. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +79 -0
  6. data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +22 -0
  7. data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +15 -7
  8. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +15 -7
  9. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +15 -7
  10. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +15 -7
  11. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +11 -3
  12. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +10 -2
  13. data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +15 -3
  14. data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +15 -7
  15. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +15 -7
  16. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +10 -2
  17. data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +13 -2
  18. data/lib/module-cluster/ModuleCluster/Define/Block.rb +1 -1
  19. data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +19 -19
  20. data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +34 -34
  21. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +19 -19
  22. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +19 -19
  23. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +19 -19
  24. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +19 -19
  25. data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +1 -1
  26. data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +3 -3
  27. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +19 -19
  28. data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +43 -43
  29. data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +34 -34
  30. data/lib/module-cluster/ModuleCluster/Define/Status.rb +1 -1
  31. data/lib/module-cluster/ModuleCluster/Define.rb +1 -1
  32. data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +1 -1
  33. data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +1 -1
  34. data/lib/module-cluster/ModuleCluster/Suspend.rb +1 -1
  35. data/lib/module-cluster/ModuleCluster.rb +1 -1
  36. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +3 -3
  37. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +85 -32
  38. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +6 -3
  39. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +5 -5
  40. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +9 -9
  41. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +3 -3
  42. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +5 -5
  43. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +9 -9
  44. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +1 -0
  45. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +1 -1
  46. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +13 -13
  47. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +10 -10
  48. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +13 -13
  49. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +10 -10
  50. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +1 -1
  51. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +1 -1
  52. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +1 -1
  53. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +1 -1
  54. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade/Subclass.rb +1 -1
  55. data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +1 -1
  56. data/lib/module-cluster.rb +14 -2
  57. data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +285 -0
  58. data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +241 -0
  59. data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +56 -0
  60. data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +278 -0
  61. data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +13 -13
  62. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +13 -13
  63. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +2 -3
  64. data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +13 -13
  65. data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +2 -2
  66. data/spec/ModuleCluster/Define/Block/Class_spec.rb +13 -13
  67. data/spec/ModuleCluster/Define/Block/Instance_spec.rb +5 -5
  68. data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +1 -1
  69. data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +2 -4
  70. data/spec/ModuleCluster/Define/Block/Module_spec.rb +13 -13
  71. data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +8 -8
  72. data/spec/ModuleCluster/Define/Block_spec.rb +9 -9
  73. data/spec/ModuleCluster/Define/ClassCluster_spec.rb +227 -227
  74. data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +197 -197
  75. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +228 -228
  76. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +232 -232
  77. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +224 -224
  78. data/spec/ModuleCluster/Define/Cluster_spec.rb +221 -221
  79. data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +29 -29
  80. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +227 -227
  81. data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +227 -227
  82. data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +197 -197
  83. data/spec/ModuleCluster/Suspend/Hooks_spec.rb +120 -120
  84. data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +120 -120
  85. data/spec/ModuleCluster_spec.rb +2 -2
  86. data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +192 -192
  87. data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +129 -129
  88. data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +17 -17
  89. metadata +9 -1
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::CascadeFeatures::PerformCascades
2
+ module ::ModuleCluster::CascadeFeatures::PerformCascades
3
3
 
4
4
  ######################
5
5
  # perform_cascades #
@@ -7,7 +7,7 @@ module ModuleCluster::CascadeFeatures::PerformCascades
7
7
 
8
8
  def perform_cascades( module_self, action, hooked_instance, set_stack )
9
9
 
10
- # This method is called when a ModuleCluster module is included or extended.
10
+ # This method is called when a ::ModuleCluster module is included or extended.
11
11
  # It determines what modules should be included/extended and which should cascade.
12
12
 
13
13
  unless module_self.hooks_suspended?( action )
@@ -18,10 +18,16 @@ module ModuleCluster::CascadeFeatures::PerformCascades
18
18
  # if this particular set is suspended, skip to the next
19
19
  next if this_set.suspended
20
20
 
21
- # Block sets simply run a block at a hook. They do not include or extend returns from the block.
22
- # The hooked module will not be extended by ModuleCluster.
23
- if this_set.is_a?( ModuleCluster::ClusterStack::Block::Set )
21
+ # Block sets simply run a block at a hook.
22
+ # They do not include or extend returns from the block.
23
+ # The hooked module will not be extended by ::ModuleCluster.
24
+ if this_set.is_a?( ::ModuleCluster::ClusterStack::Block::Set )
24
25
 
26
+ # if our blocks are set to cascade then we need to copy inherit hooks
27
+ if this_set.dependency_module.should_cascade?( hooked_instance )
28
+ cascade_block_into_hooked_instance( module_self, hooked_instance, this_set )
29
+ end
30
+
25
31
  if this_set.dependency_module.should_run_block?( hooked_instance )
26
32
 
27
33
  case this_set.runtime_block.arity
@@ -36,29 +42,44 @@ module ModuleCluster::CascadeFeatures::PerformCascades
36
42
  # Other sets take parameters and an optional block. The optional block returns are included
37
43
  # or extended like the parameters provided.
38
44
  else
45
+
46
+ if should_cascade = this_set.dependency_module.should_cascade?( hooked_instance )
47
+ # cascade parameter modules as appropriate
48
+ cascade_modules_into_hooked_instance( module_self,
49
+ hooked_instance,
50
+ this_set,
51
+ this_set.modules )
52
+ end
39
53
 
40
54
  # dependency modules can cause instances to be included/extended and/or cascade
41
55
  should_include = this_set.dependency_module.should_include_or_extend?( hooked_instance )
42
- should_cascade = this_set.dependency_module.should_cascade?( hooked_instance )
43
-
44
- # cascade parameter modules as appropriate
45
- cascade_modules_into_hooked_instance( module_self, hooked_instance, this_set, this_set.modules ) if should_cascade
46
56
 
47
57
  # include/extend parameter modules as appropriate
48
- include_extend_modules( module_self, hooked_instance, this_set, this_set.modules ) if should_include
49
-
58
+ if should_include
59
+ include_extend_modules( module_self, hooked_instance, this_set, this_set.modules )
60
+ end
61
+
50
62
  # process runtime block if present
51
63
  if this_set.runtime_includes_or_extends_block
52
64
 
53
65
  # if we have a runtime block, run block and collect returns as appropriate
54
- if runtime_modules = collect_block_runtime_result_modules( module_self, hooked_instance, this_set )
66
+ if runtime_modules = collect_block_runtime_result_modules( module_self,
67
+ hooked_instance,
68
+ this_set )
55
69
 
56
70
  # cascade return modules if appropriate
57
- cascade_modules_into_hooked_instance( module_self, hooked_instance, this_set, runtime_modules ) if should_cascade
58
-
71
+ if should_cascade
72
+ cascade_modules_into_hooked_instance( module_self,
73
+ hooked_instance,
74
+ this_set,
75
+ runtime_modules )
76
+ end
77
+
59
78
  # include/extend return modules if appropriate
60
- include_extend_modules( module_self, hooked_instance, this_set, runtime_modules ) if should_include
61
-
79
+ if should_include
80
+ include_extend_modules( module_self, hooked_instance, this_set, runtime_modules )
81
+ end
82
+
62
83
  end
63
84
 
64
85
  end
@@ -95,19 +116,40 @@ module ModuleCluster::CascadeFeatures::PerformCascades
95
116
 
96
117
  def cascade_modules_into_hooked_instance( module_self, hooked_instance, set, modules )
97
118
 
98
- # if we are supposed to cascade we need to extend with the ModuleCluster dependency module
119
+ # if we are supposed to cascade we need to extend with the ::ModuleCluster dependency module
99
120
  hooked_instance.extend( set.dependency_module )
100
121
 
101
122
  # and we call the set's definition method to cascade
102
123
  hooked_instance.__send__( set.method, *modules )
103
124
 
104
125
  end
126
+
127
+ ########################################
128
+ # cascade_block_into_hooked_instance #
129
+ ########################################
130
+
131
+ def cascade_block_into_hooked_instance( module_self, hooked_instance, set )
132
+
133
+ # if we are supposed to cascade we need to extend with the ::ModuleCluster dependency module
134
+ hooked_instance.extend( set.dependency_module )
135
+
136
+ # and we call the set's definition method to cascade
137
+ hooked_instance.__send__( set.method, & set.runtime_block )
138
+
139
+ existing_inherit_hooks = module_self.cluster_stack.inherited_hooks
140
+ hooked_instance.cluster_stack.inherited_hooks.concat( existing_inherit_hooks )
141
+
142
+ end
105
143
 
106
144
  #######################################
107
145
  # include_or_extend_hooked_instance #
108
146
  ######################################
109
147
 
110
- def include_or_extend_hooked_instance( hooked_instance, set, should_include, should_extend, modules )
148
+ def include_or_extend_hooked_instance( hooked_instance,
149
+ set,
150
+ should_include,
151
+ should_extend,
152
+ modules )
111
153
 
112
154
  # We have collected includes, extends, transparent cascades.
113
155
  # Now we want to actually include/extend/cascade as appropriate.
@@ -118,16 +160,18 @@ module ModuleCluster::CascadeFeatures::PerformCascades
118
160
 
119
161
  hooked_instance.module_eval do
120
162
 
121
- if should_include and
122
- module_self.should_include_or_extend_instance?( set.module_class_instance_or_all, hooked_instance ) and
163
+ if should_include and
164
+ module_self.should_include_or_extend_instance?( set.module_class_instance_or_all,
165
+ hooked_instance ) and
123
166
  ! modules.empty?
124
167
 
125
168
  include( *modules.reverse )
126
169
 
127
170
  end
128
171
 
129
- if should_extend and
130
- module_self.should_include_or_extend_instance?( set.module_class_instance_or_all, hooked_instance ) and
172
+ if should_extend and
173
+ module_self.should_include_or_extend_instance?( set.module_class_instance_or_all,
174
+ hooked_instance ) and
131
175
  ! modules.empty?
132
176
 
133
177
  extend( *modules.reverse )
@@ -139,8 +183,9 @@ module ModuleCluster::CascadeFeatures::PerformCascades
139
183
  # Otherwise we have an instance:
140
184
  else
141
185
 
142
- if should_extend and
143
- module_self.should_include_or_extend_instance?( set.module_class_instance_or_all, hooked_instance ) and
186
+ if should_extend and
187
+ module_self.should_include_or_extend_instance?( set.module_class_instance_or_all,
188
+ hooked_instance ) and
144
189
  ! modules.empty?
145
190
 
146
191
  hooked_instance.extend( *modules.reverse )
@@ -157,7 +202,8 @@ module ModuleCluster::CascadeFeatures::PerformCascades
157
202
 
158
203
  def should_include_or_extend_instance?( module_class_instance_or_all, into_instance )
159
204
 
160
- # The set stack already corresponds to include or extend or both, we are testing all_module_class_or_instance for:
205
+ # The set stack already corresponds to include or extend or both,
206
+ # we are testing all_module_class_or_instance for:
161
207
  #
162
208
  # * any include/extend
163
209
  # * module include/extend
@@ -174,12 +220,14 @@ module ModuleCluster::CascadeFeatures::PerformCascades
174
220
  should_include_or_extend_instance = into_instance.is_a?( Module )
175
221
  when :module_or_instance, :module_and_instance, :module_instance
176
222
  should_include_or_extend_instance = ( ! into_instance.is_a?( Module ) or
177
- ( into_instance.is_a?( Module ) && ! into_instance.is_a?( Class ) ) )
223
+ ( into_instance.is_a?( Module ) &&
224
+ ! into_instance.is_a?( Class ) ) )
178
225
  when :class_or_instance, :class_and_instance, :class_instance
179
226
  should_include_or_extend_instance = ( into_instance.is_a?( Class ) or
180
227
  ! into_instance.is_a?( Module ) )
181
228
  when :module
182
- should_include_or_extend_instance = ( into_instance.is_a?( Module ) && ! into_instance.is_a?( Class ) )
229
+ should_include_or_extend_instance = ( into_instance.is_a?( Module ) &&
230
+ ! into_instance.is_a?( Class ) )
183
231
  when :class
184
232
  should_include_or_extend_instance = into_instance.is_a?( Class )
185
233
  when :instance
@@ -198,18 +246,23 @@ module ModuleCluster::CascadeFeatures::PerformCascades
198
246
 
199
247
  runtime_block_result_modules = nil
200
248
 
201
- case set.runtime_includes_or_extends_block.arity
249
+ block = set.runtime_includes_or_extends_block
250
+
251
+ case block.arity
202
252
  when 0
203
- runtime_block_result_modules = module_self.instance_eval( & set.runtime_includes_or_extends_block )
253
+ runtime_block_result_modules = module_self.instance_eval( & block )
204
254
  else
205
- runtime_block_result_modules = module_self.instance_exec( hooked_instance, & set.runtime_includes_or_extends_block )
255
+ runtime_block_result_modules = module_self.instance_exec( hooked_instance,
256
+ & block )
206
257
  end
207
258
 
208
259
  if runtime_block_result_modules
209
260
 
210
261
  # make sure we have an array as a result
211
- runtime_block_result_modules = [ runtime_block_result_modules ] unless runtime_block_result_modules.is_a?( Array )
212
-
262
+ unless runtime_block_result_modules.is_a?( Array )
263
+ runtime_block_result_modules = [ runtime_block_result_modules ]
264
+ end
265
+
213
266
  # make sure members of our result array are modules
214
267
  runtime_block_result_modules.delete_if do |this_result_instance|
215
268
  ! this_result_instance.is_a?( Module )
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::CascadeFeatures::Subclass
2
+ module ::ModuleCluster::CascadeFeatures::Subclass
3
3
 
4
4
  ###############
5
5
  # inherited #
@@ -8,10 +8,13 @@ module ModuleCluster::CascadeFeatures::Subclass
8
8
  def inherited( hooked_instance )
9
9
 
10
10
  # all future subclasses should receive cascading hook
11
- hooked_instance.extend( ModuleCluster::CascadeFeatures::Subclass )
11
+ hooked_instance.extend( ::ModuleCluster::CascadeFeatures::Subclass )
12
12
  hooked_instance.cluster_stack.inherited_hooks.concat( cluster_stack.inherited_hooks )
13
13
 
14
- ModuleCluster::CascadeFeatures.perform_cascades( self, :inherited, hooked_instance, cluster_stack.inherited_hooks )
14
+ ::ModuleCluster::CascadeFeatures.perform_cascades( self,
15
+ :inherited,
16
+ hooked_instance,
17
+ cluster_stack.inherited_hooks )
15
18
 
16
19
  super
17
20
 
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::CascadeFeatures
2
+ module ::ModuleCluster::CascadeFeatures
3
3
 
4
4
  extend ::ModuleCluster::CascadeFeatures::PerformCascades
5
5
 
@@ -9,7 +9,7 @@ module ModuleCluster::CascadeFeatures
9
9
 
10
10
  def append_features( hooked_instance )
11
11
 
12
- ModuleCluster::CascadeFeatures.perform_cascades( self, :prepend_include, hooked_instance, cluster_stack.prepend_include_hooks )
12
+ ::ModuleCluster::CascadeFeatures.perform_cascades( self, :prepend_include, hooked_instance, cluster_stack.prepend_include_hooks )
13
13
 
14
14
  super
15
15
 
@@ -23,7 +23,7 @@ module ModuleCluster::CascadeFeatures
23
23
 
24
24
  super
25
25
 
26
- ModuleCluster::CascadeFeatures.perform_cascades( self, :include, hooked_instance, cluster_stack.include_hooks )
26
+ ::ModuleCluster::CascadeFeatures.perform_cascades( self, :include, hooked_instance, cluster_stack.include_hooks )
27
27
 
28
28
  end
29
29
 
@@ -33,7 +33,7 @@ module ModuleCluster::CascadeFeatures
33
33
 
34
34
  def extend_object( hooked_instance )
35
35
 
36
- ModuleCluster::CascadeFeatures.perform_cascades( self, :prepend_extend, hooked_instance, cluster_stack.prepend_extend_hooks )
36
+ ::ModuleCluster::CascadeFeatures.perform_cascades( self, :prepend_extend, hooked_instance, cluster_stack.prepend_extend_hooks )
37
37
 
38
38
  super
39
39
 
@@ -47,7 +47,7 @@ module ModuleCluster::CascadeFeatures
47
47
 
48
48
  super
49
49
 
50
- ModuleCluster::CascadeFeatures.perform_cascades( self, :extend, hooked_instance, cluster_stack.extend_hooks )
50
+ ::ModuleCluster::CascadeFeatures.perform_cascades( self, :extend, hooked_instance, cluster_stack.extend_hooks )
51
51
 
52
52
  end
53
53
 
@@ -1,36 +1,36 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Block::Class
2
+ module ::ModuleCluster::ClusterStack::Block::Class
3
3
 
4
4
  ###################
5
5
  # class_include #
6
6
  ###################
7
7
 
8
- def class_include( dependency_module, runtime_block )
9
- include_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
10
  end
11
11
 
12
12
  ##################
13
13
  # class_extend #
14
14
  ##################
15
15
 
16
- def class_extend( dependency_module, runtime_block )
17
- extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
18
  end
19
19
 
20
20
  ###########################
21
21
  # prepend_class_include #
22
22
  ###########################
23
23
 
24
- def prepend_class_include( dependency_module, runtime_block )
25
- prepend_include_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
26
  end
27
27
 
28
28
  ##########################
29
29
  # prepend_class_extend #
30
30
  ##########################
31
31
 
32
- def prepend_class_extend( dependency_module, runtime_block )
33
- prepend_extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
34
  end
35
35
 
36
36
  end
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Block::Inherited
2
+ module ::ModuleCluster::ClusterStack::Block::Inherited
3
3
 
4
4
  #####################
5
5
  # inherited_hooks #
@@ -13,8 +13,8 @@ module ModuleCluster::ClusterStack::Block::Inherited
13
13
  # subclass #
14
14
  ##############
15
15
 
16
- def subclass( dependency_module, runtime_block )
17
- inherited_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
18
  end
19
19
 
20
20
  end
@@ -1,20 +1,20 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Block::Instance
2
+ module ::ModuleCluster::ClusterStack::Block::Instance
3
3
 
4
4
  #####################
5
5
  # instance_extend #
6
6
  #####################
7
7
 
8
- def instance_extend( dependency_module, runtime_block )
9
- extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
10
  end
11
11
 
12
12
  #############################
13
13
  # prepend_instance_extend #
14
14
  #############################
15
15
 
16
- def prepend_instance_extend( dependency_module, runtime_block )
17
- prepend_extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
18
  end
19
19
 
20
20
  end
@@ -1,36 +1,36 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Block::Module
2
+ module ::ModuleCluster::ClusterStack::Block::Module
3
3
 
4
4
  ####################
5
5
  # module_include #
6
6
  ####################
7
7
 
8
- def module_include( dependency_module, runtime_block )
9
- include_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
10
  end
11
11
 
12
12
  ###################
13
13
  # module_extend #
14
14
  ###################
15
15
 
16
- def module_extend( dependency_module, runtime_block )
17
- extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
18
  end
19
19
 
20
20
  ############################
21
21
  # prepend_module_include #
22
22
  ############################
23
23
 
24
- def prepend_module_include( dependency_module, runtime_block )
25
- prepend_include_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
26
  end
27
27
 
28
28
  ###########################
29
29
  # prepend_module_extend #
30
30
  ###########################
31
31
 
32
- def prepend_module_extend( dependency_module, runtime_block )
33
- prepend_extend_hooks.push( ModuleCluster::ClusterStack::Block::Set.new( dependency_module, runtime_block ) )
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
34
  end
35
35
 
36
36
  end
@@ -1,5 +1,6 @@
1
1
 
2
2
  ModuleCluster::ClusterStack::Block::Set = Struct.new( :dependency_module,
3
+ :method,
3
4
  :runtime_block,
4
5
  :suspended,
5
6
  :name )
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Block
2
+ module ::ModuleCluster::ClusterStack::Block
3
3
 
4
4
  include Class
5
5
  include Module
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Extends
2
+ module ::ModuleCluster::ClusterStack::Extends
3
3
 
4
4
  ##################
5
5
  # extend_hooks #
@@ -14,7 +14,7 @@ module ModuleCluster::ClusterStack::Extends
14
14
  #####################
15
15
 
16
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 )
17
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include, includes, runtime_includes_block )
18
18
  extend_hooks.push( new_set )
19
19
  return new_set
20
20
  end
@@ -24,7 +24,7 @@ module ModuleCluster::ClusterStack::Extends
24
24
  ####################
25
25
 
26
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 )
27
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :extend, extends, runtime_extends_block )
28
28
  extend_hooks.push( new_set )
29
29
  return new_set
30
30
  end
@@ -34,7 +34,7 @@ module ModuleCluster::ClusterStack::Extends
34
34
  #################################
35
35
 
36
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 )
37
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
38
38
  extend_hooks.push( new_set )
39
39
  return new_set
40
40
  end
@@ -44,7 +44,7 @@ module ModuleCluster::ClusterStack::Extends
44
44
  ############################
45
45
 
46
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 )
47
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include, includes, runtime_includes_block )
48
48
  extend_hooks.push( new_set )
49
49
  return new_set
50
50
  end
@@ -54,7 +54,7 @@ module ModuleCluster::ClusterStack::Extends
54
54
  ###########################
55
55
 
56
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 )
57
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :extend, extends, runtime_extends_block )
58
58
  extend_hooks.push( new_set )
59
59
  return new_set
60
60
  end
@@ -64,7 +64,7 @@ module ModuleCluster::ClusterStack::Extends
64
64
  ########################################
65
65
 
66
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 )
67
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
68
68
  extend_hooks.push( new_set )
69
69
  return new_set
70
70
  end
@@ -74,7 +74,7 @@ module ModuleCluster::ClusterStack::Extends
74
74
  ###########################
75
75
 
76
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 )
77
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include, includes, runtime_includes_block )
78
78
  extend_hooks.push( new_set )
79
79
  return new_set
80
80
  end
@@ -84,7 +84,7 @@ module ModuleCluster::ClusterStack::Extends
84
84
  ##########################
85
85
 
86
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 )
87
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :extend, extends, runtime_extends_block )
88
88
  extend_hooks.push( new_set )
89
89
  return new_set
90
90
  end
@@ -94,7 +94,7 @@ module ModuleCluster::ClusterStack::Extends
94
94
  #######################################
95
95
 
96
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 )
97
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
98
98
  extend_hooks.push( new_set )
99
99
  return new_set
100
100
  end
@@ -104,7 +104,7 @@ module ModuleCluster::ClusterStack::Extends
104
104
  ##############################
105
105
 
106
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 )
107
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include, includes, runtime_includes_block )
108
108
  extend_hooks.push( new_set )
109
109
  return new_set
110
110
  end
@@ -114,7 +114,7 @@ module ModuleCluster::ClusterStack::Extends
114
114
  #############################
115
115
 
116
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 )
117
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :extend, extends, runtime_extends_block )
118
118
  extend_hooks.push( new_set )
119
119
  return new_set
120
120
  end
@@ -124,7 +124,7 @@ module ModuleCluster::ClusterStack::Extends
124
124
  ##########################################
125
125
 
126
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 )
127
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :instance, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
128
128
  extend_hooks.push( new_set )
129
129
  return new_set
130
130
  end
@@ -1,5 +1,5 @@
1
1
 
2
- module ModuleCluster::ClusterStack::Includes
2
+ module ::ModuleCluster::ClusterStack::Includes
3
3
 
4
4
  ###################
5
5
  # include_hooks #
@@ -14,7 +14,7 @@ module ModuleCluster::ClusterStack::Includes
14
14
  ######################
15
15
 
16
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 )
17
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include, includes, runtime_includes_block )
18
18
  include_hooks.push( new_set )
19
19
  return new_set
20
20
  end
@@ -24,7 +24,7 @@ module ModuleCluster::ClusterStack::Includes
24
24
  #####################
25
25
 
26
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 )
27
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :extend, extends, runtime_extends_block )
28
28
  include_hooks.push( new_set )
29
29
  return new_set
30
30
  end
@@ -34,7 +34,7 @@ module ModuleCluster::ClusterStack::Includes
34
34
  ##################################
35
35
 
36
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 )
37
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :all, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
38
38
  include_hooks.push( new_set )
39
39
  return new_set
40
40
  end
@@ -44,7 +44,7 @@ module ModuleCluster::ClusterStack::Includes
44
44
  #############################
45
45
 
46
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 )
47
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include, includes, runtime_includes_block )
48
48
  include_hooks.push( new_set )
49
49
  return new_set
50
50
  end
@@ -54,7 +54,7 @@ module ModuleCluster::ClusterStack::Includes
54
54
  ############################
55
55
 
56
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 )
57
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :extend, extends, runtime_extends_block )
58
58
  include_hooks.push( new_set )
59
59
  return new_set
60
60
  end
@@ -64,7 +64,7 @@ module ModuleCluster::ClusterStack::Includes
64
64
  #########################################
65
65
 
66
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 )
67
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :module, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
68
68
  include_hooks.push( new_set )
69
69
  return new_set
70
70
  end
@@ -74,7 +74,7 @@ module ModuleCluster::ClusterStack::Includes
74
74
  ############################
75
75
 
76
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 )
77
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include, includes, runtime_includes_block )
78
78
  include_hooks.push( new_set )
79
79
  return new_set
80
80
  end
@@ -84,7 +84,7 @@ module ModuleCluster::ClusterStack::Includes
84
84
  ###########################
85
85
 
86
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 )
87
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :extend, extends, runtime_extends_block )
88
88
  include_hooks.push( new_set )
89
89
  return new_set
90
90
  end
@@ -94,7 +94,7 @@ module ModuleCluster::ClusterStack::Includes
94
94
  ########################################
95
95
 
96
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 )
97
+ new_set = ::ModuleCluster::ClusterStack::Set.new( module_instance, method, :class, :include_and_extend, includes_and_extends, runtime_includes_and_extends_block )
98
98
  include_hooks.push( new_set )
99
99
  return new_set
100
100
  end