module-cluster 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +43 -9
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascades.rb +58 -8
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToClass.rb +74 -8
- data/lib/module-cluster/ModuleCluster/Define/ModuleClusterCascadesToModule.rb +74 -8
- data/lib/module-cluster/ModuleCluster/Define/_private_/AnonymousModule.rb +121 -0
- data/lib/module-cluster/ModuleCluster/Define/_private_/ClusterStack.rb +15 -2
- data/lib/module-cluster.rb +6 -6
- metadata +3 -10
- data/lib/module-cluster/ModuleCluster/Define/_private_/ModuleCluster.rb +0 -110
- data/lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascades.rb +0 -118
- data/lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass.rb +0 -126
- data/lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule.rb +0 -126
- data/spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass_spec.rb +0 -249
- data/spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule_spec.rb +0 -266
- data/spec/ModuleCluster/Define/_private_/ModuleClusterCascades_spec.rb +0 -223
- data/spec/ModuleCluster/Define/_private_/ModuleCluster_spec.rb +0 -168
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 3
|
9
|
+
version: 1.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Asher
|
@@ -27,11 +27,8 @@ extensions: []
|
|
27
27
|
extra_rdoc_files: []
|
28
28
|
|
29
29
|
files:
|
30
|
+
- lib/module-cluster/ModuleCluster/Define/_private_/AnonymousModule.rb
|
30
31
|
- lib/module-cluster/ModuleCluster/Define/_private_/ClusterStack.rb
|
31
|
-
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleCluster.rb
|
32
|
-
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascades.rb
|
33
|
-
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass.rb
|
34
|
-
- lib/module-cluster/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule.rb
|
35
32
|
- lib/module-cluster/ModuleCluster/Define/Deprecated.rb
|
36
33
|
- lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb
|
37
34
|
- lib/module-cluster/ModuleCluster/Define/ModuleClusterCascades.rb
|
@@ -40,10 +37,6 @@ files:
|
|
40
37
|
- lib/module-cluster/ModuleCluster.rb
|
41
38
|
- lib/module-cluster.rb
|
42
39
|
- spec/ModuleCluster/Define/_private_/ClusterStack_spec.rb
|
43
|
-
- spec/ModuleCluster/Define/_private_/ModuleCluster_spec.rb
|
44
|
-
- spec/ModuleCluster/Define/_private_/ModuleClusterCascades_spec.rb
|
45
|
-
- spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToClass_spec.rb
|
46
|
-
- spec/ModuleCluster/Define/_private_/ModuleClusterCascadesToModule_spec.rb
|
47
40
|
- spec/ModuleCluster/Define/ModuleCluster_spec.rb
|
48
41
|
- spec/ModuleCluster/Define/ModuleClusterCascades_spec.rb
|
49
42
|
- spec/ModuleCluster/Define/ModuleClusterCascadesToClass_spec.rb
|
@@ -1,110 +0,0 @@
|
|
1
|
-
|
2
|
-
module ModuleCluster::Define::ModuleCluster
|
3
|
-
|
4
|
-
###########################################################################################################
|
5
|
-
private ###############################################################################################
|
6
|
-
###########################################################################################################
|
7
|
-
|
8
|
-
include ModuleCluster::Define::ClusterStack
|
9
|
-
|
10
|
-
######################################
|
11
|
-
# anonymous_module_append_features #
|
12
|
-
######################################
|
13
|
-
|
14
|
-
def anonymous_module_append_features( extend_or_include, *other_modules )
|
15
|
-
|
16
|
-
return Module.new do
|
17
|
-
|
18
|
-
#-------------------#
|
19
|
-
# append_features #
|
20
|
-
#-------------------#
|
21
|
-
|
22
|
-
define_method( :append_features ) do |class_or_module|
|
23
|
-
class_or_module.module_eval do
|
24
|
-
other_modules.each do |this_module|
|
25
|
-
__send__( extend_or_include, this_module )
|
26
|
-
end
|
27
|
-
end
|
28
|
-
super( class_or_module )
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
###############################
|
36
|
-
# anonymous_module_included #
|
37
|
-
###############################
|
38
|
-
|
39
|
-
def anonymous_module_included( extend_or_include, *other_modules )
|
40
|
-
|
41
|
-
return Module.new do
|
42
|
-
|
43
|
-
#------------#
|
44
|
-
# included #
|
45
|
-
#------------#
|
46
|
-
|
47
|
-
define_method( :included ) do |class_or_module|
|
48
|
-
super( class_or_module )
|
49
|
-
class_or_module.module_eval do
|
50
|
-
other_modules.each do |this_module|
|
51
|
-
__send__( extend_or_include, this_module )
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
####################################
|
61
|
-
# anonymous_module_extend_object #
|
62
|
-
####################################
|
63
|
-
|
64
|
-
def anonymous_module_extend_object( extend_or_include, *other_modules )
|
65
|
-
|
66
|
-
return Module.new do
|
67
|
-
|
68
|
-
#-----------------#
|
69
|
-
# extend_object #
|
70
|
-
#-----------------#
|
71
|
-
|
72
|
-
define_method( :extend_object ) do |class_or_module|
|
73
|
-
class_or_module.module_eval do
|
74
|
-
other_modules.each do |this_module|
|
75
|
-
__send__( extend_or_include, this_module )
|
76
|
-
end
|
77
|
-
end
|
78
|
-
super( class_or_module )
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
###############################
|
86
|
-
# anonymous_module_extended #
|
87
|
-
###############################
|
88
|
-
|
89
|
-
def anonymous_module_extended( extend_or_include, *other_modules )
|
90
|
-
|
91
|
-
return Module.new do
|
92
|
-
|
93
|
-
#------------#
|
94
|
-
# included #
|
95
|
-
#------------#
|
96
|
-
|
97
|
-
define_method( :extended ) do |class_or_module|
|
98
|
-
super( class_or_module )
|
99
|
-
class_or_module.module_eval do
|
100
|
-
other_modules.each do |this_module|
|
101
|
-
__send__( extend_or_include, this_module )
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
end
|
@@ -1,118 +0,0 @@
|
|
1
|
-
|
2
|
-
module ModuleCluster::Define::ModuleClusterCascades
|
3
|
-
|
4
|
-
###########################################################################################################
|
5
|
-
private ###############################################################################################
|
6
|
-
###########################################################################################################
|
7
|
-
|
8
|
-
include ModuleCluster::Define::ClusterStack
|
9
|
-
|
10
|
-
##############################################
|
11
|
-
# anonymous_module_cascade_append_features #
|
12
|
-
##############################################
|
13
|
-
|
14
|
-
def anonymous_module_cascade_append_features( extend_or_include, *other_modules )
|
15
|
-
|
16
|
-
return Module.new do
|
17
|
-
|
18
|
-
#-------------------#
|
19
|
-
# append_features #
|
20
|
-
#-------------------#
|
21
|
-
|
22
|
-
define_method( :append_features ) do |class_or_module|
|
23
|
-
class_or_module.module_eval do
|
24
|
-
extend ModuleCluster::Define::ModuleClusterCascades
|
25
|
-
extend( anonymous_module_cascade_append_features( extend_or_include, *other_modules ) )
|
26
|
-
other_modules.each do |this_module|
|
27
|
-
__send__( extend_or_include, this_module )
|
28
|
-
end
|
29
|
-
end
|
30
|
-
super( class_or_module )
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
#######################################
|
38
|
-
# anonymous_module_cascade_included #
|
39
|
-
#######################################
|
40
|
-
|
41
|
-
def anonymous_module_cascade_included( extend_or_include, *other_modules )
|
42
|
-
|
43
|
-
return Module.new do
|
44
|
-
|
45
|
-
#------------#
|
46
|
-
# included #
|
47
|
-
#------------#
|
48
|
-
|
49
|
-
define_method( :included ) do |class_or_module|
|
50
|
-
super( class_or_module )
|
51
|
-
class_or_module.module_eval do
|
52
|
-
extend ModuleCluster::Define::ModuleClusterCascades
|
53
|
-
extend( anonymous_module_cascade_included( extend_or_include, *other_modules ) )
|
54
|
-
other_modules.each do |this_module|
|
55
|
-
__send__( extend_or_include, this_module )
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
############################################
|
65
|
-
# anonymous_module_cascade_extend_object #
|
66
|
-
############################################
|
67
|
-
|
68
|
-
def anonymous_module_cascade_extend_object( extend_or_include, *other_modules )
|
69
|
-
|
70
|
-
return Module.new do
|
71
|
-
|
72
|
-
#-----------------#
|
73
|
-
# extend_object #
|
74
|
-
#-----------------#
|
75
|
-
|
76
|
-
define_method( :extend_object ) do |class_or_module|
|
77
|
-
class_or_module.module_eval do
|
78
|
-
extend ModuleCluster::Define::ModuleClusterCascades
|
79
|
-
extend( anonymous_module_cascade_extend_object( extend_or_include, *other_modules ) )
|
80
|
-
other_modules.each do |this_module|
|
81
|
-
__send__( extend_or_include, this_module )
|
82
|
-
end
|
83
|
-
end
|
84
|
-
super( class_or_module )
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
#######################################
|
92
|
-
# anonymous_module_cascade_extended #
|
93
|
-
#######################################
|
94
|
-
|
95
|
-
def anonymous_module_cascade_extended( extend_or_include, *other_modules )
|
96
|
-
|
97
|
-
return Module.new do
|
98
|
-
|
99
|
-
#------------#
|
100
|
-
# included #
|
101
|
-
#------------#
|
102
|
-
|
103
|
-
define_method( :extended ) do |class_or_module|
|
104
|
-
super( class_or_module )
|
105
|
-
class_or_module.module_eval do
|
106
|
-
extend ModuleCluster::Define::ModuleClusterCascades
|
107
|
-
extend( anonymous_module_cascade_extended( extend_or_include, *other_modules ) )
|
108
|
-
other_modules.each do |this_module|
|
109
|
-
__send__( extend_or_include, this_module )
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
|
2
|
-
module ModuleCluster::Define::ModuleClusterCascadesToClass
|
3
|
-
|
4
|
-
###########################################################################################################
|
5
|
-
private ###############################################################################################
|
6
|
-
###########################################################################################################
|
7
|
-
|
8
|
-
include ModuleCluster::Define::ClusterStack
|
9
|
-
|
10
|
-
#######################################################
|
11
|
-
# anonymous_module_cascade_to_class_append_features #
|
12
|
-
#######################################################
|
13
|
-
|
14
|
-
def anonymous_module_cascade_to_class_append_features( extend_or_include, *other_modules )
|
15
|
-
|
16
|
-
return Module.new do
|
17
|
-
|
18
|
-
#-------------------#
|
19
|
-
# append_features #
|
20
|
-
#-------------------#
|
21
|
-
|
22
|
-
define_method( :append_features ) do |class_or_module|
|
23
|
-
class_or_module.module_eval do
|
24
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToClass
|
25
|
-
extend( anonymous_module_cascade_to_class_append_features( extend_or_include, *other_modules ) )
|
26
|
-
if is_a?( Class )
|
27
|
-
other_modules.each do |this_module|
|
28
|
-
__send__( extend_or_include, this_module )
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
super( class_or_module )
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
################################################
|
40
|
-
# anonymous_module_cascade_to_class_included #
|
41
|
-
################################################
|
42
|
-
|
43
|
-
def anonymous_module_cascade_to_class_included( extend_or_include, *other_modules )
|
44
|
-
|
45
|
-
return Module.new do
|
46
|
-
|
47
|
-
#------------#
|
48
|
-
# included #
|
49
|
-
#------------#
|
50
|
-
|
51
|
-
define_method( :included ) do |class_or_module|
|
52
|
-
super( class_or_module )
|
53
|
-
class_or_module.module_eval do
|
54
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToClass
|
55
|
-
extend( anonymous_module_cascade_to_class_included( extend_or_include, *other_modules ) )
|
56
|
-
if is_a?( Class )
|
57
|
-
other_modules.each do |this_module|
|
58
|
-
__send__( extend_or_include, this_module )
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
#####################################################
|
69
|
-
# anonymous_module_cascade_to_class_extend_object #
|
70
|
-
#####################################################
|
71
|
-
|
72
|
-
def anonymous_module_cascade_to_class_extend_object( extend_or_include, *other_modules )
|
73
|
-
|
74
|
-
return Module.new do
|
75
|
-
|
76
|
-
#-----------------#
|
77
|
-
# extend_object #
|
78
|
-
#-----------------#
|
79
|
-
|
80
|
-
define_method( :extend_object ) do |class_or_module|
|
81
|
-
class_or_module.module_eval do
|
82
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToClass
|
83
|
-
extend( anonymous_module_cascade_to_class_extend_object( extend_or_include, *other_modules ) )
|
84
|
-
if is_a?( Class )
|
85
|
-
other_modules.each do |this_module|
|
86
|
-
__send__( extend_or_include, this_module )
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
super( class_or_module )
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
################################################
|
98
|
-
# anonymous_module_cascade_to_class_extended #
|
99
|
-
################################################
|
100
|
-
|
101
|
-
def anonymous_module_cascade_to_class_extended( extend_or_include, *other_modules )
|
102
|
-
|
103
|
-
return Module.new do
|
104
|
-
|
105
|
-
#------------#
|
106
|
-
# included #
|
107
|
-
#------------#
|
108
|
-
|
109
|
-
define_method( :extended ) do |class_or_module|
|
110
|
-
super( class_or_module )
|
111
|
-
class_or_module.module_eval do
|
112
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToClass
|
113
|
-
extend( anonymous_module_cascade_to_class_extended( extend_or_include, *other_modules ) )
|
114
|
-
if is_a?( Class )
|
115
|
-
other_modules.each do |this_module|
|
116
|
-
__send__( extend_or_include, this_module )
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
|
2
|
-
module ModuleCluster::Define::ModuleClusterCascadesToModule
|
3
|
-
|
4
|
-
###########################################################################################################
|
5
|
-
private ###############################################################################################
|
6
|
-
###########################################################################################################
|
7
|
-
|
8
|
-
include ModuleCluster::Define::ClusterStack
|
9
|
-
|
10
|
-
########################################################
|
11
|
-
# anonymous_module_cascade_to_module_append_features #
|
12
|
-
########################################################
|
13
|
-
|
14
|
-
def anonymous_module_cascade_to_module_append_features( extend_or_include, *other_modules )
|
15
|
-
|
16
|
-
return Module.new do
|
17
|
-
|
18
|
-
#-------------------#
|
19
|
-
# append_features #
|
20
|
-
#-------------------#
|
21
|
-
|
22
|
-
define_method( :append_features ) do |class_or_module|
|
23
|
-
class_or_module.module_eval do
|
24
|
-
unless is_a?( Class )
|
25
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
26
|
-
extend( anonymous_module_cascade_to_module_append_features( extend_or_include, *other_modules ) )
|
27
|
-
other_modules.each do |this_module|
|
28
|
-
__send__( extend_or_include, this_module )
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
super( class_or_module )
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
#################################################
|
40
|
-
# anonymous_module_cascade_to_module_included #
|
41
|
-
#################################################
|
42
|
-
|
43
|
-
def anonymous_module_cascade_to_module_included( extend_or_include, *other_modules )
|
44
|
-
|
45
|
-
return Module.new do
|
46
|
-
|
47
|
-
#------------#
|
48
|
-
# included #
|
49
|
-
#------------#
|
50
|
-
|
51
|
-
define_method( :included ) do |class_or_module|
|
52
|
-
super( class_or_module )
|
53
|
-
class_or_module.module_eval do
|
54
|
-
unless is_a?( Class )
|
55
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
56
|
-
extend( anonymous_module_cascade_to_module_included( extend_or_include, *other_modules ) )
|
57
|
-
other_modules.each do |this_module|
|
58
|
-
__send__( extend_or_include, this_module )
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
######################################################
|
69
|
-
# anonymous_module_cascade_to_module_extend_object #
|
70
|
-
######################################################
|
71
|
-
|
72
|
-
def anonymous_module_cascade_to_module_extend_object( extend_or_include, *other_modules )
|
73
|
-
|
74
|
-
return Module.new do
|
75
|
-
|
76
|
-
#-----------------#
|
77
|
-
# extend_object #
|
78
|
-
#-----------------#
|
79
|
-
|
80
|
-
define_method( :extend_object ) do |class_or_module|
|
81
|
-
class_or_module.module_eval do
|
82
|
-
unless is_a?( Class )
|
83
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
84
|
-
extend( anonymous_module_cascade_to_module_extend_object( extend_or_include, *other_modules ) )
|
85
|
-
other_modules.each do |this_module|
|
86
|
-
__send__( extend_or_include, this_module )
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
super( class_or_module )
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
#################################################
|
98
|
-
# anonymous_module_cascade_to_module_extended #
|
99
|
-
#################################################
|
100
|
-
|
101
|
-
def anonymous_module_cascade_to_module_extended( extend_or_include, *other_modules )
|
102
|
-
|
103
|
-
return Module.new do
|
104
|
-
|
105
|
-
#------------#
|
106
|
-
# included #
|
107
|
-
#------------#
|
108
|
-
|
109
|
-
define_method( :extended ) do |class_or_module|
|
110
|
-
super( class_or_module )
|
111
|
-
class_or_module.module_eval do
|
112
|
-
unless is_a?( Class )
|
113
|
-
extend ModuleCluster::Define::ModuleClusterCascadesToModule
|
114
|
-
extend( anonymous_module_cascade_to_module_extended( extend_or_include, *other_modules ) )
|
115
|
-
other_modules.each do |this_module|
|
116
|
-
__send__( extend_or_include, this_module )
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
end
|