cream 0.7.8 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,14 +18,18 @@ The objective of this project is to
18
18
  * Provide generators that can auto-configure your Rails 3 app with these sub-systems for a given ORM
19
19
 
20
20
  _UPDATE_: 1. Dec 2010
21
- Finally all dependency issues have been resolved.
22
- I have tested the 'full_config' generator in a fresh Rails 3.0.3 app and it seems to be working, at least with ORM = 'mongoid' now.
23
- Time to check with the other ORMs as well and make fixes where needed.
21
+ Rhe 'full_config' generator ha snow been tested in a fresh Rails 3.0.3 app and works with the following orms:
22
+ * active_record
23
+ * mongoid
24
24
 
25
- ## TODO
25
+ I will shortly go through the other ORMs and create Rails 3 demo apps for each with instructions.
26
26
 
27
- The old Demo app [Cream rails 3 app](http://github.com/kristianmandrup/cream-rails3-app) is out of date and needs to be updated!
28
- Any help to create a Demo app is greatly appreciated.
27
+ ## Rails 3 demo apps with Cream
28
+
29
+ The following Rails 3 demo apps use Cream 0.7.7 and above and were created Dec 1. 2010
30
+
31
+ * [Cream app with Active Record](https://github.com/kristianmandrup/cream-app-active_record)
32
+ * [Cream app with Mongoid](https://github.com/kristianmandrup/cream-app-mongoid)
29
33
 
30
34
  ## Status
31
35
 
@@ -118,6 +122,10 @@ Role strategies can be set up using the [Roles Generic](http://github.com/kristi
118
122
  * Mongoid
119
123
  * Couch DB (via SimplyStored)
120
124
 
125
+ _Note_:
126
+ Roles for SimplyStored is "shaky" and works only with the admin_flag strategy. I won't develop more on this particular ORM adapter until requested to do so.
127
+ If you need to use Roles with Couch DB, please help implement this adapter, maybe using another (better?) object-mapping solution for Couch DB.
128
+
121
129
  ### Update
122
130
 
123
131
  The Role systems all ORMs (except SimplyStored which is in progress) have recently been upgraded to take advantage of a new Roles Generic API and archictecture.
data/Rakefile CHANGED
@@ -12,6 +12,8 @@ begin
12
12
  gem.add_development_dependency "generator-spec", ">= 0.7.0"
13
13
  gem.add_development_dependency "rspec-action_view", ">= 0.3.1"
14
14
  gem.add_development_dependency "rails-app-spec", ">= 0.3.0"
15
+ gem.add_development_dependency "devise-spec", ">= 0.1.3"
16
+ gem.add_development_dependency "roles-spec", ">= 0.1.3"
15
17
 
16
18
  gem.add_dependency "require_all", "~> 1.2.0"
17
19
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.8
1
+ 0.7.10
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cream}
8
- s.version = "0.7.8"
8
+ s.version = "0.7.10"
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"]
@@ -133,6 +133,8 @@ Gem::Specification.new do |s|
133
133
  s.add_development_dependency(%q<generator-spec>, [">= 0.7.0"])
134
134
  s.add_development_dependency(%q<rspec-action_view>, [">= 0.3.1"])
135
135
  s.add_development_dependency(%q<rails-app-spec>, [">= 0.3.0"])
136
+ s.add_development_dependency(%q<devise-spec>, [">= 0.1.3"])
137
+ s.add_development_dependency(%q<roles-spec>, [">= 0.1.3"])
136
138
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
137
139
  s.add_runtime_dependency(%q<devise-links>, [">= 0.2.0"])
138
140
  s.add_runtime_dependency(%q<cancan-rest-links>, [">= 0.2.0"])
@@ -160,6 +162,8 @@ Gem::Specification.new do |s|
160
162
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
161
163
  s.add_dependency(%q<rspec-action_view>, [">= 0.3.1"])
162
164
  s.add_dependency(%q<rails-app-spec>, [">= 0.3.0"])
165
+ s.add_dependency(%q<devise-spec>, [">= 0.1.3"])
166
+ s.add_dependency(%q<roles-spec>, [">= 0.1.3"])
163
167
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
164
168
  s.add_dependency(%q<devise-links>, [">= 0.2.0"])
165
169
  s.add_dependency(%q<cancan-rest-links>, [">= 0.2.0"])
@@ -188,6 +192,8 @@ Gem::Specification.new do |s|
188
192
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
189
193
  s.add_dependency(%q<rspec-action_view>, [">= 0.3.1"])
190
194
  s.add_dependency(%q<rails-app-spec>, [">= 0.3.0"])
195
+ s.add_dependency(%q<devise-spec>, [">= 0.1.3"])
196
+ s.add_dependency(%q<roles-spec>, [">= 0.1.3"])
191
197
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
192
198
  s.add_dependency(%q<devise-links>, [">= 0.2.0"])
193
199
  s.add_dependency(%q<cancan-rest-links>, [">= 0.2.0"])
@@ -26,11 +26,13 @@ module Cream
26
26
 
27
27
  class_option :configure, :type => :array, :default => [], :desc => "Which generators to run"
28
28
  class_option :gems, :type => :boolean, :default => true, :desc => "Add gems to gemfile?"
29
+ class_option :migrations, :type => :boolean, :default => false, :desc => "Autorun database migrations?", :aliases => '-m'
29
30
 
30
31
  def main_flow
31
32
  cream_initializer
32
33
  cream_gems if gems?
33
- run_generators
34
+ run_generators
35
+ run_migrations if run_migrations?
34
36
  end
35
37
 
36
38
  # -----------------
@@ -41,6 +43,10 @@ module Cream
41
43
 
42
44
  use_helpers :app, :special, :file
43
45
 
46
+ def run_migrations?
47
+ options[:migrations]
48
+ end
49
+
44
50
  def logfile
45
51
  options[:logfile]
46
52
  end
@@ -59,6 +65,11 @@ module Cream
59
65
  run_permits if configures.include? :permits
60
66
  end
61
67
 
68
+ def run_migrations
69
+ return if orm != 'active_record'
70
+ execute "rake db:migrate"
71
+ end
72
+
62
73
  def run_app
63
74
  rgen "cream:app --orm #{orm}"
64
75
  end
@@ -64,38 +64,39 @@ module Devise
64
64
  rgen 'devise:install'
65
65
  end
66
66
 
67
- def bundle_install #*gems
68
- # run "bundle install #{gems.join(' ')}"
67
+ def bundle_install
69
68
  run "bundle install"
70
69
  end
71
70
 
71
+ def gems_mongo_db
72
+ add_gem 'bson_ext', '1.1.4'
73
+ end
74
+
72
75
  def devise_gems
73
76
  say "Configuring devise gems for #{orm}", :green
74
77
  add_gem 'devise'
75
78
 
76
- orm_gem = nil
77
79
  # Devise ORM integration
78
80
  case orm.to_sym
79
81
  when :mongoid
80
82
  say "Please configure Devise for Mongoid similar to Rails 3 example app: http://github.com/fortuity/rails3-mongoid-devise"
81
83
  add_gem 'mongoid', '2.0.0.beta.19'
82
- add_gem 'bson_ext', '1.1.4'
83
- # copy_mongoid_config
84
+ gems_mongo_db
84
85
  when :mongo_mapper
85
- orm_gem = 'mm-devise'
86
86
  add_gem 'mm-devise'
87
+ gems_mongo_db
87
88
  when :data_mapper
88
- orm_gem = 'dm-devise'
89
89
  add_gem 'dm-devise'
90
90
  when :couch_db
91
- orm_gem = 'devise_couch'
92
91
  add_gem 'devise_couch'
93
92
  say "Please note that Couch DB does not currently have a Roles implementation. Feel free to provide one."
94
93
  say "Look at Roles DataMapper (roles_data_mapper) for an example ;)"
95
94
  else
96
95
  say "Orm #{orm} is not currently supported by Cream. You are most welcome to provide a Cream adapter for that ORM ;)"
97
96
  end
98
- bundle_install #'devise', orm_gem
97
+ clean_gemfile
98
+
99
+ bundle_install
99
100
  if orm.to_sym == :mongoid
100
101
  rgen 'mongoid:config'
101
102
  rgen "devise mongoid"
@@ -160,10 +161,6 @@ module Devise
160
161
  end
161
162
  end
162
163
 
163
- # def copy_mongoid_config
164
- # file File.dirname(__FILE__) + '/mongoid.yml', 'config/mongoid.yml'
165
- # end
166
-
167
164
  def gems?
168
165
  options[:gems]
169
166
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 8
9
- version: 0.7.8
8
+ - 10
9
+ version: 0.7.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -243,8 +243,38 @@ dependencies:
243
243
  prerelease: false
244
244
  version_requirements: *id015
245
245
  - !ruby/object:Gem::Dependency
246
- name: require_all
246
+ name: devise-spec
247
247
  requirement: &id016 !ruby/object:Gem::Requirement
248
+ none: false
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ segments:
253
+ - 0
254
+ - 1
255
+ - 3
256
+ version: 0.1.3
257
+ type: :development
258
+ prerelease: false
259
+ version_requirements: *id016
260
+ - !ruby/object:Gem::Dependency
261
+ name: roles-spec
262
+ requirement: &id017 !ruby/object:Gem::Requirement
263
+ none: false
264
+ requirements:
265
+ - - ">="
266
+ - !ruby/object:Gem::Version
267
+ segments:
268
+ - 0
269
+ - 1
270
+ - 3
271
+ version: 0.1.3
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: *id017
275
+ - !ruby/object:Gem::Dependency
276
+ name: require_all
277
+ requirement: &id018 !ruby/object:Gem::Requirement
248
278
  none: false
249
279
  requirements:
250
280
  - - ~>
@@ -256,10 +286,10 @@ dependencies:
256
286
  version: 1.2.0
257
287
  type: :runtime
258
288
  prerelease: false
259
- version_requirements: *id016
289
+ version_requirements: *id018
260
290
  - !ruby/object:Gem::Dependency
261
291
  name: devise-links
262
- requirement: &id017 !ruby/object:Gem::Requirement
292
+ requirement: &id019 !ruby/object:Gem::Requirement
263
293
  none: false
264
294
  requirements:
265
295
  - - ">="
@@ -271,10 +301,10 @@ dependencies:
271
301
  version: 0.2.0
272
302
  type: :runtime
273
303
  prerelease: false
274
- version_requirements: *id017
304
+ version_requirements: *id019
275
305
  - !ruby/object:Gem::Dependency
276
306
  name: cancan-rest-links
277
- requirement: &id018 !ruby/object:Gem::Requirement
307
+ requirement: &id020 !ruby/object:Gem::Requirement
278
308
  none: false
279
309
  requirements:
280
310
  - - ">="
@@ -286,10 +316,10 @@ dependencies:
286
316
  version: 0.2.0
287
317
  type: :runtime
288
318
  prerelease: false
289
- version_requirements: *id018
319
+ version_requirements: *id020
290
320
  - !ruby/object:Gem::Dependency
291
321
  name: cancan-permits
292
- requirement: &id019 !ruby/object:Gem::Requirement
322
+ requirement: &id021 !ruby/object:Gem::Requirement
293
323
  none: false
294
324
  requirements:
295
325
  - - ">="
@@ -301,10 +331,10 @@ dependencies:
301
331
  version: 0.3.2
302
332
  type: :runtime
303
333
  prerelease: false
304
- version_requirements: *id019
334
+ version_requirements: *id021
305
335
  - !ruby/object:Gem::Dependency
306
336
  name: devise
307
- requirement: &id020 !ruby/object:Gem::Requirement
337
+ requirement: &id022 !ruby/object:Gem::Requirement
308
338
  none: false
309
339
  requirements:
310
340
  - - ">="
@@ -316,10 +346,10 @@ dependencies:
316
346
  version: 1.1.5
317
347
  type: :runtime
318
348
  prerelease: false
319
- version_requirements: *id020
349
+ version_requirements: *id022
320
350
  - !ruby/object:Gem::Dependency
321
351
  name: cancan
322
- requirement: &id021 !ruby/object:Gem::Requirement
352
+ requirement: &id023 !ruby/object:Gem::Requirement
323
353
  none: false
324
354
  requirements:
325
355
  - - ">="
@@ -331,10 +361,10 @@ dependencies:
331
361
  version: 1.4.0
332
362
  type: :runtime
333
363
  prerelease: false
334
- version_requirements: *id021
364
+ version_requirements: *id023
335
365
  - !ruby/object:Gem::Dependency
336
366
  name: rails
337
- requirement: &id022 !ruby/object:Gem::Requirement
367
+ requirement: &id024 !ruby/object:Gem::Requirement
338
368
  none: false
339
369
  requirements:
340
370
  - - ">="
@@ -346,10 +376,10 @@ dependencies:
346
376
  version: 3.0.1
347
377
  type: :runtime
348
378
  prerelease: false
349
- version_requirements: *id022
379
+ version_requirements: *id024
350
380
  - !ruby/object:Gem::Dependency
351
381
  name: rails3_artifactor
352
- requirement: &id023 !ruby/object:Gem::Requirement
382
+ requirement: &id025 !ruby/object:Gem::Requirement
353
383
  none: false
354
384
  requirements:
355
385
  - - ~>
@@ -361,10 +391,10 @@ dependencies:
361
391
  version: 0.3.1
362
392
  type: :runtime
363
393
  prerelease: false
364
- version_requirements: *id023
394
+ version_requirements: *id025
365
395
  - !ruby/object:Gem::Dependency
366
396
  name: logging_assist
367
- requirement: &id024 !ruby/object:Gem::Requirement
397
+ requirement: &id026 !ruby/object:Gem::Requirement
368
398
  none: false
369
399
  requirements:
370
400
  - - ~>
@@ -376,10 +406,10 @@ dependencies:
376
406
  version: 0.1.6
377
407
  type: :runtime
378
408
  prerelease: false
379
- version_requirements: *id024
409
+ version_requirements: *id026
380
410
  - !ruby/object:Gem::Dependency
381
411
  name: r3_plugin_toolbox
382
- requirement: &id025 !ruby/object:Gem::Requirement
412
+ requirement: &id027 !ruby/object:Gem::Requirement
383
413
  none: false
384
414
  requirements:
385
415
  - - ">="
@@ -391,10 +421,10 @@ dependencies:
391
421
  version: 0.4.0
392
422
  type: :runtime
393
423
  prerelease: false
394
- version_requirements: *id025
424
+ version_requirements: *id027
395
425
  - !ruby/object:Gem::Dependency
396
426
  name: sugar-high
397
- requirement: &id026 !ruby/object:Gem::Requirement
427
+ requirement: &id028 !ruby/object:Gem::Requirement
398
428
  none: false
399
429
  requirements:
400
430
  - - ~>
@@ -406,7 +436,7 @@ dependencies:
406
436
  version: 0.3.0
407
437
  type: :runtime
408
438
  prerelease: false
409
- version_requirements: *id026
439
+ version_requirements: *id028
410
440
  description: Provides assistance for setting up Session, Role and Permission systems for a Rails 3 app. Support for multiple ORMs
411
441
  email: kmandrup@gmail.com
412
442
  executables: []