cantango-config 0.1.9.2 → 0.2.0
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.
- data/README.mdown +16 -0
- data/VERSION +1 -1
- data/cantango-config.gemspec +68 -62
- data/lib/cantango/category.rb +18 -0
- data/lib/cantango/class_methods.rb +10 -0
- data/lib/cantango/config.rb +43 -2
- data/lib/cantango/{configuration → config}/ability.rb +8 -3
- data/lib/cantango/config/ability/engine.rb +45 -0
- data/lib/cantango/config/ability/modes.rb +16 -0
- data/lib/cantango/config/ability/modes/execution.rb +19 -0
- data/lib/cantango/{configuration → config}/account.rb +1 -1
- data/lib/cantango/{configuration → config}/accounts.rb +2 -3
- data/lib/cantango/{configuration → config}/adapters.rb +4 -4
- data/lib/cantango/{configuration → config}/autoload.rb +1 -1
- data/lib/cantango/{configuration → config}/categories.rb +3 -4
- data/lib/cantango/config/class_methods.rb +27 -0
- data/lib/cantango/{configuration → config}/debug.rb +1 -1
- data/lib/cantango/config/engines.rb +47 -0
- data/lib/cantango/config/engines/available.rb +19 -0
- data/lib/cantango/config/engines/order.rb +48 -0
- data/lib/cantango/{configuration → config}/factory.rb +1 -1
- data/lib/cantango/{configuration → config}/guest.rb +5 -6
- data/lib/cantango/config/helpers.rb +17 -0
- data/lib/cantango/{configuration → config}/hooks.rb +3 -3
- data/lib/cantango/{configuration → config}/localhosts.rb +4 -5
- data/lib/cantango/{configuration → config}/models.rb +16 -7
- data/lib/cantango/{configuration → config}/models/actions.rb +0 -0
- data/lib/cantango/{configuration → config}/models/active_record.rb +0 -0
- data/lib/cantango/{configuration → config}/models/data_mapper.rb +0 -0
- data/lib/cantango/{configuration → config}/models/generic.rb +0 -0
- data/lib/cantango/{configuration → config}/models/mongo.rb +0 -0
- data/lib/cantango/{configuration → config}/models/mongo_mapper.rb +0 -0
- data/lib/cantango/{configuration → config}/models/mongoid.rb +0 -0
- data/lib/cantango/{configuration → config}/orms.rb +2 -2
- data/lib/cantango/{configuration → config}/user.rb +1 -1
- data/lib/cantango/{configuration → config}/users.rb +2 -2
- data/lib/cantango/registry.rb +5 -0
- data/lib/cantango/{configuration/registry → registry}/base.rb +18 -4
- data/lib/cantango/registry/clazz.rb +92 -0
- data/lib/cantango/{configuration/registry → registry}/hash.rb +8 -10
- data/spec/cantango/category_spec.rb +21 -0
- data/spec/cantango/config/ability/modes/execution_spec.rb +33 -0
- data/spec/cantango/{configuration → config/ability}/modes_spec.rb +3 -3
- data/spec/cantango/{configuration → config}/ability_spec.rb +3 -3
- data/spec/cantango/{configuration → config}/account_spec.rb +1 -1
- data/spec/cantango/{configuration → config}/accounts_spec.rb +3 -3
- data/spec/cantango/{configuration → config}/adapters_spec.rb +1 -1
- data/spec/cantango/{configuration → config}/autoload_spec.rb +1 -2
- data/spec/cantango/{configuration → config}/categories_spec.rb +2 -10
- data/spec/cantango/config/class_methods_spec.rb +12 -0
- data/spec/cantango/{configuration → config}/debug_spec.rb +2 -7
- data/spec/cantango/config/engines/available_spec.rb +29 -0
- data/spec/cantango/{configuration → config}/engines/engine_shared.rb +0 -0
- data/spec/cantango/{configuration/engines_spec.rb → config/engines/order_spec.rb} +9 -54
- data/spec/cantango/config/engines_spec.rb +59 -0
- data/spec/cantango/{configuration → config}/factory_spec.rb +3 -3
- data/spec/cantango/{configuration → config}/guest/find_guest_default_way_spec.rb +1 -1
- data/spec/cantango/{configuration → config}/guest_spec.rb +2 -2
- data/spec/cantango/config/helpers_spec.rb +15 -0
- data/spec/cantango/config/localhosts_spec.rb +8 -0
- data/spec/cantango/{configuration → config}/models_spec.rb +10 -3
- data/spec/cantango/{configuration → config}/orms_spec.rb +2 -2
- data/spec/cantango/{configuration → config}/shared/factory_ex.rb +0 -0
- data/spec/cantango/{configuration → config}/user_spec.rb +2 -2
- data/spec/cantango/{configuration → config}/users_spec.rb +4 -4
- data/spec/cantango/config_spec.rb +86 -5
- data/spec/cantango/{configuration/registry → registry}/base_spec.rb +2 -2
- data/spec/cantango/{configuration/registry/candidate_spec.rb → registry/clazz_spec.rb} +2 -2
- data/spec/cantango/{configuration/registry → registry}/hash_spec.rb +2 -2
- data/spec/cantango/{configuration/shared/registry → registry/shared}/base_ex.rb +0 -0
- data/spec/cantango/{configuration/shared/registry → registry/shared}/clazz_ex.rb +0 -0
- data/spec/cantango/{configuration/shared/registry → registry/shared}/hash_ex.rb +0 -0
- metadata +87 -81
- data/lib/cantango/configuration.rb +0 -110
- data/lib/cantango/configuration/category.rb +0 -20
- data/lib/cantango/configuration/engine.rb +0 -33
- data/lib/cantango/configuration/engines.rb +0 -95
- data/lib/cantango/configuration/execution_modes.rb +0 -21
- data/lib/cantango/configuration/modes.rb +0 -8
- data/lib/cantango/configuration/registry.rb +0 -7
- data/lib/cantango/configuration/registry/clazz.rb +0 -94
- data/spec/cantango/configuration/execution_modes_spec.rb +0 -15
- data/spec/cantango/configuration/localhosts_spec.rb +0 -9
- data/spec/cantango/configuration/shared/execution_modes_ex.rb +0 -14
- data/spec/cantango/configuration_spec.rb +0 -112
data/README.mdown
CHANGED
@@ -42,6 +42,22 @@ CanTango.config.accounts do |accounts|
|
|
42
42
|
end
|
43
43
|
```
|
44
44
|
|
45
|
+
## Registry
|
46
|
+
|
47
|
+
The Registry namespace contains registries useful for configuration and other purposes.
|
48
|
+
|
49
|
+
* CanTango::Registry
|
50
|
+
* Base
|
51
|
+
* Hash
|
52
|
+
* Clazz
|
53
|
+
|
54
|
+
## Adapter
|
55
|
+
|
56
|
+
* Compiler
|
57
|
+
* Moneta
|
58
|
+
|
59
|
+
The Compiler and Moneta adapters are used when Caching/Persisting rules in a data store.
|
60
|
+
|
45
61
|
## Contributing to cantango-config
|
46
62
|
|
47
63
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/cantango-config.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cantango-config}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Kristian Mandrup}]
|
12
|
-
s.date = %q{2011-12-
|
12
|
+
s.date = %q{2011-12-12}
|
13
13
|
s.description = %q{Configuration DSL for configuring CanTango}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,72 +28,78 @@ Gem::Specification.new do |s|
|
|
28
28
|
"cantango-config.gemspec",
|
29
29
|
"lib/cantango/adapter/compiler.rb",
|
30
30
|
"lib/cantango/adapter/moneta.rb",
|
31
|
+
"lib/cantango/category.rb",
|
31
32
|
"lib/cantango/class_methods.rb",
|
32
33
|
"lib/cantango/config.rb",
|
34
|
+
"lib/cantango/config/ability.rb",
|
35
|
+
"lib/cantango/config/ability/engine.rb",
|
36
|
+
"lib/cantango/config/ability/modes.rb",
|
37
|
+
"lib/cantango/config/ability/modes/execution.rb",
|
38
|
+
"lib/cantango/config/account.rb",
|
39
|
+
"lib/cantango/config/accounts.rb",
|
40
|
+
"lib/cantango/config/adapters.rb",
|
41
|
+
"lib/cantango/config/autoload.rb",
|
42
|
+
"lib/cantango/config/categories.rb",
|
43
|
+
"lib/cantango/config/class_methods.rb",
|
44
|
+
"lib/cantango/config/debug.rb",
|
45
|
+
"lib/cantango/config/engines.rb",
|
46
|
+
"lib/cantango/config/engines/available.rb",
|
47
|
+
"lib/cantango/config/engines/order.rb",
|
48
|
+
"lib/cantango/config/factory.rb",
|
49
|
+
"lib/cantango/config/guest.rb",
|
50
|
+
"lib/cantango/config/helpers.rb",
|
51
|
+
"lib/cantango/config/hooks.rb",
|
52
|
+
"lib/cantango/config/localhosts.rb",
|
53
|
+
"lib/cantango/config/models.rb",
|
54
|
+
"lib/cantango/config/models/actions.rb",
|
55
|
+
"lib/cantango/config/models/active_record.rb",
|
56
|
+
"lib/cantango/config/models/data_mapper.rb",
|
57
|
+
"lib/cantango/config/models/generic.rb",
|
58
|
+
"lib/cantango/config/models/mongo.rb",
|
59
|
+
"lib/cantango/config/models/mongo_mapper.rb",
|
60
|
+
"lib/cantango/config/models/mongoid.rb",
|
61
|
+
"lib/cantango/config/orms.rb",
|
62
|
+
"lib/cantango/config/user.rb",
|
63
|
+
"lib/cantango/config/users.rb",
|
33
64
|
"lib/cantango/config_ext.rb",
|
34
65
|
"lib/cantango/config_ext/loader.rb",
|
35
66
|
"lib/cantango/config_ext/loader/yaml.rb",
|
36
|
-
"lib/cantango/
|
37
|
-
"lib/cantango/
|
38
|
-
"lib/cantango/
|
39
|
-
"lib/cantango/
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"lib/cantango/configuration/registry/hash.rb",
|
66
|
-
"lib/cantango/configuration/user.rb",
|
67
|
-
"lib/cantango/configuration/users.rb",
|
67
|
+
"lib/cantango/registry.rb",
|
68
|
+
"lib/cantango/registry/base.rb",
|
69
|
+
"lib/cantango/registry/clazz.rb",
|
70
|
+
"lib/cantango/registry/hash.rb",
|
71
|
+
"spec/cantango/category_spec.rb",
|
72
|
+
"spec/cantango/config/ability/modes/execution_spec.rb",
|
73
|
+
"spec/cantango/config/ability/modes_spec.rb",
|
74
|
+
"spec/cantango/config/ability_spec.rb",
|
75
|
+
"spec/cantango/config/account_spec.rb",
|
76
|
+
"spec/cantango/config/accounts_spec.rb",
|
77
|
+
"spec/cantango/config/adapters_spec.rb",
|
78
|
+
"spec/cantango/config/autoload_spec.rb",
|
79
|
+
"spec/cantango/config/categories_spec.rb",
|
80
|
+
"spec/cantango/config/class_methods_spec.rb",
|
81
|
+
"spec/cantango/config/debug_spec.rb",
|
82
|
+
"spec/cantango/config/engines/available_spec.rb",
|
83
|
+
"spec/cantango/config/engines/engine_shared.rb",
|
84
|
+
"spec/cantango/config/engines/order_spec.rb",
|
85
|
+
"spec/cantango/config/engines_spec.rb",
|
86
|
+
"spec/cantango/config/factory_spec.rb",
|
87
|
+
"spec/cantango/config/guest/find_guest_default_way_spec.rb",
|
88
|
+
"spec/cantango/config/guest_spec.rb",
|
89
|
+
"spec/cantango/config/helpers_spec.rb",
|
90
|
+
"spec/cantango/config/localhosts_spec.rb",
|
91
|
+
"spec/cantango/config/models_spec.rb",
|
92
|
+
"spec/cantango/config/orms_spec.rb",
|
93
|
+
"spec/cantango/config/shared/factory_ex.rb",
|
94
|
+
"spec/cantango/config/user_spec.rb",
|
95
|
+
"spec/cantango/config/users_spec.rb",
|
68
96
|
"spec/cantango/config_spec.rb",
|
69
|
-
"spec/cantango/
|
70
|
-
"spec/cantango/
|
71
|
-
"spec/cantango/
|
72
|
-
"spec/cantango/
|
73
|
-
"spec/cantango/
|
74
|
-
"spec/cantango/
|
75
|
-
"spec/cantango/configuration/debug_spec.rb",
|
76
|
-
"spec/cantango/configuration/engines/engine_shared.rb",
|
77
|
-
"spec/cantango/configuration/engines_spec.rb",
|
78
|
-
"spec/cantango/configuration/execution_modes_spec.rb",
|
79
|
-
"spec/cantango/configuration/factory_spec.rb",
|
80
|
-
"spec/cantango/configuration/guest/find_guest_default_way_spec.rb",
|
81
|
-
"spec/cantango/configuration/guest_spec.rb",
|
82
|
-
"spec/cantango/configuration/localhosts_spec.rb",
|
83
|
-
"spec/cantango/configuration/models_spec.rb",
|
84
|
-
"spec/cantango/configuration/modes_spec.rb",
|
85
|
-
"spec/cantango/configuration/orms_spec.rb",
|
86
|
-
"spec/cantango/configuration/registry/base_spec.rb",
|
87
|
-
"spec/cantango/configuration/registry/candidate_spec.rb",
|
88
|
-
"spec/cantango/configuration/registry/hash_spec.rb",
|
89
|
-
"spec/cantango/configuration/shared/execution_modes_ex.rb",
|
90
|
-
"spec/cantango/configuration/shared/factory_ex.rb",
|
91
|
-
"spec/cantango/configuration/shared/registry/base_ex.rb",
|
92
|
-
"spec/cantango/configuration/shared/registry/clazz_ex.rb",
|
93
|
-
"spec/cantango/configuration/shared/registry/hash_ex.rb",
|
94
|
-
"spec/cantango/configuration/user_spec.rb",
|
95
|
-
"spec/cantango/configuration/users_spec.rb",
|
96
|
-
"spec/cantango/configuration_spec.rb",
|
97
|
+
"spec/cantango/registry/base_spec.rb",
|
98
|
+
"spec/cantango/registry/clazz_spec.rb",
|
99
|
+
"spec/cantango/registry/hash_spec.rb",
|
100
|
+
"spec/cantango/registry/shared/base_ex.rb",
|
101
|
+
"spec/cantango/registry/shared/clazz_ex.rb",
|
102
|
+
"spec/cantango/registry/shared/hash_ex.rb",
|
97
103
|
"spec/db/database.yml",
|
98
104
|
"spec/factories/project.rb",
|
99
105
|
"spec/fixtures/models.rb",
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module CanTango
|
2
|
+
class Category
|
3
|
+
def initialize *subjects
|
4
|
+
@subjects = subjects.flatten
|
5
|
+
end
|
6
|
+
|
7
|
+
def subjects
|
8
|
+
@subjects ||= []
|
9
|
+
end
|
10
|
+
|
11
|
+
# test if a particular category has a certain subject
|
12
|
+
def has_any? subject, &block
|
13
|
+
found = subjects.include? subject
|
14
|
+
yield if found && block
|
15
|
+
found
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,5 +1,15 @@
|
|
1
1
|
module CanTango
|
2
2
|
module ClassMethods
|
3
|
+
def self.extended base
|
4
|
+
end
|
5
|
+
|
6
|
+
def configure &block
|
7
|
+
conf = CanTango::Config.instance
|
8
|
+
yield conf if block
|
9
|
+
conf
|
10
|
+
end
|
11
|
+
|
12
|
+
alias_method :config, :configure
|
3
13
|
# Engine hook
|
4
14
|
# Run after the initializers are ran for all Railties (including the application itself), but before eager loading and the middleware stack is built.
|
5
15
|
# More importantly, will run upon every request in development, but only once (during boot-up) in production and test.
|
data/lib/cantango/config.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'sugar-high/array'
|
2
2
|
require 'sugar-high/blank'
|
3
3
|
require 'hashie'
|
4
|
+
require 'set'
|
5
|
+
require 'singleton'
|
4
6
|
require 'sweetloader'
|
5
7
|
|
6
8
|
require 'cantango/core'
|
@@ -9,7 +11,46 @@ SweetLoader.namespaces = {:CanTango => 'cantango'}
|
|
9
11
|
SweetLoader.mode = :require
|
10
12
|
|
11
13
|
module CanTango
|
12
|
-
|
13
|
-
|
14
|
+
sweetload :Registry, :ClassMethods, :Category
|
15
|
+
extend ClassMethods
|
16
|
+
|
17
|
+
class Config
|
18
|
+
sweetload :Models, :Engines, :Factory, :Ability
|
19
|
+
sweetload :Categories
|
20
|
+
sweetload :Autoload, :Adapters, :Debug, :Orms, :Localhosts, :Hooks, :Helpers
|
21
|
+
sweetload :Account, :Accounts
|
22
|
+
sweetload :User, :Guest, :Users
|
23
|
+
sweetload :ClassMethods
|
24
|
+
|
25
|
+
include Singleton
|
26
|
+
extend ClassMethods
|
27
|
+
|
28
|
+
def ability
|
29
|
+
@ability ||= CanTango::Config::Ability.instance
|
30
|
+
@ability.default_class ||= CanTango::Ability::Executor::Modal # from cantango-core
|
31
|
+
@ability
|
32
|
+
end
|
33
|
+
|
34
|
+
def debug!
|
35
|
+
debug.on!
|
36
|
+
end
|
37
|
+
|
38
|
+
# Turn on default engines and enable compile adapter
|
39
|
+
# i.e compilation of rules via sourcify
|
40
|
+
def default_settings!
|
41
|
+
engines.all :off
|
42
|
+
end
|
43
|
+
|
44
|
+
def clear!
|
45
|
+
CanTango::Configuration.components.each do |component|
|
46
|
+
if respond_to? component
|
47
|
+
component = send(component)
|
48
|
+
component.send(:clear!) if component.respond_to? :clear!
|
49
|
+
end
|
50
|
+
end
|
51
|
+
engines.clear!
|
52
|
+
end
|
53
|
+
end
|
14
54
|
end
|
55
|
+
|
15
56
|
require 'cantango/config_ext'
|
@@ -1,11 +1,16 @@
|
|
1
1
|
module CanTango
|
2
|
-
class
|
2
|
+
class Config
|
3
3
|
class Ability
|
4
|
+
sweetload :Engine, :Modes
|
5
|
+
|
4
6
|
include Singleton
|
5
7
|
include ClassExt
|
6
8
|
|
7
|
-
include CanTango::
|
8
|
-
|
9
|
+
include CanTango::Config::Factory
|
10
|
+
|
11
|
+
def modes
|
12
|
+
Modes.instance
|
13
|
+
end
|
9
14
|
|
10
15
|
def default_executor_class
|
11
16
|
@default_executor_class ||= CanTango::Ability::Executor::Modal
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
module CanTango
|
4
|
+
class Config
|
5
|
+
class Ability
|
6
|
+
# allow either block or direct access
|
7
|
+
# engine(:permission) do |permission|
|
8
|
+
# engine(:permission).config_path
|
9
|
+
def engine name, &block
|
10
|
+
engine = find_engine(name)
|
11
|
+
yield engine if block
|
12
|
+
engine
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def find_engine name
|
18
|
+
raise ArgumentError, "Must be label for an engine" if !name.kind_of_label?
|
19
|
+
name = name.to_s.singularize
|
20
|
+
engines.send(name) if engines.available? name
|
21
|
+
end
|
22
|
+
|
23
|
+
class Engine
|
24
|
+
include Singleton
|
25
|
+
|
26
|
+
def set state = :on
|
27
|
+
raise ArgumentError, "Must be :on or :off" unless !state || [:on, :off].include?(state)
|
28
|
+
@state = state || :on
|
29
|
+
end
|
30
|
+
|
31
|
+
def reset!
|
32
|
+
@state = nil
|
33
|
+
end
|
34
|
+
|
35
|
+
def on?
|
36
|
+
@state == :on
|
37
|
+
end
|
38
|
+
|
39
|
+
def off?
|
40
|
+
!on?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module CanTango
|
2
|
+
class Config
|
3
|
+
class Ability
|
4
|
+
class Modes
|
5
|
+
class Execution < CanTango::Registry::Base
|
6
|
+
include Singleton
|
7
|
+
|
8
|
+
def default
|
9
|
+
@default ||= [:no_cache]
|
10
|
+
end
|
11
|
+
|
12
|
+
def available
|
13
|
+
[:cache, :no_cache]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
module CanTango
|
2
|
-
class
|
3
|
-
class Accounts < Registry::Clazz
|
2
|
+
class Config
|
3
|
+
class Accounts < CanTango::Registry::Clazz
|
4
4
|
include Singleton
|
5
5
|
|
6
6
|
def register_account clazz
|
7
7
|
register account_name(clazz), clazz
|
8
8
|
self
|
9
9
|
end
|
10
|
-
alias_method :register_class, :register_account
|
11
10
|
|
12
11
|
protected
|
13
12
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module CanTango
|
2
|
-
class
|
3
|
-
class Adapters < Registry::Base
|
2
|
+
class Config
|
3
|
+
class Adapters < CanTango::Registry::Base
|
4
4
|
include Singleton
|
5
5
|
|
6
6
|
def adapter name
|
7
|
-
raise "Unknown adapter #{name}" if !
|
7
|
+
raise "Unknown adapter #{name}" if !available.include? name.to_sym
|
8
8
|
require "cantango/adapter/#{name}"
|
9
9
|
end
|
10
10
|
|
@@ -12,7 +12,7 @@ module CanTango
|
|
12
12
|
names.each {|name| adapter name }
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def available
|
16
16
|
[:moneta, :compiler]
|
17
17
|
end
|
18
18
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module CanTango
|
2
|
-
class
|
3
|
-
class Categories < Registry::Hash
|
4
|
-
|
2
|
+
class Config
|
3
|
+
class Categories < CanTango::Registry::Hash
|
5
4
|
include Singleton
|
6
5
|
|
7
6
|
def [] label
|
@@ -11,7 +10,7 @@ module CanTango
|
|
11
10
|
end
|
12
11
|
|
13
12
|
def category label, &block
|
14
|
-
cat = Category.new self[label]
|
13
|
+
cat = CanTango::Category.new self[label]
|
15
14
|
yield cat if block
|
16
15
|
cat
|
17
16
|
end
|