cream 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -20,7 +20,7 @@ group :default do
20
20
  end
21
21
 
22
22
  group :test do
23
- gem "rspec", "~> 2.0.0.beta.22"
23
+ gem "rspec", ">= 2.0.0.rc"
24
24
  gem "generator-spec", "~> 0.6.5"
25
25
  gem "rspec-action_view", "~> 0.3.1"
26
26
  gem "rails-app-spec", "~> 0.2.14"
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ begin
8
8
  gem.homepage = "http://github.com/kristianmandrup/devise-assistant"
9
9
  gem.authors = ["Kristian Mandrup"]
10
10
 
11
- gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
11
+ gem.add_development_dependency "rspec", ">= 2.0.0.rc"
12
12
  gem.add_development_dependency "generator-spec", "~> 0.6.5"
13
13
  gem.add_development_dependency "rspec-action_view", "~> 0.3.1"
14
14
  gem.add_development_dependency "rails-app-spec", "~> 0.2.14"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cream}
8
- s.version = "0.6.3"
8
+ s.version = "0.6.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-10-05}
12
+ s.date = %q{2010-10-07}
13
13
  s.description = %q{Provides assistance for setting up Session, Role and Permission systems for a Rails 3 app. Support for multiple ORMs}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -75,6 +75,7 @@ Gem::Specification.new do |s|
75
75
  "spec/cream/view/host_area_spec.rb",
76
76
  "spec/cream/view/role_area_spec.rb",
77
77
  "spec/generator_spec_helper.rb",
78
+ "spec/generators/cream/config/CONFIG_GENERATOR_SPEC.markdown",
78
79
  "spec/generators/cream/config/devise/existing_devise_users.rb",
79
80
  "spec/generators/cream/config/empty_app/default_args_spec.rb",
80
81
  "spec/generators/cream/config/permits/existing_permits_spec.rb",
@@ -125,7 +126,7 @@ Gem::Specification.new do |s|
125
126
  s.specification_version = 3
126
127
 
127
128
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
128
- s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
129
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0.rc"])
129
130
  s.add_development_dependency(%q<generator-spec>, ["~> 0.6.5"])
130
131
  s.add_development_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
131
132
  s.add_development_dependency(%q<rails-app-spec>, ["~> 0.2.14"])
@@ -141,7 +142,7 @@ Gem::Specification.new do |s|
141
142
  s.add_runtime_dependency(%q<r3_plugin_toolbox>, ["~> 0.3.6"])
142
143
  s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.10"])
143
144
  else
144
- s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
145
+ s.add_dependency(%q<rspec>, [">= 2.0.0.rc"])
145
146
  s.add_dependency(%q<generator-spec>, ["~> 0.6.5"])
146
147
  s.add_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
147
148
  s.add_dependency(%q<rails-app-spec>, ["~> 0.2.14"])
@@ -158,7 +159,7 @@ Gem::Specification.new do |s|
158
159
  s.add_dependency(%q<sugar-high>, ["~> 0.2.10"])
159
160
  end
160
161
  else
161
- s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
162
+ s.add_dependency(%q<rspec>, [">= 2.0.0.rc"])
162
163
  s.add_dependency(%q<generator-spec>, ["~> 0.6.5"])
163
164
  s.add_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
164
165
  s.add_dependency(%q<rails-app-spec>, ["~> 0.2.14"])
@@ -37,13 +37,21 @@ module Cream::Generators
37
37
 
38
38
  class_option :logfile, :type => :string, :default => nil, :desc => "Logfile location"
39
39
 
40
+ class_option :app_config, :type => :boolean, :default => true, :desc => "Make Rails app ready for Cream"
41
+ class_option :cream_config, :type => :boolean, :default => true, :desc => "Configure app with Cream"
42
+ class_option :devise_config, :type => :boolean, :default => true, :desc => "Configure app with Devise"
43
+ class_option :devise_user_config, :type => :boolean, :default => true, :desc => "Configure app with Devise Users"
44
+ class_option :cancan_config, :type => :boolean, :default => true, :desc => "Configure app with CanCan"
45
+ class_option :permits_config, :type => :boolean, :default => true, :desc => "Configure app with Permits"
46
+ class_option :roles_config, :type => :boolean, :default => true, :desc => "Configure app with Roles"
47
+
40
48
  def main_flow
41
49
  configure_logger
42
50
  configure_gems
43
51
 
44
52
  MODULES.each do |name|
45
53
  method = "configure_#{name}"
46
- send method if respond_to?(method)
54
+ send method if respond_to?(method) && options[:"#{name}_config"]
47
55
  end
48
56
  end
49
57
 
@@ -70,7 +78,7 @@ module Cream::Generators
70
78
  def configure_gems
71
79
  MODULES.each do |name|
72
80
  method = "#{name}_gems"
73
- send method if respond_to?(method)
81
+ send method if respond_to?(method) && options[:"#{name}_config"]
74
82
  end
75
83
  run "bundle install"
76
84
  end
@@ -9,7 +9,7 @@ module Cream::Generators
9
9
 
10
10
  def roles_gems
11
11
  gem "roles_#{orm}"
12
- end
12
+ end
13
13
 
14
14
  def create_roles
15
15
  rgen "#{roles_generator} --strategy #{strategy} --roles #{roles} #{default_roles}"
@@ -0,0 +1,15 @@
1
+ # Cream Config Generator spec Design Notes
2
+
3
+ The Cream Config generator is very complex and is designed various Session, Permission and Roles aspects encapsulated by Cream.
4
+
5
+ ## Modular architecture
6
+
7
+ In order to achieve this, a modular Generator approach is used. Each module has responsibility to set up a particular aspect of Cream.
8
+ When running the generator, this modular architecture can be leveraged, so that specific parts of the generation process can be run and not others.
9
+
10
+ ## Specs
11
+
12
+ This also makes it easier to test the functionality of the generator, as a single module can be tested in isolation or in combination with one or more other modules.
13
+
14
+
15
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 3
9
- version: 0.6.3
8
+ - 4
9
+ version: 0.6.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-05 00:00:00 +02:00
17
+ date: 2010-10-07 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -23,15 +23,14 @@ dependencies:
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
- - - ~>
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  segments:
29
29
  - 2
30
30
  - 0
31
31
  - 0
32
- - beta
33
- - 22
34
- version: 2.0.0.beta.22
32
+ - rc
33
+ version: 2.0.0.rc
35
34
  type: :development
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
@@ -312,6 +311,7 @@ files:
312
311
  - spec/cream/view/host_area_spec.rb
313
312
  - spec/cream/view/role_area_spec.rb
314
313
  - spec/generator_spec_helper.rb
314
+ - spec/generators/cream/config/CONFIG_GENERATOR_SPEC.markdown
315
315
  - spec/generators/cream/config/devise/existing_devise_users.rb
316
316
  - spec/generators/cream/config/empty_app/default_args_spec.rb
317
317
  - spec/generators/cream/config/permits/existing_permits_spec.rb