module-cluster 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+
2
+ module ModuleCluster::Define
3
+
4
+ include Block
5
+ include Cluster
6
+ include ClusterCascades
7
+ include ClusterCascadesToClass
8
+ include ClusterCascadesToModule
9
+
10
+ include Deprecated
11
+
12
+ end
@@ -0,0 +1,106 @@
1
+
2
+ module ModuleCluster::Define::Status
3
+
4
+ ###################
5
+ # include_hooks #
6
+ ###################
7
+
8
+ def include_hooks
9
+ return cluster_stack.include_hooks
10
+ end
11
+
12
+ ##################
13
+ # extend_hooks #
14
+ ##################
15
+
16
+ def extend_hooks
17
+ return cluster_stack.extend_hooks
18
+ end
19
+
20
+ ##############################
21
+ # prepend_include_hooks #
22
+ ##############################
23
+
24
+ def prepend_include_hooks
25
+ return cluster_stack.prepend_include_hooks
26
+ end
27
+
28
+ #############################
29
+ # prepend_extend_hooks #
30
+ #############################
31
+
32
+ def prepend_extend_hooks
33
+ return cluster_stack.prepend_extend_hooks
34
+ end
35
+
36
+ #######################
37
+ # all_include_hooks #
38
+ #######################
39
+
40
+ def all_include_hooks
41
+ return cluster_stack.prepend_include_hooks.dup.concat( cluster_stack.include_hooks )
42
+ end
43
+
44
+ ######################
45
+ # all_extend_hooks #
46
+ ######################
47
+
48
+ def all_extend_hooks
49
+ return cluster_stack.prepend_extend_hooks.dup.concat( cluster_stack.extend_hooks )
50
+ end
51
+
52
+ #######################
53
+ # has_include_hook? #
54
+ #######################
55
+
56
+ def has_include_hook?( *modules )
57
+ return cluster_stack.has_hook?( cluster_stack.include_hooks, *modules )
58
+ end
59
+ alias_method :has_include_hooks?, :has_include_hook?
60
+
61
+ ######################
62
+ # has_extend_hook? #
63
+ ######################
64
+
65
+ def has_extend_hook?( *modules )
66
+ return cluster_stack.has_hook?( cluster_stack.extend_hooks, *modules )
67
+ end
68
+ alias_method :has_extend_hooks?, :has_extend_hook?
69
+
70
+ ###############################
71
+ # has_prepend_include_hook? #
72
+ ###############################
73
+
74
+ def has_prepend_include_hook?( *modules )
75
+ return cluster_stack.has_hook?( cluster_stack.prepend_include_hooks, *modules )
76
+ end
77
+ alias_method :has_prepend_include_hooks?, :has_prepend_include_hook?
78
+
79
+ ##############################
80
+ # has_prepend_extend_hook? #
81
+ ##############################
82
+
83
+ def has_prepend_extend_hook?( *modules )
84
+ return cluster_stack.has_hook?( cluster_stack.prepend_extend_hooks, *modules )
85
+ end
86
+ alias_method :has_prepend_extend_hooks?, :has_prepend_extend_hook?
87
+
88
+ ###########################
89
+ # has_any_include_hook? #
90
+ ###########################
91
+
92
+ def has_any_include_hook?( *modules )
93
+ return has_prepend_include_hook?( *modules ) || has_include_hook?( *modules )
94
+ end
95
+ alias_method :has_any_include_hooks?, :has_any_include_hook?
96
+
97
+ ##########################
98
+ # has_any_extend_hook? #
99
+ ##########################
100
+
101
+ def has_any_extend_hook?( *modules )
102
+ return has_prepend_extend_hook?( *modules ) || has_extend_hook?( *modules )
103
+ end
104
+ alias_method :has_any_extend_hooks?, :has_any_extend_hook?
105
+
106
+ end
@@ -0,0 +1,7 @@
1
+
2
+ module ModuleCluster::Suspend
3
+
4
+ include Hooks
5
+ include WithoutHooks
6
+
7
+ end
@@ -0,0 +1,315 @@
1
+
2
+ module ModuleCluster::Suspend::Hooks
3
+
4
+ #######################
5
+ # suspend_any_hooks #
6
+ #######################
7
+
8
+ def suspend_any_hooks( description = nil )
9
+ if description
10
+ # we don't want to end up unsuspending any sets that were already suspended
11
+ # so we add to the description only sets that are not suspended
12
+ description[ :suspended ] = false
13
+ sets = cluster_stack.all_hooks.hooks_with( description )
14
+ sets.suspend
15
+ return_sets = sets
16
+ else
17
+ cluster_stack.suspend_any_hooks
18
+ return_sets = cluster_stack.all_hooks
19
+ end
20
+ return return_sets
21
+ end
22
+
23
+ ###############################
24
+ # suspend_any_include_hooks #
25
+ ###############################
26
+
27
+ def suspend_any_include_hooks( description = nil )
28
+ if description
29
+ # we don't want to end up unsuspending any sets that were already suspended
30
+ # so we add to the description only sets that are not suspended
31
+ description[ :suspended ] = false
32
+ sets = cluster_stack.all_include_hooks.hooks_with( description )
33
+ sets.suspend
34
+ return_sets = sets
35
+ else
36
+ cluster_stack.suspend_any_include_hooks
37
+ return_sets = cluster_stack.all_include_hooks
38
+ end
39
+ return return_sets
40
+ end
41
+
42
+ ##############################
43
+ # suspend_any_extend_hooks #
44
+ ##############################
45
+
46
+ def suspend_any_extend_hooks( description = nil )
47
+ if description
48
+ # we don't want to end up unsuspending any sets that were already suspended
49
+ # so we add to the description only sets that are not suspended
50
+ description[ :suspended ] = false
51
+ sets = cluster_stack.all_extend_hooks.hooks_with( description )
52
+ sets.suspend
53
+ return_sets = sets
54
+ else
55
+ cluster_stack.suspend_any_extend_hooks
56
+ return_sets = cluster_stack.all_extend_hooks
57
+ end
58
+ return return_sets
59
+ end
60
+
61
+ ###########################
62
+ # suspend_include_hooks #
63
+ ###########################
64
+
65
+ def suspend_include_hooks( description = nil )
66
+ if description
67
+ # we don't want to end up unsuspending any sets that were already suspended
68
+ # so we add to the description only sets that are not suspended
69
+ description[ :suspended ] = false
70
+ sets = cluster_stack.include_hooks.hooks_with( description )
71
+ sets.suspend
72
+ return_sets = sets
73
+ else
74
+ cluster_stack.suspend_include_hooks
75
+ return_sets = cluster_stack.include_hooks
76
+ end
77
+ return return_sets
78
+ end
79
+
80
+ ##########################
81
+ # suspend_extend_hooks #
82
+ ##########################
83
+
84
+ def suspend_extend_hooks( description = nil )
85
+ if description
86
+ # we don't want to end up unsuspending any sets that were already suspended
87
+ # so we add to the description only sets that are not suspended
88
+ description[ :suspended ] = false
89
+ sets = cluster_stack.extend_hooks.hooks_with( description )
90
+ sets.suspend
91
+ return_sets = sets
92
+ else
93
+ cluster_stack.suspend_extend_hooks
94
+ return_sets = cluster_stack.extend_hooks
95
+ end
96
+ return return_sets
97
+ end
98
+
99
+ ###################################
100
+ # suspend_prepend_include_hooks #
101
+ ###################################
102
+
103
+ def suspend_prepend_include_hooks( description = nil )
104
+ if description
105
+ # we don't want to end up unsuspending any sets that were already suspended
106
+ # so we add to the description only sets that are not suspended
107
+ description[ :suspended ] = false
108
+ sets = cluster_stack.prepend_include_hooks.hooks_with( description )
109
+ sets.suspend
110
+ return_sets = sets
111
+ else
112
+ cluster_stack.suspend_prepend_include_hooks
113
+ return_sets = cluster_stack.prepend_include_hooks
114
+ end
115
+ return return_sets
116
+ end
117
+
118
+ ##################################
119
+ # suspend_prepend_extend_hooks #
120
+ ##################################
121
+
122
+ def suspend_prepend_extend_hooks( description = nil )
123
+ if description
124
+ # we don't want to end up unsuspending any sets that were already suspended
125
+ # so we add to the description only sets that are not suspended
126
+ description[ :suspended ] = false
127
+ sets = cluster_stack.prepend_extend_hooks.hooks_with( description )
128
+ sets.suspend
129
+ return_sets = sets
130
+ else
131
+ cluster_stack.suspend_prepend_extend_hooks
132
+ return_sets = cluster_stack.prepend_extend_hooks
133
+ end
134
+ return return_sets
135
+ end
136
+
137
+ ######################
138
+ # hooks_suspended? #
139
+ ######################
140
+
141
+ def hooks_suspended?( action )
142
+ return cluster_stack.hooks_suspended?( action )
143
+ end
144
+
145
+ ##########################
146
+ # all_hooks_suspended? #
147
+ ##########################
148
+
149
+ def all_hooks_suspended?
150
+ return cluster_stack.all_hooks_suspended?
151
+ end
152
+
153
+ ##################################
154
+ # all_include_hooks_suspended? #
155
+ ##################################
156
+
157
+ def all_include_hooks_suspended?
158
+ return cluster_stack.all_include_hooks_suspended?
159
+ end
160
+
161
+ #################################
162
+ # all_extend_hooks_suspended? #
163
+ #################################
164
+
165
+ def all_extend_hooks_suspended?
166
+ return cluster_stack.all_extend_hooks_suspended?
167
+ end
168
+
169
+ ##############################
170
+ # include_hooks_suspended? #
171
+ ##############################
172
+
173
+ def include_hooks_suspended?
174
+ return cluster_stack.include_hooks_suspended?
175
+ end
176
+
177
+ #############################
178
+ # extend_hooks_suspended? #
179
+ #############################
180
+
181
+ def extend_hooks_suspended?
182
+ return cluster_stack.extend_hooks_suspended?
183
+ end
184
+
185
+ ######################################
186
+ # prepend_include_hooks_suspended? #
187
+ ######################################
188
+
189
+ def prepend_include_hooks_suspended?
190
+ return cluster_stack.prepend_include_hooks_suspended?
191
+ end
192
+
193
+ #####################################
194
+ # prepend_extend_hooks_suspended? #
195
+ #####################################
196
+
197
+ def prepend_extend_hooks_suspended?
198
+ return cluster_stack.prepend_extend_hooks_suspended?
199
+ end
200
+
201
+ ######################
202
+ # resume_any_hooks #
203
+ ######################
204
+
205
+ def resume_any_hooks( description = nil )
206
+ if description
207
+ sets = cluster_stack.all_hooks.hooks_with( description )
208
+ sets.resume
209
+ return_sets = sets
210
+ else
211
+ cluster_stack.resume_any_hooks
212
+ return_sets = cluster_stack.all_hooks
213
+ end
214
+ return return_sets
215
+ end
216
+
217
+ ##############################
218
+ # resume_any_include_hooks #
219
+ ##############################
220
+
221
+ def resume_any_include_hooks( description = nil )
222
+ if description
223
+ sets = cluster_stack.all_include_hooks.hooks_with( description )
224
+ sets.resume
225
+ return_sets = sets
226
+ else
227
+ cluster_stack.resume_any_include_hooks
228
+ return_sets = cluster_stack.all_include_hooks
229
+ end
230
+ return return_sets
231
+ end
232
+
233
+ #############################
234
+ # resume_any_extend_hooks #
235
+ #############################
236
+
237
+ def resume_any_extend_hooks( description = nil )
238
+ if description
239
+ sets = cluster_stack.all_extend_hooks.hooks_with( description )
240
+ sets.resume
241
+ return_sets = sets
242
+ else
243
+ cluster_stack.resume_any_extend_hooks
244
+ return_sets = cluster_stack.all_extend_hooks
245
+ end
246
+ return return_sets
247
+ end
248
+
249
+ ##########################
250
+ # resume_include_hooks #
251
+ ##########################
252
+
253
+ def resume_include_hooks( description = nil )
254
+ if description
255
+ sets = cluster_stack.include_hooks.hooks_with( description )
256
+ sets.resume
257
+ return_sets = sets
258
+ else
259
+ cluster_stack.resume_include_hooks
260
+ return_sets = cluster_stack.include_hooks
261
+ end
262
+ return return_sets
263
+ end
264
+
265
+ #########################
266
+ # resume_extend_hooks #
267
+ #########################
268
+
269
+ def resume_extend_hooks( description = nil )
270
+ if description
271
+ sets = cluster_stack.extend_hooks.hooks_with( description )
272
+ sets.resume
273
+ return_sets = sets
274
+ else
275
+ cluster_stack.resume_extend_hooks
276
+ return_sets = cluster_stack.extend_hooks
277
+ end
278
+ return return_sets
279
+ end
280
+
281
+ ##################################
282
+ # resume_prepend_include_hooks #
283
+ ##################################
284
+
285
+ def resume_prepend_include_hooks( description = nil )
286
+ if description
287
+ sets = cluster_stack.prepend_include_hooks.hooks_with( description )
288
+ sets.resume
289
+ return_sets = sets
290
+ else
291
+ cluster_stack.resume_prepend_include_hooks
292
+ return_sets = cluster_stack.prepend_include_hooks
293
+ end
294
+ return return_sets
295
+ end
296
+
297
+ #################################
298
+ # resume_prepend_extend_hooks #
299
+ #################################
300
+
301
+ def resume_prepend_extend_hooks( description = nil )
302
+ if description
303
+ sets = cluster_stack.prepend_extend_hooks.hooks_with( description )
304
+ sets.resume
305
+ return_sets = sets
306
+ else
307
+ cluster_stack.resume_prepend_extend_hooks
308
+ return_sets = cluster_stack.prepend_extend_hooks
309
+ end
310
+ return return_sets
311
+ end
312
+
313
+
314
+
315
+ end
@@ -0,0 +1,153 @@
1
+
2
+ module ModuleCluster::Suspend::WithoutHooks
3
+
4
+ include ModuleCluster::Suspend::Hooks
5
+
6
+ #######################
7
+ # without_any_hooks #
8
+ #######################
9
+
10
+ def without_any_hooks( description = nil )
11
+ if description
12
+ # we don't want to end up unsuspending any sets that were already suspended
13
+ # so we add to the description only sets that are not suspended
14
+ description[ :suspended ] = false
15
+ sets = cluster_stack.all_hooks.hooks_with( description )
16
+ sets.suspend
17
+ yield
18
+ sets.resume
19
+ else
20
+ cluster_stack.suspend_any_hooks
21
+ yield
22
+ cluster_stack.resume_any_hooks
23
+ end
24
+ return self
25
+ end
26
+
27
+ ###############################
28
+ # without_any_include_hooks #
29
+ ###############################
30
+
31
+ def without_any_include_hooks( description = nil )
32
+ if description
33
+ # we don't want to end up unsuspending any sets that were already suspended
34
+ # so we add to the description only sets that are not suspended
35
+ description[ :suspended ] = false
36
+ sets = cluster_stack.all_include_hooks.hooks_with( description )
37
+ sets.suspend
38
+ yield
39
+ sets.resume
40
+ else
41
+ cluster_stack.suspend_any_include_hooks
42
+ yield
43
+ cluster_stack.resume_any_include_hooks
44
+ end
45
+ return self
46
+ end
47
+
48
+ ##############################
49
+ # without_any_extend_hooks #
50
+ ##############################
51
+
52
+ def without_any_extend_hooks( description = nil )
53
+ if description
54
+ # we don't want to end up unsuspending any sets that were already suspended
55
+ # so we add to the description only sets that are not suspended
56
+ description[ :suspended ] = false
57
+ sets = cluster_stack.all_extend_hooks.hooks_with( description )
58
+ sets.suspend
59
+ yield
60
+ sets.resume
61
+ else
62
+ cluster_stack.suspend_any_extend_hooks
63
+ yield
64
+ cluster_stack.resume_any_extend_hooks
65
+ end
66
+ return self
67
+ end
68
+
69
+ ###########################
70
+ # without_include_hooks #
71
+ ###########################
72
+
73
+ def without_include_hooks( description = nil )
74
+ if description
75
+ # we don't want to end up unsuspending any sets that were already suspended
76
+ # so we add to the description only sets that are not suspended
77
+ description[ :suspended ] = false
78
+ sets = cluster_stack.include_hooks.hooks_with( description )
79
+ sets.suspend
80
+ yield
81
+ sets.resume
82
+ else
83
+ cluster_stack.suspend_include_hooks
84
+ yield
85
+ cluster_stack.resume_include_hooks
86
+ end
87
+ return self
88
+ end
89
+
90
+ ##########################
91
+ # without_extend_hooks #
92
+ ##########################
93
+
94
+ def without_extend_hooks( description = nil )
95
+ if description
96
+ # we don't want to end up unsuspending any sets that were already suspended
97
+ # so we add to the description only sets that are not suspended
98
+ description[ :suspended ] = false
99
+ sets = cluster_stack.extend_hooks.hooks_with( description )
100
+ sets.suspend
101
+ yield
102
+ sets.resume
103
+ else
104
+ cluster_stack.suspend_extend_hooks
105
+ yield
106
+ cluster_stack.resume_extend_hooks
107
+ end
108
+ return self
109
+ end
110
+
111
+ ###################################
112
+ # without_prepend_include_hooks #
113
+ ###################################
114
+
115
+ def without_prepend_include_hooks( description = nil )
116
+ if description
117
+ # we don't want to end up unsuspending any sets that were already suspended
118
+ # so we add to the description only sets that are not suspended
119
+ description[ :suspended ] = false
120
+ sets = cluster_stack.prepend_include_hooks.hooks_with( description )
121
+ sets.suspend
122
+ yield
123
+ sets.resume
124
+ else
125
+ cluster_stack.suspend_prepend_include_hooks
126
+ yield
127
+ cluster_stack.resume_prepend_include_hooks
128
+ end
129
+ return self
130
+ end
131
+
132
+ ##################################
133
+ # without_prepend_extend_hooks #
134
+ ##################################
135
+
136
+ def without_prepend_extend_hooks( description = nil )
137
+ if description
138
+ # we don't want to end up unsuspending any sets that were already suspended
139
+ # so we add to the description only sets that are not suspended
140
+ description[ :suspended ] = false
141
+ sets = cluster_stack.prepend_extend_hooks.hooks_with( description )
142
+ sets.suspend
143
+ yield
144
+ sets.resume
145
+ else
146
+ cluster_stack.suspend_prepend_extend_hooks
147
+ yield
148
+ cluster_stack.resume_prepend_extend_hooks
149
+ end
150
+ return self
151
+ end
152
+
153
+ end