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
@@ -1,36 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::Block::Class
3
-
4
- ###################
5
- # class_include #
6
- ###################
7
-
8
- def class_include( runtime_block )
9
- cascading_includes.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
10
- end
11
-
12
- ##################
13
- # class_extend #
14
- ##################
15
-
16
- def class_extend( runtime_block )
17
- cascading_extends.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
18
- end
19
-
20
- ###########################
21
- # prepend_class_include #
22
- ###########################
23
-
24
- def prepend_class_include( runtime_block )
25
- cascading_prepending_includes.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
26
- end
27
-
28
- ##########################
29
- # prepend_class_extend #
30
- ##########################
31
-
32
- def prepend_class_extend( runtime_block )
33
- cascading_prepending_extends.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
34
- end
35
-
36
- end
@@ -1,36 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::Block::Module
3
-
4
- ####################
5
- # module_include #
6
- ####################
7
-
8
- def module_include( runtime_block )
9
- cascading_includes.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
10
- end
11
-
12
- ###################
13
- # module_extend #
14
- ###################
15
-
16
- def module_extend( runtime_block )
17
- cascading_extends.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
18
- end
19
-
20
- ############################
21
- # prepend_module_include #
22
- ############################
23
-
24
- def prepend_module_include( runtime_block )
25
- cascading_prepending_includes.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
26
- end
27
-
28
- ###########################
29
- # prepend_module_extend #
30
- ###########################
31
-
32
- def prepend_module_extend( runtime_block )
33
- cascading_prepending_extends.push( ModuleCluster::ClusterStack::Block::Set.new( runtime_block ) )
34
- end
35
-
36
- end
@@ -1,29 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::Extends
3
-
4
- #######################
5
- # cascading_extends #
6
- #######################
7
-
8
- def cascading_extends
9
- return @cascading_extends ||= Array.new
10
- end
11
-
12
- #####################
13
- # extend_includes #
14
- #####################
15
-
16
- def extend_includes( module_instance, method, includes, runtime_includes_block )
17
- cascading_extends.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :include, includes, runtime_includes_block ) )
18
- end
19
-
20
- ####################
21
- # extend_extends #
22
- ####################
23
-
24
- def extend_extends( module_instance, method, extends, runtime_extends_block )
25
- cascading_extends.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :extend, extends, runtime_extends_block ) )
26
- end
27
-
28
-
29
- end
@@ -1,28 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::Includes
3
-
4
- ########################
5
- # cascading_includes #
6
- ########################
7
-
8
- def cascading_includes
9
- return @cascading_includes ||= Array.new
10
- end
11
-
12
- ######################
13
- # include_includes #
14
- ######################
15
-
16
- def include_includes( module_instance, method, includes, runtime_includes_block )
17
- cascading_includes.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :include, includes, runtime_includes_block ) )
18
- end
19
-
20
- #####################
21
- # include_extends #
22
- #####################
23
-
24
- def include_extends( module_instance, method, extends, runtime_extends_block )
25
- cascading_includes.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :extend, extends, runtime_extends_block ) )
26
- end
27
-
28
- end
@@ -1,28 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::PrependsExtends
3
-
4
- ##################################
5
- # cascading_prepending_extends #
6
- ##################################
7
-
8
- def cascading_prepending_extends
9
- return @cascading_prepending_extends ||= Array.new
10
- end
11
-
12
- ##############################
13
- # extend_prepends_includes #
14
- ##############################
15
-
16
- def extend_prepends_includes( module_instance, method, includes, runtime_includes_block )
17
- cascading_prepending_extends.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :include, includes, runtime_includes_block ) )
18
- end
19
-
20
- #############################
21
- # extend_prepends_extends #
22
- #############################
23
-
24
- def extend_prepends_extends( module_instance, method, extends, runtime_extends_block )
25
- cascading_prepending_extends.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :extend, extends, runtime_extends_block ) )
26
- end
27
-
28
- end
@@ -1,28 +0,0 @@
1
-
2
- module ModuleCluster::ClusterStack::PrependsIncludes
3
-
4
- ###################################
5
- # cascading_prepending_includes #
6
- ###################################
7
-
8
- def cascading_prepending_includes
9
- return @cascading_prepending_includes ||= Array.new
10
- end
11
-
12
- ###############################
13
- # include_prepends_includes #
14
- ###############################
15
-
16
- def include_prepends_includes( module_instance, method, includes, runtime_includes_block )
17
- cascading_prepending_includes.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :include, includes, runtime_includes_block ) )
18
- end
19
-
20
- ##############################
21
- # include_prepends_extends #
22
- ##############################
23
-
24
- def include_prepends_extends( module_instance, method, extends, runtime_extends_block )
25
- cascading_prepending_includes.push( ModuleCluster::ClusterStack::Set.new( module_instance, method, :extend, extends, runtime_extends_block ) )
26
- end
27
-
28
- end
@@ -1,26 +0,0 @@
1
-
2
- module ModuleCluster::Define::ClusterStack
3
-
4
- ###################
5
- # cluster_stack #
6
- ###################
7
-
8
- def cluster_stack
9
-
10
- cluster_stack = nil
11
-
12
- class_or_module_self = self
13
-
14
- ModuleCluster::Define::ClusterStack.module_eval do
15
- @cluster_stacks ||= Hash.new
16
- unless cluster_stack = @cluster_stacks[ class_or_module_self ]
17
- cluster_stack ||= ModuleCluster::ClusterStack.new
18
- @cluster_stacks[ class_or_module_self ] = cluster_stack
19
- end
20
- end
21
-
22
- return cluster_stack
23
-
24
- end
25
-
26
- end