cantango-config 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/cantango-config.gemspec +14 -14
- data/lib/cantango/configuration/registry/clazz.rb +2 -4
- data/spec/cantango/configuration/users_spec.rb +24 -0
- metadata +22 -22
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
arel (2.2.1)
|
33
33
|
builder (3.0.0)
|
34
34
|
cancan (1.6.7)
|
35
|
-
cantango-core (0.1.
|
35
|
+
cantango-core (0.1.6)
|
36
36
|
cancan (>= 1.4)
|
37
37
|
hashie
|
38
38
|
rails (>= 3.0.1)
|
@@ -139,7 +139,7 @@ PLATFORMS
|
|
139
139
|
|
140
140
|
DEPENDENCIES
|
141
141
|
bundler (>= 1.1.rc)
|
142
|
-
cantango-core (~> 0.1.
|
142
|
+
cantango-core (~> 0.1.6)
|
143
143
|
cutter
|
144
144
|
database_cleaner
|
145
145
|
dkastner-moneta (>= 1.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/cantango-config.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.1.
|
7
|
+
s.name = "cantango-config"
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
11
|
+
s.authors = ["Kristian Mandrup"]
|
12
|
+
s.date = "2011-12-06"
|
13
|
+
s.description = "Configuration DSL for configuring CanTango"
|
14
|
+
s.email = "kmandrup@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.mdown"
|
@@ -108,11 +108,11 @@ Gem::Specification.new do |s|
|
|
108
108
|
"spec/migrations/001_create_projects.rb",
|
109
109
|
"spec/spec_helper.rb"
|
110
110
|
]
|
111
|
-
s.homepage =
|
112
|
-
s.licenses = [
|
113
|
-
s.require_paths = [
|
114
|
-
s.rubygems_version =
|
115
|
-
s.summary =
|
111
|
+
s.homepage = "http://github.com/kristianmandrup/cantango-config"
|
112
|
+
s.licenses = ["MIT"]
|
113
|
+
s.require_paths = ["lib"]
|
114
|
+
s.rubygems_version = "1.8.10"
|
115
|
+
s.summary = "Configuration for Cantango"
|
116
116
|
|
117
117
|
if s.respond_to? :specification_version then
|
118
118
|
s.specification_version = 3
|
@@ -122,7 +122,7 @@ Gem::Specification.new do |s|
|
|
122
122
|
s.add_runtime_dependency(%q<sugar-high>, [">= 0.6.0"])
|
123
123
|
s.add_runtime_dependency(%q<sweetloader>, ["~> 0.1.6"])
|
124
124
|
s.add_runtime_dependency(%q<hashie>, ["~> 0.4.0"])
|
125
|
-
s.add_runtime_dependency(%q<cantango-core>, ["~> 0.1.
|
125
|
+
s.add_runtime_dependency(%q<cantango-core>, ["~> 0.1.6"])
|
126
126
|
s.add_development_dependency(%q<bundler>, [">= 1.1.rc"])
|
127
127
|
s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
|
128
128
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
@@ -132,7 +132,7 @@ Gem::Specification.new do |s|
|
|
132
132
|
s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
|
133
133
|
s.add_dependency(%q<sweetloader>, ["~> 0.1.6"])
|
134
134
|
s.add_dependency(%q<hashie>, ["~> 0.4.0"])
|
135
|
-
s.add_dependency(%q<cantango-core>, ["~> 0.1.
|
135
|
+
s.add_dependency(%q<cantango-core>, ["~> 0.1.6"])
|
136
136
|
s.add_dependency(%q<bundler>, [">= 1.1.rc"])
|
137
137
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
138
138
|
s.add_dependency(%q<rcov>, [">= 0"])
|
@@ -143,7 +143,7 @@ Gem::Specification.new do |s|
|
|
143
143
|
s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
|
144
144
|
s.add_dependency(%q<sweetloader>, ["~> 0.1.6"])
|
145
145
|
s.add_dependency(%q<hashie>, ["~> 0.4.0"])
|
146
|
-
s.add_dependency(%q<cantango-core>, ["~> 0.1.
|
146
|
+
s.add_dependency(%q<cantango-core>, ["~> 0.1.6"])
|
147
147
|
s.add_dependency(%q<bundler>, [">= 1.1.rc"])
|
148
148
|
s.add_dependency(%q<jeweler>, [">= 1.6.4"])
|
149
149
|
s.add_dependency(%q<rcov>, [">= 0"])
|
@@ -44,11 +44,11 @@ module CanTango
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def name_registry
|
47
|
-
NameRegistry.
|
47
|
+
@name_registry ||=NameRegistry.new
|
48
48
|
end
|
49
49
|
|
50
50
|
def class_registry
|
51
|
-
ClassRegistry.
|
51
|
+
@class_registry ||= ClassRegistry.new
|
52
52
|
end
|
53
53
|
|
54
54
|
def value_methods
|
@@ -60,11 +60,9 @@ module CanTango
|
|
60
60
|
end
|
61
61
|
|
62
62
|
class NameRegistry < Registry::Base
|
63
|
-
include Singleton
|
64
63
|
end
|
65
64
|
|
66
65
|
class ClassRegistry < Registry::Base
|
67
|
-
include Singleton
|
68
66
|
|
69
67
|
def types
|
70
68
|
[Class]
|
@@ -7,6 +7,13 @@ end
|
|
7
7
|
class Admin
|
8
8
|
end
|
9
9
|
|
10
|
+
class UserAccount
|
11
|
+
end
|
12
|
+
|
13
|
+
class AdminAccount
|
14
|
+
end
|
15
|
+
|
16
|
+
|
10
17
|
describe CanTango::Configuration::Users do
|
11
18
|
subject { CanTango.config.users }
|
12
19
|
|
@@ -15,4 +22,21 @@ describe CanTango::Configuration::Users do
|
|
15
22
|
{:a => User, :b => Admin}
|
16
23
|
end
|
17
24
|
end
|
25
|
+
|
26
|
+
describe 'no pollution' do
|
27
|
+
let (:config) { CanTango.config }
|
28
|
+
before do
|
29
|
+
config.users.register :user, User
|
30
|
+
config.users.register :admin, Admin
|
31
|
+
|
32
|
+
config.accounts.register :user, UserAccount
|
33
|
+
config.accounts.register :admin, AdminAccount
|
34
|
+
|
35
|
+
config.modes.register :no_cache, CanTango::Ability::Mode::NoCache
|
36
|
+
end
|
37
|
+
|
38
|
+
specify do
|
39
|
+
CanTango.config.modes.registered.should == [:no_cache]
|
40
|
+
end
|
41
|
+
end
|
18
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cantango-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-06 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &905045810 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *905045810
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sugar-high
|
27
|
-
requirement: &
|
27
|
+
requirement: &905045570 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.6.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *905045570
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sweetloader
|
38
|
-
requirement: &
|
38
|
+
requirement: &905045330 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.1.6
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *905045330
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: hashie
|
49
|
-
requirement: &
|
49
|
+
requirement: &905045090 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,21 +54,21 @@ dependencies:
|
|
54
54
|
version: 0.4.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *905045090
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: cantango-core
|
60
|
-
requirement: &
|
60
|
+
requirement: &905044850 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.1.
|
65
|
+
version: 0.1.6
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *905044850
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
|
-
requirement: &
|
71
|
+
requirement: &905044610 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.1.rc
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *905044610
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: jeweler
|
82
|
-
requirement: &
|
82
|
+
requirement: &905044370 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.6.4
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *905044370
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rcov
|
93
|
-
requirement: &
|
93
|
+
requirement: &905044130 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *905044130
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rspec
|
104
|
-
requirement: &
|
104
|
+
requirement: &905043890 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: 2.6.0
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *905043890
|
113
113
|
description: Configuration DSL for configuring CanTango
|
114
114
|
email: kmandrup@gmail.com
|
115
115
|
executables: []
|
@@ -223,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash:
|
226
|
+
hash: -481557709
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
none: false
|
229
229
|
requirements:
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 1.8.
|
235
|
+
rubygems_version: 1.8.10
|
236
236
|
signing_key:
|
237
237
|
specification_version: 3
|
238
238
|
summary: Configuration for Cantango
|