cantango-config 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +40 -0
  4. data/Gemfile.lock +163 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.mdown +21 -0
  7. data/Rakefile +49 -0
  8. data/VERSION +1 -0
  9. data/cantango-config.gemspec +145 -0
  10. data/lib/cantango/adapter/compiler.rb +9 -0
  11. data/lib/cantango/adapter/moneta.rb +23 -0
  12. data/lib/cantango/config.rb +12 -0
  13. data/lib/cantango/configuration/ability.rb +14 -0
  14. data/lib/cantango/configuration/account.rb +23 -0
  15. data/lib/cantango/configuration/accounts.rb +8 -0
  16. data/lib/cantango/configuration/adapters.rb +24 -0
  17. data/lib/cantango/configuration/autoload.rb +38 -0
  18. data/lib/cantango/configuration/candidate_registry.rb +94 -0
  19. data/lib/cantango/configuration/categories.rb +57 -0
  20. data/lib/cantango/configuration/debug.rb +41 -0
  21. data/lib/cantango/configuration/engine.rb +33 -0
  22. data/lib/cantango/configuration/engines.rb +97 -0
  23. data/lib/cantango/configuration/factory.rb +59 -0
  24. data/lib/cantango/configuration/guest.rb +57 -0
  25. data/lib/cantango/configuration/hash_registry.rb +91 -0
  26. data/lib/cantango/configuration/hooks.rb +12 -0
  27. data/lib/cantango/configuration/localhosts.rb +12 -0
  28. data/lib/cantango/configuration/models/actions.rb +26 -0
  29. data/lib/cantango/configuration/models/active_record.rb +22 -0
  30. data/lib/cantango/configuration/models/data_mapper.rb +12 -0
  31. data/lib/cantango/configuration/models/generic.rb +12 -0
  32. data/lib/cantango/configuration/models/mongo.rb +12 -0
  33. data/lib/cantango/configuration/models/mongo_mapper.rb +11 -0
  34. data/lib/cantango/configuration/models/mongoid.rb +13 -0
  35. data/lib/cantango/configuration/models.rb +77 -0
  36. data/lib/cantango/configuration/modes.rb +21 -0
  37. data/lib/cantango/configuration/orms.rb +8 -0
  38. data/lib/cantango/configuration/registry.rb +56 -0
  39. data/lib/cantango/configuration/user.rb +47 -0
  40. data/lib/cantango/configuration/users.rb +8 -0
  41. data/lib/cantango/configuration.rb +99 -0
  42. data/spec/cantango/config_spec.rb +8 -0
  43. data/spec/cantango/configuration/ability_spec.rb +13 -0
  44. data/spec/cantango/configuration/account_spec.rb +21 -0
  45. data/spec/cantango/configuration/accounts_spec.rb +18 -0
  46. data/spec/cantango/configuration/adapters_spec.rb +30 -0
  47. data/spec/cantango/configuration/autoload_spec.rb +52 -0
  48. data/spec/cantango/configuration/candidate_registry_spec.rb +12 -0
  49. data/spec/cantango/configuration/categories_spec.rb +58 -0
  50. data/spec/cantango/configuration/debug_spec.rb +39 -0
  51. data/spec/cantango/configuration/engines/engine_shared.rb +22 -0
  52. data/spec/cantango/configuration/engines_spec.rb +102 -0
  53. data/spec/cantango/configuration/factory_spec.rb +18 -0
  54. data/spec/cantango/configuration/guest/find_guest_default_way_spec.rb +32 -0
  55. data/spec/cantango/configuration/guest_spec.rb +61 -0
  56. data/spec/cantango/configuration/hash_registry_spec.rb +22 -0
  57. data/spec/cantango/configuration/localhosts_spec.rb +9 -0
  58. data/spec/cantango/configuration/models_spec.rb +47 -0
  59. data/spec/cantango/configuration/orms_spec.rb +9 -0
  60. data/spec/cantango/configuration/registry_spec.rb +15 -0
  61. data/spec/cantango/configuration/shared/candidate_registry_ex.rb +47 -0
  62. data/spec/cantango/configuration/shared/factory_ex.rb +40 -0
  63. data/spec/cantango/configuration/shared/hash_registry_ex.rb +55 -0
  64. data/spec/cantango/configuration/shared/modes_ex.rb +14 -0
  65. data/spec/cantango/configuration/shared/registry_ex.rb +40 -0
  66. data/spec/cantango/configuration/shared/role_registry_ex.rb +22 -0
  67. data/spec/cantango/configuration/user_spec.rb +45 -0
  68. data/spec/cantango/configuration/users_spec.rb +18 -0
  69. data/spec/cantango/configuration_spec.rb +112 -0
  70. data/spec/db/database.yml +4 -0
  71. data/spec/factories/project.rb +6 -0
  72. data/spec/fixtures/models/admin.rb +2 -0
  73. data/spec/fixtures/models/admin_account.rb +22 -0
  74. data/spec/fixtures/models/items.rb +8 -0
  75. data/spec/fixtures/models/permission.rb +12 -0
  76. data/spec/fixtures/models/project.rb +2 -0
  77. data/spec/fixtures/models/simple_roles.rb +49 -0
  78. data/spec/fixtures/models/user.rb +52 -0
  79. data/spec/fixtures/models/user_account.rb +21 -0
  80. data/spec/fixtures/models.rb +2 -0
  81. data/spec/migrations/001_create_projects.rb +12 -0
  82. data/spec/spec_helper.rb +35 -0
  83. metadata +231 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,40 @@
