module-cluster 1.3.7 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/README.md +146 -1
  2. data/README.rdoc +146 -1
  3. data/lib/module-cluster.rb +54 -12
  4. data/lib/module-cluster/ModuleCluster/Define/Block.rb +3 -0
  5. data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +16 -4
  6. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +63 -0
  7. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +2 -0
  8. data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +63 -0
  9. data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +32 -0
  10. data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +16 -4
  11. data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +63 -0
  12. data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +200 -0
  13. data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +127 -0
  14. data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +7 -19
  15. data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +5 -20
  16. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +9 -26
  17. data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +9 -26
  18. data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +46 -0
  19. data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +200 -0
  20. data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +208 -0
  21. data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +127 -0
  22. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +54 -0
  23. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +44 -0
  24. data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +209 -0
  25. data/lib/module-cluster/{ModuleCluster → _private_/ModuleCluster}/ClusterStack.rb +0 -2
  26. data/lib/module-cluster/{ModuleCluster → _private_/ModuleCluster}/ClusterStack/Block.rb +1 -2
  27. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +36 -0
  28. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +20 -0
  29. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +36 -0
  30. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +2 -0
  31. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +108 -0
  32. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +84 -0
  33. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +108 -0
  34. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +84 -0
  35. data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set.rb +7 -0
  36. data/lib/module-cluster/{ModuleCluster → _private_/ModuleCluster}/ExtendForCascade.rb +0 -0
  37. data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +230 -0
  38. data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +238 -0
  39. data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +231 -0
  40. data/spec/ModuleCluster/Define/Block/Class_spec.rb +224 -0
  41. data/spec/ModuleCluster/Define/Block/Instance_spec.rb +78 -0
  42. data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +54 -0
  43. data/spec/ModuleCluster/Define/Block/Module_spec.rb +224 -0
  44. data/spec/ModuleCluster/Define/Block_spec.rb +18 -0
  45. data/spec/ModuleCluster/Define/ClassCluster_spec.rb +728 -0
  46. data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +576 -0
  47. data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +298 -60
  48. data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +307 -61
  49. data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +335 -36
  50. data/spec/ModuleCluster/Define/Cluster_spec.rb +447 -14
  51. data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +102 -0
  52. data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +728 -0
  53. data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +728 -0
  54. data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +576 -0
  55. data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +278 -0
  56. metadata +42 -13
  57. data/lib/module-cluster/ModuleCluster/CascadeFeatures.rb +0 -197
  58. data/lib/module-cluster/ModuleCluster/ClusterStack/Block/Class.rb +0 -36
  59. data/lib/module-cluster/ModuleCluster/ClusterStack/Block/Module.rb +0 -36
  60. data/lib/module-cluster/ModuleCluster/ClusterStack/Extends.rb +0 -29
  61. data/lib/module-cluster/ModuleCluster/ClusterStack/Includes.rb +0 -28
  62. data/lib/module-cluster/ModuleCluster/ClusterStack/PrependsExtends.rb +0 -28
  63. data/lib/module-cluster/ModuleCluster/ClusterStack/PrependsIncludes.rb +0 -28
  64. data/lib/module-cluster/ModuleCluster/Define/ClusterStack.rb +0 -26
