model_security_generator 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/model_security_generator.rb +71 -0
  2. metadata +2 -1
@@ -0,0 +1,71 @@
1
+ class ModelSecurityGenerator < Rails::Generator::NamedBase
2
+ def manifest
3
+ record do |m|
4
+ # Check for class naming collisions.
5
+ m.class_collisions class_path, "User", "UserController", "UserMailer",
6
+ "UserSupport", "Modal", "ModalHelper", "ModelSecurity",
7
+ "ModelSecurityHelper"
8
+
9
+ # Libraries
10
+ m.file "lib/modal.rb", "lib/modal.rb"
11
+ m.file "lib/model_security.rb", "lib/model_security.rb"
12
+ m.file "lib/once.rb", "lib/once.rb"
13
+ m.file "lib/user_support.rb", "lib/user_support.rb"
14
+
15
+ # Helpers
16
+ m.file "helpers/modal_helper.rb", "app/helpers/modal_helper.rb"
17
+ m.file "helpers/model_security_helper.rb", "app/helpers/model_security_helper.rb"
18
+
19
+ # User
20
+ m.file "models/user.rb", "app/models/user.rb"
21
+ m.file "controllers/user_controller.rb", "app/controllers/user_controller.rb"
22
+
23
+ # User mailer
24
+ m.file "models/user_mailer.rb", "app/models/user_mailer.rb"
25
+
26
+ # Testing related stuff
27
+ m.file "test/user_controller_test.rb",
28
+ "test/functional/user_controller_test.rb"
29
+ m.file "test/user_test.rb", "test/unit/user_test.rb"
30
+ m.file "test/mock_mailer.rb", "test/mocks/test/user_mailer.rb"
31
+ m.file "test/mock_time.rb", "test/mocks/test/time.rb"
32
+ m.file "test/users.yml", "test/fixtures/users.yml"
33
+
34
+ # Schemas, configuration and miscellaneous
35
+ m.file "db/demo.sql", "db/demo.sql"
36
+ m.file "db/users.sql", "db/users.sql"
37
+
38
+ # Layout and stylesheet.
39
+
40
+ # Views
41
+ m.directory "app/views/user"
42
+ user_views.each do |action|
43
+ m.file "views/#{action}.rhtml", "app/views/user/#{action}.rhtml"
44
+ end
45
+
46
+ # Partials
47
+ m.directory "app/views/user"
48
+ partial_views.each do |action|
49
+ m.file "views/_#{action}.rhtml", "app/views/user/_#{action}.rhtml"
50
+ end
51
+
52
+ # Mailer
53
+ m.directory "app/views/user_mailer"
54
+ mailer_views.each do |action|
55
+ m.file "mailer/#{action}.rhtml", "app/views/user_mailer/#{action}.rhtml"
56
+ end
57
+ end
58
+ end
59
+
60
+ def user_views
61
+ %w(activate admin_created created edit forgot_password_done list login login_admin logout new show success)
62
+ end
63
+
64
+ def partial_views
65
+ %w(form)
66
+ end
67
+
68
+ def mailer_views
69
+ %w(forgot_password new_user)
70
+ end
71
+ end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: model_security_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.2
6
+ version: 0.0.3
7
7
  date: 2005-09-23
8
8
  summary: "[Rails] Model security and authentication generator."
9
9
  require_paths:
@@ -28,6 +28,7 @@ authors:
28
28
  - Bruce Perens
29
29
  - Joe Hosteny
30
30
  files:
31
+ - model_security_generator.rb
31
32
  - templates/README
32
33
  - templates/USAGE
33
34
  - templates/controllers/user_controller.rb