module-cluster 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -0
- data/README.rdoc +21 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClass.rb +83 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingClassOrModule.rb +70 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModule.rb +79 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/CascadingModuleOrSubclass.rb +22 -0
- data/lib/module-cluster/ModuleCluster/Define/Block/Class.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModule.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrModuleOrSubclass.rb +11 -3
- data/lib/module-cluster/ModuleCluster/Define/Block/ClassOrSubclass.rb +10 -2
- data/lib/module-cluster/ModuleCluster/Define/Block/Instance.rb +15 -3
- data/lib/module-cluster/ModuleCluster/Define/Block/Module.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrInstance.rb +15 -7
- data/lib/module-cluster/ModuleCluster/Define/Block/ModuleOrSubclass.rb +10 -2
- data/lib/module-cluster/ModuleCluster/Define/Block/Subclass.rb +13 -2
- data/lib/module-cluster/ModuleCluster/Define/Block.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define/ClassCluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClassOrInstanceCluster.rb +34 -34
- data/lib/module-cluster/ModuleCluster/Define/Cluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascades.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToClass.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ClusterCascadesToModule.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/Deprecated.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define/InstanceCluster.rb +3 -3
- data/lib/module-cluster/ModuleCluster/Define/ModuleCluster.rb +19 -19
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrClassCluster.rb +43 -43
- data/lib/module-cluster/ModuleCluster/Define/ModuleOrInstanceCluster.rb +34 -34
- data/lib/module-cluster/ModuleCluster/Define/Status.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Define.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend/Hooks.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend/WithoutHooks.rb +1 -1
- data/lib/module-cluster/ModuleCluster/Suspend.rb +1 -1
- data/lib/module-cluster/ModuleCluster.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/ClusterStack.rb +3 -3
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/PerformCascades.rb +85 -32
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures/Subclass.rb +6 -3
- data/lib/module-cluster/_private_/ModuleCluster/CascadeFeatures.rb +5 -5
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Class.rb +9 -9
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Inherited.rb +3 -3
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Instance.rb +5 -5
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Module.rb +9 -9
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block/Set.rb +1 -0
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Block.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Extends.rb +13 -13
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Includes.rb +10 -10
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsExtends.rb +13 -13
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/PrependsIncludes.rb +10 -10
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Status.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack/Suspend.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ClusterStack.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade/Subclass.rb +1 -1
- data/lib/module-cluster/_private_/ModuleCluster/ExtendForCascade.rb +1 -1
- data/lib/module-cluster.rb +14 -2
- data/spec/ModuleCluster/Define/Block/CascadingClassOrModule_spec.rb +285 -0
- data/spec/ModuleCluster/Define/Block/CascadingClass_spec.rb +241 -0
- data/spec/ModuleCluster/Define/Block/CascadingModuleOrSubclass_spec.rb +56 -0
- data/spec/ModuleCluster/Define/Block/CascadingModule_spec.rb +278 -0
- data/spec/ModuleCluster/Define/Block/ClassOrInstance_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrInstance_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrModuleOrSubclass_spec.rb +2 -3
- data/spec/ModuleCluster/Define/Block/ClassOrModule_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/ClassOrSubclass_spec.rb +2 -2
- data/spec/ModuleCluster/Define/Block/Class_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/Instance_spec.rb +5 -5
- data/spec/ModuleCluster/Define/Block/ModuleOrInstance_spec.rb +1 -1
- data/spec/ModuleCluster/Define/Block/ModuleOrSubclass_spec.rb +2 -4
- data/spec/ModuleCluster/Define/Block/Module_spec.rb +13 -13
- data/spec/ModuleCluster/Define/Block/Subclass_spec.rb +8 -8
- data/spec/ModuleCluster/Define/Block_spec.rb +9 -9
- data/spec/ModuleCluster/Define/ClassCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ClassOrInstanceCluster_spec.rb +197 -197
- data/spec/ModuleCluster/Define/ClusterCascadesToClass_spec.rb +228 -228
- data/spec/ModuleCluster/Define/ClusterCascadesToModule_spec.rb +232 -232
- data/spec/ModuleCluster/Define/ClusterCascades_spec.rb +224 -224
- data/spec/ModuleCluster/Define/Cluster_spec.rb +221 -221
- data/spec/ModuleCluster/Define/InstanceCluster_spec.rb +29 -29
- data/spec/ModuleCluster/Define/ModuleCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ModuleOrClassCluster_spec.rb +227 -227
- data/spec/ModuleCluster/Define/ModuleOrInstanceCluster_spec.rb +197 -197
- data/spec/ModuleCluster/Suspend/Hooks_spec.rb +120 -120
- data/spec/ModuleCluster/Suspend/WithoutHooks_spec.rb +120 -120
- data/spec/ModuleCluster_spec.rb +2 -2
- data/spec/_private_/ModuleCluster/CascadeFeatures/PerformCascades_spec.rb +192 -192
- data/spec/_private_/ModuleCluster/ClusterStack/Set/MultiSetProxy_spec.rb +129 -129
- data/spec/_private_/ModuleCluster/ClusterStack/Suspend_spec.rb +17 -17
- metadata +9 -1
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
require_relative '../../../lib/module-cluster.rb'
|
3
3
|
|
4
|
-
describe ModuleCluster::Define::InstanceCluster do
|
4
|
+
describe ::ModuleCluster::Define::InstanceCluster do
|
5
5
|
|
6
6
|
####################################
|
7
7
|
# self.should_include_or_extend? #
|
8
8
|
####################################
|
9
9
|
|
10
10
|
it 'should return true if instance, false otherwise' do
|
11
|
-
ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Kernel ).should == false
|
12
|
-
ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Class ).should == false
|
13
|
-
ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Object.new ).should == true
|
11
|
+
::ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Kernel ).should == false
|
12
|
+
::ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Class ).should == false
|
13
|
+
::ModuleCluster::Define::InstanceCluster.should_include_or_extend?( Object.new ).should == true
|
14
14
|
end
|
15
15
|
|
16
16
|
##########################
|
@@ -18,9 +18,9 @@ describe ModuleCluster::Define::InstanceCluster do
|
|
18
18
|
##########################
|
19
19
|
|
20
20
|
it 'should report false' do
|
21
|
-
ModuleCluster::Define::InstanceCluster.should_cascade?( Kernel ).should == false
|
22
|
-
ModuleCluster::Define::InstanceCluster.should_cascade?( Class ).should == false
|
23
|
-
ModuleCluster::Define::InstanceCluster.should_cascade?( Object.new ).should == false
|
21
|
+
::ModuleCluster::Define::InstanceCluster.should_cascade?( Kernel ).should == false
|
22
|
+
::ModuleCluster::Define::InstanceCluster.should_cascade?( Class ).should == false
|
23
|
+
::ModuleCluster::Define::InstanceCluster.should_cascade?( Object.new ).should == false
|
24
24
|
end
|
25
25
|
|
26
26
|
##################################
|
@@ -28,7 +28,7 @@ describe ModuleCluster::Define::InstanceCluster do
|
|
28
28
|
##################################
|
29
29
|
|
30
30
|
it 'can extend other modules when this one extends a module or instance' do
|
31
|
-
module ModuleCluster::Define::InstanceCluster::Mock01
|
31
|
+
module ::ModuleCluster::Define::InstanceCluster::Mock01
|
32
32
|
extend ::ModuleCluster::Define::InstanceCluster
|
33
33
|
module Module1
|
34
34
|
end
|
@@ -38,25 +38,25 @@ describe ModuleCluster::Define::InstanceCluster do
|
|
38
38
|
respond_to?( :extended ).should == true
|
39
39
|
module ModuleProof
|
40
40
|
extend ::ModuleCluster::Define::InstanceCluster::Mock01
|
41
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
42
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
41
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
42
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
43
43
|
eigenclass = class << self ; self ; end
|
44
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
45
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
44
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
45
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
46
46
|
end
|
47
47
|
class ClassProof
|
48
48
|
extend ::ModuleCluster::Define::InstanceCluster::Mock01
|
49
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
50
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
49
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
50
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
51
51
|
eigenclass = class << self ; self ; end
|
52
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
53
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
52
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == false
|
53
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == false
|
54
54
|
end
|
55
55
|
Object.new.instance_eval do
|
56
56
|
extend ::ModuleCluster::Define::InstanceCluster::Mock01
|
57
57
|
eigenclass = class << self ; self ; end
|
58
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == true
|
59
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == true
|
58
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module1 ).should == true
|
59
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock01::Module2 ).should == true
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -66,7 +66,7 @@ describe ModuleCluster::Define::InstanceCluster do
|
|
66
66
|
######################################
|
67
67
|
|
68
68
|
it 'can extend other modules before this one when this one extends an instance' do
|
69
|
-
module ModuleCluster::Define::InstanceCluster::Mock02
|
69
|
+
module ::ModuleCluster::Define::InstanceCluster::Mock02
|
70
70
|
extend ::ModuleCluster::Define::InstanceCluster
|
71
71
|
module Module1
|
72
72
|
end
|
@@ -76,25 +76,25 @@ describe ModuleCluster::Define::InstanceCluster do
|
|
76
76
|
respond_to?( :extend_object ).should == true
|
77
77
|
module ModuleProof
|
78
78
|
extend ::ModuleCluster::Define::InstanceCluster::Mock02
|
79
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
80
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
79
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
80
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
81
81
|
eigenclass = class << self ; self ; end
|
82
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
83
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
82
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
83
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
84
84
|
end
|
85
85
|
class ClassProof
|
86
86
|
extend ::ModuleCluster::Define::InstanceCluster::Mock02
|
87
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
88
|
-
ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
87
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
88
|
+
ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
89
89
|
eigenclass = class << self ; self ; end
|
90
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
91
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
90
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == false
|
91
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == false
|
92
92
|
end
|
93
93
|
Object.new.instance_eval do
|
94
94
|
extend ::ModuleCluster::Define::InstanceCluster::Mock02
|
95
95
|
eigenclass = class << self ; self ; end
|
96
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == true
|
97
|
-
eigenclass.ancestors.include?( ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == true
|
96
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module1 ).should == true
|
97
|
+
eigenclass.ancestors.include?( ::ModuleCluster::Define::InstanceCluster::Mock02::Module2 ).should == true
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|