@@ -0,0 +1,200 @@
1
+
2
+ module ModuleCluster::Define::ModuleCluster
3
+
4
+ include ModuleCluster::CascadeFeatures::ClusterStack
5
+
6
+ extend ModuleCluster::ExtendForCascade
7
+
8
+ ####################################
9
+ # self.should_include_or_extend? #
10
+ ####################################
11
+
12
+ def self.should_include_or_extend?( hooked_instance )
13
+ should_include_or_extend = false
14
+ if hooked_instance.is_a?( Module ) and ! hooked_instance.is_a?( Class )
15
+ should_include_or_extend = true
16
+ end
17
+ return should_include_or_extend
18
+ end
19
+
20
+ ##########################
21
+ # self.should_cascade? #
22
+ ##########################
23
+
24
+ def self.should_cascade?( hooked_instance )
25
+ return false
26
+ end
27
+
28
+ ##################################
29
+ # module_include_also_includes #
30
+ ##################################
31
+
32
+ def module_include_also_includes( *includes, & runtime_includes_block )
33
+ cluster_stack.module_include_includes( ModuleCluster::Define::Cluster, __method__, includes, runtime_includes_block )
34
+ return self
35
+ end
36
+
37
+ #################################
38
+ # module_include_also_extends #
39
+ #################################
40
+
41
+ def module_include_also_extends( *extends, & runtime_extends_block )
42
+ cluster_stack.module_include_extends( ModuleCluster::Define::Cluster, __method__, extends, runtime_extends_block )
43
+ return self
44
+ end
45
+
46
+ ##############################################
47
+ # module_include_also_includes_and_extends #
48
+ ##############################################
49
+
50
+ def module_include_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
51
+ module_include_also_includes( *includes_and_extends, & runtime_includes_and_extends_block )
52
+ module_include_also_extends( *includes_and_extends, & runtime_includes_and_extends_block )
53
+ return self
54
+ end
55
+
56
+ #################################
57
+ # module_extend_also_includes #
58
+ #################################
59
+
60
+ def module_extend_also_includes( *includes, & runtime_includes_block )
61
+ cluster_stack.module_extend_includes( ModuleCluster::Define::Cluster, __method__, includes, runtime_includes_block )
62
+ return self
63
+ end
64
+
65
+ ################################
66
+ # module_extend_also_extends #
67
+ ################################
68
+
69
+ def module_extend_also_extends( *extends, & runtime_extends_block )
70
+ cluster_stack.module_extend_extends( ModuleCluster::Define::Cluster, __method__, extends, runtime_extends_block )
71
+ return self
72
+ end
73
+
74
+ #############################################
75
+ # module_extend_also_includes_and_extends #
76
+ #############################################
77
+
78
+ def module_extend_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
79
+ module_extend_also_includes( *includes_and_extends, & runtime_includes_and_extends_block )
80
+ module_extend_also_extends( *includes_and_extends, & runtime_includes_and_extends_block )
81
+ return self
82
+ end
83
+
84
+ ######################################
85
+ # module_include_prepends_includes #
86
+ ######################################
87
+
88
+ def module_include_prepends_includes( *includes, & runtime_includes_block )
89
+ cluster_stack.module_include_prepends_includes( ModuleCluster::Define::Cluster, __method__, includes, runtime_includes_block )
90
+ return self
91
+ end
92
+
93
+ #####################################
94
+ # module_include_prepends_extends #
95
+ #####################################
96
+
97
+ def module_include_prepends_extends( *extends, & runtime_extends_block )
98
+ cluster_stack.module_include_prepends_extends( ModuleCluster::Define::Cluster, __method__, extends, runtime_extends_block )
99
+ return self
100
+ end
101
+
102
+ ##################################################
103
+ # module_include_prepends_includes_and_extends #
104
+ ##################################################
105
+
106
+ def module_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
107
+ module_include_prepends_includes( *includes_and_extends, & runtime_includes_and_extends_block )
108
+ module_include_prepends_extends( *includes_and_extends, & runtime_includes_and_extends_block )
109
+ return self
110
+ end
111
+
112
+ #####################################
113
+ # module_extend_prepends_includes #
114
+ #####################################
115
+
116
+ def module_extend_prepends_includes( *includes, & runtime_includes_block )
117
+ cluster_stack.module_extend_prepends_includes( ModuleCluster::Define::Cluster, __method__, includes, runtime_includes_block )
118
+ return self
119
+ end
120
+
121
+ ####################################
122
+ # module_extend_prepends_extends #
123
+ ####################################
124
+
125
+ def module_extend_prepends_extends( *extends, & runtime_extends_block )
126
+ cluster_stack.module_extend_prepends_extends( ModuleCluster::Define::Cluster, __method__, extends, runtime_extends_block )
127
+ return self
128
+ end
129
+
130
+ #################################################
131
+ # module_extend_prepends_includes_and_extends #
132
+ #################################################
133
+
134
+ def module_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
135
+ module_extend_prepends_includes( *includes_and_extends, & runtime_includes_and_extends_block )
136
+ module_extend_prepends_extends( *includes_and_extends, & runtime_includes_and_extends_block )
137
+ return self
138
+ end
139
+
140
+ ############################################
141
+ # module_include_or_extend_also_includes #
142
+ ############################################
143
+
144
+ def module_include_or_extend_also_includes( *includes, & runtime_includes_block )
145
+ module_include_also_includes( *includes, & runtime_includes_block )
146
+ module_extend_also_includes( *includes, & runtime_includes_block )
147
+ return self
148
+ end
149
+
150
+ ###########################################
151
+ # module_include_or_extend_also_extends #
152
+ ###########################################
153
+
154
+ def module_include_or_extend_also_extends( *extends, & runtime_extends_block )
155
+ module_include_also_extends( *extends, & runtime_extends_block )
156
+ module_extend_also_extends( *extends, & runtime_extends_block )
157
+ return self
158
+ end
159
+
160
+ ########################################################
161
+ # module_include_or_extend_also_includes_and_extends #
162
+ ########################################################
163
+
164
+ def module_include_or_extend_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
165
+ module_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
166
+ module_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
167
+ return self
168
+ end
169
+
170
+ ################################################
171
+ # module_include_or_extend_prepends_includes #
172
+ ################################################
173
+
174
+ def module_include_or_extend_prepends_includes( *includes, & runtime_includes_block )
175
+ module_include_prepends_includes( *includes, & runtime_includes_block )
176
+ module_extend_prepends_includes( *includes, & runtime_includes_block )
177
+ return self
178
+ end
179
+
180
+ ###############################################
181
+ # module_include_or_extend_prepends_extends #
182
+ ###############################################
183
+
184
+ def module_include_or_extend_prepends_extends( *extends, & runtime_extends_block )
185
+ module_include_prepends_extends( *extends, & runtime_extends_block )
186
+ module_extend_prepends_extends( *extends, & runtime_extends_block )
187
+ return self
188
+ end
189
+
190
+ ############################################################
191
+ # module_include_or_extend_prepends_includes_and_extends #
192
+ ############################################################
193
+
194
+ def module_include_or_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
195
+ module_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
196
+ module_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
197
+ return self
198
+ end
199
+
200
+ end
@@ -0,0 +1,208 @@
1
+
2
+ module ModuleCluster::Define::ModuleOrClassCluster
3
+
4
+ include ModuleCluster::CascadeFeatures::ClusterStack
5
+
6
+ extend ModuleCluster::ExtendForCascade
7
+
8
+ ####################################
9
+ # self.should_include_or_extend? #
10
+ ####################################
11
+
12
+ def self.should_include_or_extend?( class_or_module_or_instance )
13
+ should_include_or_extend = false
14
+ if class_or_module_or_instance.is_a?( Module )
15
+ should_include_or_extend = true
16
+ end
17
+ return should_include_or_extend
18
+ end
19
+
20
+ ##########################
21
+ # self.should_cascade? #
22
+ ##########################
23
+
24
+ def self.should_cascade?( class_or_module_or_instance )
25
+ return false
26
+ end
27
+
28
+ ###########################################
29
+ # module_or_class_include_also_includes #
30
+ ###########################################
31
+
32
+ def module_or_class_include_also_includes( *includes, & runtime_includes_block )
33
+ cluster_stack.module_include_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
34
+ cluster_stack.class_include_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
35
+ return self
36
+ end
37
+
38
+ ##########################################
39
+ # module_or_class_include_also_extends #
40
+ ##########################################
41
+
42
+ def module_or_class_include_also_extends( *extends, & runtime_extends_block )
43
+ cluster_stack.module_include_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
44
+ cluster_stack.class_include_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
45
+ return self
46
+ end
47
+
48
+ #######################################################
49
+ # module_or_class_include_also_includes_and_extends #
50
+ #######################################################
51
+
52
+ def module_or_class_include_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
53
+ cluster_stack.module_include_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
54
+ cluster_stack.class_include_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
55
+ return self
56
+ end
57
+
58
+ ##########################################
59
+ # module_or_class_extend_also_includes #
60
+ ##########################################
61
+
62
+ def module_or_class_extend_also_includes( *includes, & runtime_includes_block )
63
+ cluster_stack.module_extend_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
64
+ cluster_stack.class_extend_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
65
+ return self
66
+ end
67
+
68
+ #########################################
69
+ # module_or_class_extend_also_extends #
70
+ #########################################
71
+
72
+ def module_or_class_extend_also_extends( *extends, & runtime_extends_block )
73
+ cluster_stack.module_extend_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
74
+ cluster_stack.class_extend_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
75
+ return self
76
+ end
77
+
78
+ ######################################################
79
+ # module_or_class_extend_also_includes_and_extends #
80
+ ######################################################
81
+
82
+ def module_or_class_extend_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
83
+ cluster_stack.module_extend_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
84
+ cluster_stack.class_extend_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
85
+ return self
86
+ end
87
+
88
+ ###############################################
89
+ # module_or_class_include_prepends_includes #
90
+ ###############################################
91
+
92
+ def module_or_class_include_prepends_includes( *includes, & runtime_includes_block )
93
+ cluster_stack.module_include_prepends_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
94
+ cluster_stack.class_include_prepends_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
95
+ return self
96
+ end
97
+
98
+ ##############################################
99
+ # module_or_class_include_prepends_extends #
100
+ ##############################################
101
+
102
+ def module_or_class_include_prepends_extends( *extends, & runtime_extends_block )
103
+ cluster_stack.module_include_prepends_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
104
+ cluster_stack.class_include_prepends_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
105
+ return self
106
+ end
107
+
108
+ ###########################################################
109
+ # module_or_class_include_prepends_includes_and_extends #
110
+ ###########################################################
111
+
112
+ def module_or_class_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
113
+ cluster_stack.module_include_prepends_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
114
+ cluster_stack.class_include_prepends_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
115
+ return self
116
+ end
117
+
118
+ ##############################################
119
+ # module_or_class_extend_prepends_includes #
120
+ ##############################################
121
+
122
+ def module_or_class_extend_prepends_includes( *includes, & runtime_includes_block )
123
+ cluster_stack.module_extend_prepends_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
124
+ cluster_stack.class_extend_prepends_includes( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes, runtime_includes_block )
125
+ return self
126
+ end
127
+
128
+ #############################################
129
+ # module_or_class_extend_prepends_extends #
130
+ #############################################
131
+
132
+ def module_or_class_extend_prepends_extends( *extends, & runtime_extends_block )
133
+ cluster_stack.module_extend_prepends_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
134
+ cluster_stack.class_extend_prepends_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, extends, runtime_extends_block )
135
+ return self
136
+ end
137
+
138
+ ##########################################################
139
+ # module_or_class_extend_prepends_includes_and_extends #
140
+ ##########################################################
141
+
142
+ def module_or_class_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
143
+ cluster_stack.module_extend_prepends_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
144
+ cluster_stack.class_extend_prepends_includes_and_extends( ModuleCluster::Define::ModuleOrClassCluster, __method__, includes_and_extends, runtime_includes_and_extends_block )
145
+ return self
146
+ end
147
+
148
+ #####################################################
149
+ # module_or_class_include_or_extend_also_includes #
150
+ #####################################################
151
+
152
+ def module_or_class_include_or_extend_also_includes( *includes, & runtime_includes_block )
153
+ module_or_class_include_also_includes( *includes, & runtime_includes_block )
154
+ module_or_class_extend_also_includes( *includes, & runtime_includes_block )
155
+ return self
156
+ end
157
+
158
+ ####################################################
159
+ # module_or_class_include_or_extend_also_extends #
160
+ ####################################################
161
+
162
+ def module_or_class_include_or_extend_also_extends( *extends, & runtime_extends_block )
163
+ module_or_class_include_also_extends( *extends, & runtime_extends_block )
164
+ module_or_class_extend_also_extends( *extends, & runtime_extends_block )
165
+ return self
166
+ end
167
+
168
+ #################################################################
169
+ # module_or_class_include_or_extend_also_includes_and_extends #
170
+ #################################################################
171
+
172
+ def module_or_class_include_or_extend_also_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
173
+ module_or_class_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
174
+ module_or_class_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
175
+ return self
176
+ end
177
+
178
+ #########################################################
179
+ # module_or_class_include_or_extend_prepends_includes #
180
+ #########################################################
181
+
182
+ def module_or_class_include_or_extend_prepends_includes( *includes, & runtime_includes_block )
183
+ module_or_class_include_prepends_includes( *includes, & runtime_includes_block )
184
+ module_or_class_extend_prepends_includes( *includes, & runtime_includes_block )
185
+ return self
186
+ end
187
+
188
+ ########################################################
189
+ # module_or_class_include_or_extend_prepends_extends #
190
+ ########################################################
191
+
192
+ def module_or_class_include_or_extend_prepends_extends( *extends, & runtime_extends_block )
193
+ module_or_class_include_prepends_extends( *extends, & runtime_extends_block )
194
+ module_or_class_extend_prepends_extends( *extends, & runtime_extends_block )
195
+ return self
196
+ end
197
+
198
+ #####################################################################
199
+ # module_or_class_include_or_extend_prepends_includes_and_extends #
200
+ #####################################################################
201
+
202
+ def module_or_class_include_or_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
203
+ module_or_class_include_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
204
+ module_or_class_extend_prepends_includes_and_extends( *includes_and_extends, & runtime_includes_and_extends_block )
205
+ return self
206
+ end
207
+
208
+ end
@@ -0,0 +1,127 @@
1
+
2
+ module ModuleCluster::Define::ModuleOrInstanceCluster
3
+
4
+ include ModuleCluster::CascadeFeatures::ClusterStack
5
+
6
+ extend ModuleCluster::ExtendForCascade
7
+
8
+ ####################################
9
+ # self.should_include_or_extend? #
10
+ ####################################
11
+
12
+ def self.should_include_or_extend?( class_or_module_or_instance )
13
+ return ! class_or_module_or_instance.is_a?( Class )
14
+ end
15
+
16
+ ##########################
17
+ # self.should_cascade? #
18
+ ##########################
19
+
20
+ def self.should_cascade?( class_or_module_or_instance )
21
+ return false
22
+ end
23
+
24
+ ##########################################################################
25
+ # module_include_or_extend_or_instance_extend_also_includes_or_extends #
26
+ ##########################################################################
27
+
28
+ def module_include_or_extend_or_instance_extend_also_includes_or_extends( *includes_or_extends, & runtime_includes_or_extends_block )
29
+ cluster_stack.module_include_includes( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
30
+ cluster_stack.module_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
31
+ cluster_stack.instance_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
32
+ return self
33
+ end
34
+
35
+ ##############################################################
36
+ # module_include_or_extend_or_instance_extend_also_extends #
37
+ ##############################################################
38
+
39
+ def module_include_or_extend_or_instance_extend_also_extends( *includes_or_extends, & runtime_includes_or_extends_block )
40
+ cluster_stack.module_include_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
41
+ cluster_stack.module_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
42
+ cluster_stack.instance_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
43
+ return self
44
+ end
45
+
46
+ ################################################################
47
+ # module_include_or_instance_extend_also_includes_or_extends #
48
+ ################################################################
49
+
50
+ def module_include_or_instance_extend_also_includes_or_extends( *includes_or_extends, & runtime_includes_or_extends_block )
51
+ cluster_stack.module_include_includes( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
52
+ cluster_stack.instance_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
53
+ return self
54
+ end
55
+
56
+ ####################################################
57
+ # module_include_or_instance_extend_also_extends #
58
+ ####################################################
59
+
60
+ def module_include_or_instance_extend_also_extends( *extends, & runtime_extends_block )
61
+ cluster_stack.module_include_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
62
+ cluster_stack.instance_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
63
+ return self
64
+ end
65
+
66
+ ############################################
67
+ # module_or_instance_extend_also_extends #
68
+ ############################################
69
+
70
+ def module_or_instance_extend_also_extends( *extends, & runtime_extends_block )
71
+ cluster_stack.module_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
72
+ cluster_stack.instance_extend_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
73
+ return self
74
+ end
75
+
76
+ ##############################################################################
77
+ # module_include_or_extend_or_instance_extend_prepends_includes_or_extends #
78
+ ##############################################################################
79
+
80
+ def module_include_or_extend_or_instance_extend_prepends_includes_or_extends( *includes_or_extends, & runtime_includes_or_extends_block )
81
+ cluster_stack.module_include_prepends_includes( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
82
+ cluster_stack.module_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
83
+ cluster_stack.instance_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
84
+ return self
85
+ end
86
+
87
+ ####################################################################
88
+ # module_include_or_instance_extend_prepends_includes_or_extends #
89
+ ####################################################################
90
+
91
+ def module_include_or_instance_extend_prepends_includes_or_extends( *includes_or_extends, & runtime_includes_or_extends_block )
92
+ cluster_stack.module_include_prepends_includes( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
93
+ cluster_stack.instance_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
94
+ return self
95
+ end
96
+
97
+ ##################################################################
98
+ # module_include_or_extend_or_instance_extend_prepends_extends #
99
+ ##################################################################
100
+
101
+ def module_include_or_extend_or_instance_extend_prepends_extends( *includes_or_extends, & runtime_includes_or_extends_block )
102
+ cluster_stack.module_include_prepends_includes( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
103
+ cluster_stack.instance_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, includes_or_extends, runtime_includes_or_extends_block )
104
+ return self
105
+ end
106
+
107
+ ########################################################
108
+ # module_include_or_instance_extend_prepends_extends #
109
+ ########################################################
110
+
111
+ def module_include_or_instance_extend_prepends_extends( *extends, & runtime_extends_block )
112
+ cluster_stack.module_include_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
113
+ cluster_stack.instance_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
114
+ return self
115
+ end
116
+
117
+ ################################################
118
+ # module_or_instance_extend_prepends_extends #
119
+ ################################################
120
+
121
+ def module_or_instance_extend_prepends_extends( *extends, & runtime_extends_block )
122
+ cluster_stack.module_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
123
+ cluster_stack.instance_extend_prepends_extends( ModuleCluster::Define::ModuleOrInstanceCluster, __method__, extends, runtime_extends_block )
124
+ return self
125
+ end
126
+
127
+ end