1
+ source :rubygems
2
+
3
+ group :default do
4
+ gem 'rails', '>= 3.1'
5
+ gem 'sugar-high', '>= 0.6.0'
6
+ gem 'sweetloader', '~> 0.1.0'
7
+ gem 'hashie'
8
+
9
+ gem 'cantango-core', :git => 'git://github.com/kristianmandrup/cantango-core.git'
10
+ end
11
+
12
+ group :development do
13
+ gem "bundler", ">= 1.1.rc"
14
+ gem "jeweler", ">= 1.6.4"
15
+ gem "rcov", ">= 0"
16
+ end
17
+
18
+ group :test do
19
+ gem 'require_all', '~> 1.2.0'
20
+
21
+ gem 'forgery'
22
+ gem 'sqlite3'
23
+ # Data
24
+ gem 'database_cleaner'
25
+ gem 'factory_girl'
26
+
27
+ # Specs
28
+ gem 'spork'
29
+
30
+ # Debug and performance tests
31
+ gem 'cutter'
32
+
33
+ # Adapters
34
+ gem 'sourcify'
35
+ gem 'dkastner-moneta', '>= 1.0'
36
+ end
37
+
38
+ group :test, :development do
39
+ gem "rspec", ">= 2.6.0"
40
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,163 @@
1
+ GIT
2
+ remote: git://github.com/kristianmandrup/cantango-core.git
3
+ revision: 1eaa3a2ee8a2be798e80e0da7e56e4fb6b30d2b8
4
+ specs:
5
+ cantango-core (1.0.0.beta1)
6
+ cancan (>= 1.4)
7
+ hashie
8
+ rails (>= 3.0.1)
9
+ sugar-high (>= 0.6.0)
10
+ sweetloader (~> 0.1.0)
11
+
12
+ GEM
13
+ remote: http://rubygems.org/
14
+ specs:
15
+ actionmailer (3.1.3)
16
+ actionpack (= 3.1.3)
17
+ mail (~> 2.3.0)
18
+ actionpack (3.1.3)
19
+ activemodel (= 3.1.3)
20
+ activesupport (= 3.1.3)
21
+ builder (~> 3.0.0)
22
+ erubis (~> 2.7.0)
23
+ i18n (~> 0.6)
24
+ rack (~> 1.3.5)
25
+ rack-cache (~> 1.1)
26
+ rack-mount (~> 0.8.2)
27
+ rack-test (~> 0.6.1)
28
+ sprockets (~> 2.0.3)
29
+ activemodel (3.1.3)
30
+ activesupport (= 3.1.3)
31
+ builder (~> 3.0.0)
32
+ i18n (~> 0.6)
33
+ activerecord (3.1.3)
34
+ activemodel (= 3.1.3)
35
+ activesupport (= 3.1.3)
36
+ arel (~> 2.2.1)
37
+ tzinfo (~> 0.3.29)
38
+ activeresource (3.1.3)
39
+ activemodel (= 3.1.3)
40
+ activesupport (= 3.1.3)
41
+ activesupport (3.1.3)
42
+ multi_json (~> 1.0)
43
+ arel (2.2.1)
44
+ builder (3.0.0)
45
+ cancan (1.6.7)
46
+ colorize (0.5.8)
47
+ cutter (0.8.2)
48
+ activesupport (>= 2.3.5)
49
+ colorize (>= 0.5)
50
+ database_cleaner (0.7.0)
51
+ diff-lcs (1.1.3)
52
+ dkastner-moneta (1.2.0)
53
+ erubis (2.7.0)
54
+ factory_girl (2.3.1)
55
+ activesupport
56
+ file-tail (1.0.7)
57
+ tins (~> 0.3)
58
+ forgery (0.5.0)
59
+ git (1.2.5)
60
+ hashie (1.2.0)
61
+ hike (1.2.1)
62
+ i18n (0.6.0)
63
+ jeweler (1.6.4)
64
+ bundler (~> 1.0)
65
+ git (>= 1.2.5)
66
+ rake
67
+ json (1.6.1)
68
+ mail (2.3.0)
69
+ i18n (>= 0.4.0)
70
+ mime-types (~> 1.16)
71
+ treetop (~> 1.4.8)
72
+ mime-types (1.17.2)
73
+ multi_json (1.0.3)
74
+ polyglot (0.3.3)
75
+ rack (1.3.5)
76
+ rack-cache (1.1)
77
+ rack (>= 0.4)
78
+ rack-mount (0.8.3)
79
+ rack (>= 1.0.0)
80
+ rack-ssl (1.3.2)
81
+ rack
82
+ rack-test (0.6.1)
83
+ rack (>= 1.0)
84
+ rails (3.1.3)
85
+ actionmailer (= 3.1.3)
86
+ actionpack (= 3.1.3)
87
+ activerecord (= 3.1.3)
88
+ activeresource (= 3.1.3)
89
+ activesupport (= 3.1.3)
90
+ bundler (~> 1.0)
91
+ railties (= 3.1.3)
92
+ railties (3.1.3)
93
+ actionpack (= 3.1.3)
94
+ activesupport (= 3.1.3)
95
+ rack-ssl (~> 1.3.2)
96
+ rake (>= 0.8.7)
97
+ rdoc (~> 3.4)
98
+ thor (~> 0.14.6)
99
+ rake (0.9.2.2)
100
+ rcov (0.9.11)
101
+ rdoc (3.11)
102
+ json (~> 1.4)
103
+ require_all (1.2.0)
104
+ rspec (2.7.0)
105
+ rspec-core (~> 2.7.0)
106
+ rspec-expectations (~> 2.7.0)
107
+ rspec-mocks (~> 2.7.0)
108
+ rspec-core (2.7.1)
109
+ rspec-expectations (2.7.0)
110
+ diff-lcs (~> 1.1.2)
111
+ rspec-mocks (2.7.0)
112
+ ruby2ruby (1.3.1)
113
+ ruby_parser (~> 2.0)
114
+ sexp_processor (~> 3.0)
115
+ ruby_parser (2.3.1)
116
+ sexp_processor (~> 3.0)
117
+ sexp_processor (3.0.8)
118
+ sourcify (0.5.0)
119
+ file-tail (>= 1.0.5)
120
+ ruby2ruby (>= 1.2.5)
121
+ ruby_parser (>= 2.0.5)
122
+ sexp_processor (>= 3.0.5)
123
+ spork (0.8.5)
124
+ sprockets (2.0.3)
125
+ hike (~> 1.2)
126
+ rack (~> 1.0)
127
+ tilt (~> 1.1, != 1.3.0)
128
+ sqlite3 (1.3.4)
129
+ sugar-high (0.6.0)
130
+ activesupport (>= 3.0.1)
131
+ sweetloader (0.1.1)
132
+ activesupport (>= 3.0.1)
133
+ i18n
134
+ thor (0.14.6)
135
+ tilt (1.3.3)
136
+ tins (0.3.2)
137
+ treetop (1.4.10)
138
+ polyglot
139
+ polyglot (>= 0.3.1)
140
+ tzinfo (0.3.31)
141
+
142
+ PLATFORMS
143
+ ruby
144
+
145
+ DEPENDENCIES
146
+ bundler (>= 1.1.rc)
147
+ cantango-core!
148
+ cutter
149
+ database_cleaner
150
+ dkastner-moneta (>= 1.0)
151
+ factory_girl
152
+ forgery
153
+ hashie
154
+ jeweler (>= 1.6.4)
155
+ rails (>= 3.1)
156
+ rcov
157
+ require_all (~> 1.2.0)
158
+ rspec (>= 2.6.0)
159
+ sourcify
160
+ spork
161
+ sqlite3
162
+ sugar-high (>= 0.6.0)
163
+ sweetloader (~> 0.1.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Kristian Mandrup
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mdown ADDED
@@ -0,0 +1,21 @@
1
+ # Cantango Configuration
2
+
3
+ Configuration for [CanTango](https://github.com/kristianmandrup/cantango)
4
+
5
+ The Configuration DSL has now been almost fully "spec'ed".
6
+
7
+ ## Contributing to cantango-config
8
+
9
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
10
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
11
+ * Fork the project
12
+ * Start a feature/bugfix branch
13
+ * Commit and push until you are happy with your contribution
14
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
15
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
16
+
17
+ ## Copyright
18
+
19
+ Copyright (c) 2011 Kristian Mandrup. See LICENSE.txt for
20
+ further details.
21
+
data/Rakefile ADDED
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "cantango-config"
18
+ gem.homepage = "http://github.com/kristianmandrup/cantango-config"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Configuration for Cantango}
21
+ gem.description = %Q{Configuration DSL for configuring CanTango}
22
+ gem.email = "kmandrup@gmail.com"
23
+ gem.authors = ["Kristian Mandrup"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :default => :spec
40
+
41
+ require 'rdoc/task'
42
+ Rake::RDocTask.new do |rdoc|
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+
45
+ rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.title = "cantango-config #{version}"
47
+ rdoc.rdoc_files.include('README*')
48
+ rdoc.rdoc_files.include('lib/**/*.rb')
49
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,145 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "cantango-config"
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Kristian Mandrup"]
12
+ s.date = "2011-11-25"
13
+ s.description = "Configuration DSL for configuring CanTango"
14
+ s.email = "kmandrup@gmail.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.mdown"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.mdown",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "cantango-config.gemspec",
29
+ "lib/cantango/adapter/compiler.rb",
30
+ "lib/cantango/adapter/moneta.rb",
31
+ "lib/cantango/config.rb",
32
+ "lib/cantango/configuration.rb",
33
+ "lib/cantango/configuration/ability.rb",
34
+ "lib/cantango/configuration/account.rb",
35
+ "lib/cantango/configuration/accounts.rb",
36
+ "lib/cantango/configuration/adapters.rb",
37
+ "lib/cantango/configuration/autoload.rb",
38
+ "lib/cantango/configuration/candidate_registry.rb",
39
+ "lib/cantango/configuration/categories.rb",
40
+ "lib/cantango/configuration/debug.rb",
41
+ "lib/cantango/configuration/engine.rb",
42
+ "lib/cantango/configuration/engines.rb",
43
+ "lib/cantango/configuration/factory.rb",
44
+ "lib/cantango/configuration/guest.rb",
45
+ "lib/cantango/configuration/hash_registry.rb",
46
+ "lib/cantango/configuration/hooks.rb",
47
+ "lib/cantango/configuration/localhosts.rb",
48
+ "lib/cantango/configuration/models.rb",
49
+ "lib/cantango/configuration/models/actions.rb",
50
+ "lib/cantango/configuration/models/active_record.rb",
51
+ "lib/cantango/configuration/models/data_mapper.rb",
52
+ "lib/cantango/configuration/models/generic.rb",
53
+ "lib/cantango/configuration/models/mongo.rb",
54
+ "lib/cantango/configuration/models/mongo_mapper.rb",
55
+ "lib/cantango/configuration/models/mongoid.rb",
56
+ "lib/cantango/configuration/modes.rb",
57
+ "lib/cantango/configuration/orms.rb",
58
+ "lib/cantango/configuration/registry.rb",
59
+ "lib/cantango/configuration/user.rb",
60
+ "lib/cantango/configuration/users.rb",
61
+ "spec/cantango/config_spec.rb",
62
+ "spec/cantango/configuration/ability_spec.rb",
63
+ "spec/cantango/configuration/account_spec.rb",
64
+ "spec/cantango/configuration/accounts_spec.rb",
65
+ "spec/cantango/configuration/adapters_spec.rb",
66
+ "spec/cantango/configuration/autoload_spec.rb",
67
+ "spec/cantango/configuration/candidate_registry_spec.rb",
68
+ "spec/cantango/configuration/categories_spec.rb",
69
+ "spec/cantango/configuration/debug_spec.rb",
70
+ "spec/cantango/configuration/engines/engine_shared.rb",
71
+ "spec/cantango/configuration/engines_spec.rb",
72
+ "spec/cantango/configuration/factory_spec.rb",
73
+ "spec/cantango/configuration/guest/find_guest_default_way_spec.rb",
74
+ "spec/cantango/configuration/guest_spec.rb",
75
+ "spec/cantango/configuration/hash_registry_spec.rb",
76
+ "spec/cantango/configuration/localhosts_spec.rb",
77
+ "spec/cantango/configuration/models_spec.rb",
78
+ "spec/cantango/configuration/orms_spec.rb",
79
+ "spec/cantango/configuration/registry_spec.rb",
80
+ "spec/cantango/configuration/shared/candidate_registry_ex.rb",
81
+ "spec/cantango/configuration/shared/factory_ex.rb",
82
+ "spec/cantango/configuration/shared/hash_registry_ex.rb",
83
+ "spec/cantango/configuration/shared/modes_ex.rb",
84
+ "spec/cantango/configuration/shared/registry_ex.rb",
85
+ "spec/cantango/configuration/shared/role_registry_ex.rb",
86
+ "spec/cantango/configuration/user_spec.rb",
87
+ "spec/cantango/configuration/users_spec.rb",
88
+ "spec/cantango/configuration_spec.rb",
89
+ "spec/db/database.yml",
90
+ "spec/factories/project.rb",
91
+ "spec/fixtures/models.rb",
92
+ "spec/fixtures/models/admin.rb",
93
+ "spec/fixtures/models/admin_account.rb",
94
+ "spec/fixtures/models/items.rb",
95
+ "spec/fixtures/models/permission.rb",
96
+ "spec/fixtures/models/project.rb",
97
+ "spec/fixtures/models/simple_roles.rb",
98
+ "spec/fixtures/models/user.rb",
99
+ "spec/fixtures/models/user_account.rb",
100
+ "spec/migrations/001_create_projects.rb",
101
+ "spec/spec_helper.rb"
102
+ ]
103
+ s.homepage = "http://github.com/kristianmandrup/cantango-config"
104
+ s.licenses = ["MIT"]
105
+ s.require_paths = ["lib"]
106
+ s.rubygems_version = "1.8.10"
107
+ s.summary = "Configuration for Cantango"
108
+
109
+ if s.respond_to? :specification_version then
110
+ s.specification_version = 3
111
+
112
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
113
+ s.add_runtime_dependency(%q<rails>, [">= 3.1"])
114
+ s.add_runtime_dependency(%q<sugar-high>, [">= 0.6.0"])
115
+ s.add_runtime_dependency(%q<sweetloader>, ["~> 0.1.0"])
116
+ s.add_runtime_dependency(%q<hashie>, [">= 0"])
117
+ s.add_runtime_dependency(%q<cantango-core>, [">= 0"])
118
+ s.add_development_dependency(%q<bundler>, [">= 1.1.rc"])
119
+ s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
120
+ s.add_development_dependency(%q<rcov>, [">= 0"])
121
+ s.add_development_dependency(%q<rspec>, [">= 2.6.0"])
122
+ else
123
+ s.add_dependency(%q<rails>, [">= 3.1"])
124
+ s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
125
+ s.add_dependency(%q<sweetloader>, ["~> 0.1.0"])
126
+ s.add_dependency(%q<hashie>, [">= 0"])
127
+ s.add_dependency(%q<cantango-core>, [">= 0"])
128
+ s.add_dependency(%q<bundler>, [">= 1.1.rc"])
129
+ s.add_dependency(%q<jeweler>, [">= 1.6.4"])
130
+ s.add_dependency(%q<rcov>, [">= 0"])
131
+ s.add_dependency(%q<rspec>, [">= 2.6.0"])
132
+ end
133
+ else
134
+ s.add_dependency(%q<rails>, [">= 3.1"])
135
+ s.add_dependency(%q<sugar-high>, [">= 0.6.0"])
136
+ s.add_dependency(%q<sweetloader>, ["~> 0.1.0"])
137
+ s.add_dependency(%q<hashie>, [">= 0"])
138
+ s.add_dependency(%q<cantango-core>, [">= 0"])
139
+ s.add_dependency(%q<bundler>, [">= 1.1.rc"])
140
+ s.add_dependency(%q<jeweler>, [">= 1.6.4"])
141
+ s.add_dependency(%q<rcov>, [">= 0"])
142
+ s.add_dependency(%q<rspec>, [">= 2.6.0"])
143
+ end
144
+ end
145
+
@@ -0,0 +1,9 @@
1
+ # module CanTango
2
+ # class Ability
3
+ # class Cache
4
+ # autoload_modules :Kompiler
5
+ # end
6
+ # end
7
+ # end
8
+
9
+ CanTango.config.adapters.register :compiler
@@ -0,0 +1,23 @@
1
+ require 'moneta'
2
+
3
+ # module CanTango
4
+ # module Cache
5
+ # autoload_modules :MonetaCache
6
+ # end
7
+ # end
8
+ #
9
+ # module CanTango
10
+ # class Ability
11
+ # class Cache
12
+ # autoload_modules :MonetaCache
13
+ # end
14
+ # end
15
+ # end
16
+ #
17
+ # module CanTango
18
+ # class PermissionEngine < Engine
19
+ # autoload_modules :MonetaStore
20
+ # end
21
+ # end
22
+
23
+ CanTango.config.adapters.register :moneta
@@ -0,0 +1,12 @@
1
+ require 'sugar-high/array'
2
+ require 'sugar-high/blank'
3
+ require 'hashie'
4
+ require 'sweetloader'
5
+
6
+ require 'cantango/core'
7
+
8
+ AutoLoader.namespaces = {:CanTango => 'cantango'}
9
+
10
+ module CanTango
11
+ autoload_modules :Configuration
12
+ end
@@ -0,0 +1,14 @@
1
+ module CanTango
2
+ class Configuration
3
+ class Ability
4
+ include Singleton
5
+ include ClassExt
6
+
7
+ include CanTango::Configuration::Factory
8
+ include CanTango::Configuration::Modes
9
+ end
10
+ end
11
+ end
12
+
13
+
14
+
@@ -0,0 +1,23 @@
1
+ module CanTango
2
+ class Configuration
3
+ class Account
4
+ include Singleton
5
+ include ClassExt
6
+
7
+ def clear!
8
+ @clazz = nil
9
+ end
10
+
11
+ def base_class
12
+ @clazz ||= try_class[::UserAccount, ::Account]
13
+ end
14
+
15
+ def base_class= clazz
16
+ raise ArgumentError, "Must be a class, was: #{clazz}" unless is_class? clazz
17
+ @clazz = clazz
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+
@@ -0,0 +1,8 @@
1
+ module CanTango
2
+ class Configuration
3
+ class Accounts < CandidateRegistry
4
+ include Singleton
5
+ end
6
+ end
7
+ end
8
+
@@ -0,0 +1,24 @@
1
+ module CanTango
2
+ class Configuration
3
+ class Adapters < Registry
4
+
5
+ include Singleton
6
+
7
+ def adapter name
8
+ raise "Unknown adapter #{name}" if !available_adapters.include? name.to_sym
9
+ require "cantango/adapter/#{name}"
10
+ end
11
+
12
+ def use *names
13
+ names.each {|name| adapter name }
14
+ end
15
+
16
+ def available_adapters
17
+ [:moneta, :compiler]
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+
24
+
@@ -0,0 +1,38 @@
1
+ module CanTango
2
+ class Configuration
3
+ class Autoload
4
+ include Singleton
5
+
6
+ def clear!
7
+ @models = :on
8
+ @permits = :on
9
+ end
10
+
11
+ [:models, :permits].each do |name|
12
+ # def permission state = nil
13
+ # raise ArgumentError unless [:on, :off].include? state
14
+ # @permission = state
15
+ # end
16
+ class_eval %{
17
+ def #{name} state = nil
18
+ return #{name}? if !state
19
+ raise ArgumentError, "Must be :on or :off" unless [:on, :off].include? state
20
+ @#{name} = state
21
+ end
22
+ }
23
+ # def permits?
24
+ # @permits ||= :on
25
+ # @permits == :on
26
+ # end
27
+ class_eval %{
28
+ def #{name}?
29
+ @#{name} ||= :on
30
+ @#{name} == :on
31
+ end
32
+ }
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+