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.
- data/README.md +127 -337
- data/lib/module-cluster.rb +1 -153
- data/lib/module/cluster.rb +341 -0
- data/lib/module/cluster/class_support.rb +22 -0
- data/lib/module/cluster/cluster.rb +10 -0
- data/lib/module/cluster/cluster/cluster_interface.rb +550 -0
- data/lib/module/cluster/exception/module_not_in_stack.rb +26 -0
- data/lib/module/cluster/instance_controller.rb +14 -0
- data/lib/module/cluster/instance_controller/hook_controller.rb +33 -0
- data/lib/module/cluster/instance_controller/hook_controller/chain_proxy.rb +511 -0
- data/lib/module/cluster/instance_controller/hook_controller/hook_controller_interface.rb +830 -0
- data/lib/module/cluster/instance_controller/instance_controller_interface.rb +269 -0
- data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy.rb +359 -0
- data/lib/module/cluster/instance_controller/multiple_hook_controller_proxy/chain_proxy.rb +442 -0
- data/lib/module/cluster/module_support.rb +67 -0
- data/lib/module/namespaces.rb +13 -0
- data/lib/module/requires.rb +32 -0
- data/spec/module/cluster/cluster_spec.rb +473 -0
- data/spec/module/cluster/instance_controller/hook_controller_spec.rb +922 -0
- data/spec/module/cluster/instance_controller/multiple_hook_controller_proxy_spec.rb +1240 -0
- data/spec/module/cluster_spec.rb +1794 -0
- metadata +27 -98
- data/README.rdoc +0 -395
- data/lib/module-cluster/ModuleCluster.rb +0 -9
- data/lib/module-cluster/ModuleCluster/Define.rb +0 -12
- data/lib/module-cluster/ModuleCluster/Define/Block.rb +0 -9
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +0 -83
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +0 -70
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +0 -79
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +0 -21
- data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +0 -77
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +0 -78
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +0 -78
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +0 -78
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +0 -36
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +0 -29
- data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +0 -45
- data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +0 -77
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +0 -78
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +0 -29
- data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +0 -56
- data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +0 -193
- data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +0 -128
- data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +0 -181
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +0 -185
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +0 -181
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +0 -181
- data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +0 -40
- data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +0 -45
- data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +0 -193
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +0 -209
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +0 -128
- data/lib/module-cluster/ModuleCluster/Define/Status.rb +0 -106
- data/lib/module-cluster/ModuleCluster/Suspend.rb +0 -7
- data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +0 -315
- data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +0 -153
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +0 -77
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +0 -44
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +0 -292
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +0 -24
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +0 -12
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +0 -9
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +0 -36
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +0 -20
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +0 -20
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +0 -36
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +0 -6
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +0 -140
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +0 -110
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +0 -140
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +0 -110
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set.rb +0 -35
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +0 -359
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +0 -55
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +0 -199
- data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +0 -34
- data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +0 -285
- data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +0 -254
- data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +0 -56
- data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +0 -278
- data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +0 -230
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +0 -238
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +0 -54
- data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +0 -231
- data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +0 -54
- data/spec/ModuleCluster/Define/Block/Class_spec.rb +0 -224
- data/spec/ModuleCluster/Define/Block/Instance_spec.rb +0 -78
- data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +0 -54
- data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +0 -51
- data/spec/ModuleCluster/Define/Block/Module_spec.rb +0 -230
- data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +0 -73
- data/spec/ModuleCluster/Define/Block_spec.rb +0 -18
- data/spec/ModuleCluster/Define/ClassCluster_spec.rb +0 -728
- data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +0 -576
- data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +0 -659
- data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +0 -678
- data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +0 -644
- data/spec/ModuleCluster/Define/Cluster_spec.rb +0 -708
- data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +0 -102
- data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +0 -728
- data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +0 -728
- data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +0 -576
- data/spec/ModuleCluster/Suspend/Hooks_spec.rb +0 -573
- data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +0 -559
- data/spec/ModuleCluster_spec.rb +0 -15
- data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +0 -386
- data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +0 -419
- 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,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,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
|