nifty-generators 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/README.rdoc +14 -8
- data/Rakefile +7 -1
- data/features/nifty_authentication.feature +59 -0
- data/features/nifty_config.feature +17 -0
- data/features/nifty_layout.feature +19 -0
- data/features/nifty_scaffold.feature +22 -0
- data/features/step_definitions/common_steps.rb +37 -0
- data/features/step_definitions/rails_setup_steps.rb +6 -0
- data/features/support/env.rb +6 -0
- data/features/support/matchers.rb +7 -0
- data/lib/generators/nifty.rb +15 -0
- data/lib/generators/nifty/authentication/USAGE +50 -0
- data/lib/generators/nifty/authentication/authentication_generator.rb +145 -0
- data/lib/generators/nifty/authentication/templates/authentication.rb +60 -0
- data/lib/generators/nifty/authentication/templates/authlogic_session.rb +2 -0
- data/lib/generators/nifty/authentication/templates/fixtures.yml +24 -0
- data/lib/generators/nifty/authentication/templates/migration.rb +20 -0
- data/lib/generators/nifty/authentication/templates/sessions_controller.rb +45 -0
- data/lib/generators/nifty/authentication/templates/sessions_helper.rb +2 -0
- data/lib/generators/nifty/authentication/templates/tests/rspec/sessions_controller.rb +39 -0
- data/lib/generators/nifty/authentication/templates/tests/rspec/user.rb +83 -0
- data/lib/generators/nifty/authentication/templates/tests/rspec/users_controller.rb +26 -0
- data/lib/generators/nifty/authentication/templates/tests/shoulda/sessions_controller.rb +40 -0
- data/lib/generators/nifty/authentication/templates/tests/shoulda/user.rb +85 -0
- data/lib/generators/nifty/authentication/templates/tests/shoulda/users_controller.rb +27 -0
- data/lib/generators/nifty/authentication/templates/tests/testunit/sessions_controller.rb +36 -0
- data/lib/generators/nifty/authentication/templates/tests/testunit/user.rb +88 -0
- data/lib/generators/nifty/authentication/templates/tests/testunit/users_controller.rb +23 -0
- data/lib/generators/nifty/authentication/templates/user.rb +42 -0
- data/lib/generators/nifty/authentication/templates/users_controller.rb +18 -0
- data/lib/generators/nifty/authentication/templates/users_helper.rb +2 -0
- data/lib/generators/nifty/authentication/templates/views/erb/login.html.erb +30 -0
- data/lib/generators/nifty/authentication/templates/views/erb/signup.html.erb +24 -0
- data/lib/generators/nifty/authentication/templates/views/haml/login.html.haml +30 -0
- data/lib/generators/nifty/authentication/templates/views/haml/signup.html.haml +24 -0
- data/lib/generators/nifty/config/USAGE +23 -0
- data/lib/generators/nifty/config/config_generator.rb +24 -0
- data/lib/generators/nifty/config/templates/config.yml +8 -0
- data/lib/generators/nifty/config/templates/load_config.rb +2 -0
- data/lib/generators/nifty/layout/USAGE +25 -0
- data/lib/generators/nifty/layout/layout_generator.rb +29 -0
- data/lib/generators/nifty/layout/templates/error_messages_helper.rb +23 -0
- data/lib/generators/nifty/layout/templates/layout.html.erb +19 -0
- data/lib/generators/nifty/layout/templates/layout.html.haml +21 -0
- data/lib/generators/nifty/layout/templates/layout_helper.rb +22 -0
- data/lib/generators/nifty/layout/templates/stylesheet.css +75 -0
- data/lib/generators/nifty/layout/templates/stylesheet.sass +66 -0
- data/lib/generators/nifty/scaffold/USAGE +51 -0
- data/lib/generators/nifty/scaffold/scaffold_generator.rb +241 -0
- data/lib/generators/nifty/scaffold/templates/actions/create.rb +9 -0
- data/lib/generators/nifty/scaffold/templates/actions/destroy.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/actions/edit.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/index.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/new.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/show.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/actions/update.rb +9 -0
- data/lib/generators/nifty/scaffold/templates/controller.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/fixtures.yml +9 -0
- data/lib/generators/nifty/scaffold/templates/helper.rb +2 -0
- data/lib/generators/nifty/scaffold/templates/migration.rb +16 -0
- data/lib/generators/nifty/scaffold/templates/model.rb +3 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/create.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/edit.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/index.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/new.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/show.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/actions/update.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/controller.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/tests/rspec/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/create.rb +13 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/index.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/new.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/show.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/update.rb +13 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/controller.rb +5 -0
- data/lib/generators/nifty/scaffold/templates/tests/shoulda/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/create.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/edit.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/index.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/new.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/show.rb +4 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/actions/update.rb +11 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/controller.rb +5 -0
- data/lib/generators/nifty/scaffold/templates/tests/testunit/model.rb +7 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/_form.html.erb +10 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/edit.html.erb +14 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/index.html.erb +29 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/new.html.erb +7 -0
- data/lib/generators/nifty/scaffold/templates/views/erb/show.html.erb +20 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/_form.html.haml +10 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/edit.html.haml +14 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/index.html.haml +25 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/new.html.haml +7 -0
- data/lib/generators/nifty/scaffold/templates/views/haml/show.html.haml +20 -0
- data/rails_generators/nifty_layout/templates/layout.html.erb +1 -1
- data/rails_generators/nifty_scaffold/templates/views/erb/_form.html.erb +1 -1
- data/rails_generators/nifty_scaffold/templates/views/haml/_form.html.haml +1 -1
- metadata +118 -21
- data/lib/nifty_generators.rb +0 -3
@@ -0,0 +1,20 @@
|
|
1
|
+
- title "<%= singular_name.titleize %>"
|
2
|
+
|
3
|
+
<%- for attribute in model_attributes -%>
|
4
|
+
%p
|
5
|
+
%strong <%= attribute.human_name.titleize %>:
|
6
|
+
= @<%= singular_name %>.<%= attribute.name %>
|
7
|
+
<%- end -%>
|
8
|
+
|
9
|
+
%p
|
10
|
+
<%- if action? :edit -%>
|
11
|
+
= link_to "Edit", edit_<%= singular_name %>_path(@<%= singular_name %>)
|
12
|
+
|
|
13
|
+
<%- end -%>
|
14
|
+
<%- if action? :destroy -%>
|
15
|
+
= link_to "Destroy", @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
|
16
|
+
|
|
17
|
+
<%- end -%>
|
18
|
+
<%- if action? :index -%>
|
19
|
+
= link_to "View All", <%= plural_name %>_path
|
20
|
+
<%- end -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html>
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
4
|
<head>
|
5
5
|
<title><%%= h(yield(:title) || "Untitled") %></title>
|
6
6
|
<%%= stylesheet_link_tag '<%= file_name %>' %>
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nifty-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 0.4.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Ryan Bates
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-04-19 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -19,17 +24,110 @@ executables: []
|
|
19
24
|
|
20
25
|
extensions: []
|
21
26
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
24
|
-
- CHANGELOG
|
25
|
-
- LICENSE
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
26
29
|
files:
|
27
|
-
- lib/
|
30
|
+
- lib/generators/nifty/authentication/authentication_generator.rb
|
31
|
+
- lib/generators/nifty/authentication/templates/authentication.rb
|
32
|
+
- lib/generators/nifty/authentication/templates/authlogic_session.rb
|
33
|
+
- lib/generators/nifty/authentication/templates/fixtures.yml
|
34
|
+
- lib/generators/nifty/authentication/templates/migration.rb
|
35
|
+
- lib/generators/nifty/authentication/templates/sessions_controller.rb
|
36
|
+
- lib/generators/nifty/authentication/templates/sessions_helper.rb
|
37
|
+
- lib/generators/nifty/authentication/templates/tests/rspec/sessions_controller.rb
|
38
|
+
- lib/generators/nifty/authentication/templates/tests/rspec/user.rb
|
39
|
+
- lib/generators/nifty/authentication/templates/tests/rspec/users_controller.rb
|
40
|
+
- lib/generators/nifty/authentication/templates/tests/shoulda/sessions_controller.rb
|
41
|
+
- lib/generators/nifty/authentication/templates/tests/shoulda/user.rb
|
42
|
+
- lib/generators/nifty/authentication/templates/tests/shoulda/users_controller.rb
|
43
|
+
- lib/generators/nifty/authentication/templates/tests/testunit/sessions_controller.rb
|
44
|
+
- lib/generators/nifty/authentication/templates/tests/testunit/user.rb
|
45
|
+
- lib/generators/nifty/authentication/templates/tests/testunit/users_controller.rb
|
46
|
+
- lib/generators/nifty/authentication/templates/user.rb
|
47
|
+
- lib/generators/nifty/authentication/templates/users_controller.rb
|
48
|
+
- lib/generators/nifty/authentication/templates/users_helper.rb
|
49
|
+
- lib/generators/nifty/authentication/templates/views/erb/login.html.erb
|
50
|
+
- lib/generators/nifty/authentication/templates/views/erb/signup.html.erb
|
51
|
+
- lib/generators/nifty/authentication/templates/views/haml/login.html.haml
|
52
|
+
- lib/generators/nifty/authentication/templates/views/haml/signup.html.haml
|
53
|
+
- lib/generators/nifty/authentication/USAGE
|
54
|
+
- lib/generators/nifty/config/config_generator.rb
|
55
|
+
- lib/generators/nifty/config/templates/config.yml
|
56
|
+
- lib/generators/nifty/config/templates/load_config.rb
|
57
|
+
- lib/generators/nifty/config/USAGE
|
58
|
+
- lib/generators/nifty/layout/layout_generator.rb
|
59
|
+
- lib/generators/nifty/layout/templates/error_messages_helper.rb
|
60
|
+
- lib/generators/nifty/layout/templates/layout.html.erb
|
61
|
+
- lib/generators/nifty/layout/templates/layout.html.haml
|
62
|
+
- lib/generators/nifty/layout/templates/layout_helper.rb
|
63
|
+
- lib/generators/nifty/layout/templates/stylesheet.css
|
64
|
+
- lib/generators/nifty/layout/templates/stylesheet.sass
|
65
|
+
- lib/generators/nifty/layout/USAGE
|
66
|
+
- lib/generators/nifty/scaffold/scaffold_generator.rb
|
67
|
+
- lib/generators/nifty/scaffold/templates/actions/create.rb
|
68
|
+
- lib/generators/nifty/scaffold/templates/actions/destroy.rb
|
69
|
+
- lib/generators/nifty/scaffold/templates/actions/edit.rb
|
70
|
+
- lib/generators/nifty/scaffold/templates/actions/index.rb
|
71
|
+
- lib/generators/nifty/scaffold/templates/actions/new.rb
|
72
|
+
- lib/generators/nifty/scaffold/templates/actions/show.rb
|
73
|
+
- lib/generators/nifty/scaffold/templates/actions/update.rb
|
74
|
+
- lib/generators/nifty/scaffold/templates/controller.rb
|
75
|
+
- lib/generators/nifty/scaffold/templates/fixtures.yml
|
76
|
+
- lib/generators/nifty/scaffold/templates/helper.rb
|
77
|
+
- lib/generators/nifty/scaffold/templates/migration.rb
|
78
|
+
- lib/generators/nifty/scaffold/templates/model.rb
|
79
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/create.rb
|
80
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/destroy.rb
|
81
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/edit.rb
|
82
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/index.rb
|
83
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/new.rb
|
84
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/show.rb
|
85
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/actions/update.rb
|
86
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/controller.rb
|
87
|
+
- lib/generators/nifty/scaffold/templates/tests/rspec/model.rb
|
88
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/create.rb
|
89
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb
|
90
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/edit.rb
|
91
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/index.rb
|
92
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/new.rb
|
93
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/show.rb
|
94
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/actions/update.rb
|
95
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/controller.rb
|
96
|
+
- lib/generators/nifty/scaffold/templates/tests/shoulda/model.rb
|
97
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/create.rb
|
98
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/destroy.rb
|
99
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/edit.rb
|
100
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/index.rb
|
101
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/new.rb
|
102
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/show.rb
|
103
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/actions/update.rb
|
104
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/controller.rb
|
105
|
+
- lib/generators/nifty/scaffold/templates/tests/testunit/model.rb
|
106
|
+
- lib/generators/nifty/scaffold/templates/views/erb/_form.html.erb
|
107
|
+
- lib/generators/nifty/scaffold/templates/views/erb/edit.html.erb
|
108
|
+
- lib/generators/nifty/scaffold/templates/views/erb/index.html.erb
|
109
|
+
- lib/generators/nifty/scaffold/templates/views/erb/new.html.erb
|
110
|
+
- lib/generators/nifty/scaffold/templates/views/erb/show.html.erb
|
111
|
+
- lib/generators/nifty/scaffold/templates/views/haml/_form.html.haml
|
112
|
+
- lib/generators/nifty/scaffold/templates/views/haml/edit.html.haml
|
113
|
+
- lib/generators/nifty/scaffold/templates/views/haml/index.html.haml
|
114
|
+
- lib/generators/nifty/scaffold/templates/views/haml/new.html.haml
|
115
|
+
- lib/generators/nifty/scaffold/templates/views/haml/show.html.haml
|
116
|
+
- lib/generators/nifty/scaffold/USAGE
|
117
|
+
- lib/generators/nifty.rb
|
28
118
|
- test/test_helper.rb
|
29
119
|
- test/test_nifty_authentication_generator.rb
|
30
120
|
- test/test_nifty_config_generator.rb
|
31
121
|
- test/test_nifty_layout_generator.rb
|
32
122
|
- test/test_nifty_scaffold_generator.rb
|
123
|
+
- features/nifty_authentication.feature
|
124
|
+
- features/nifty_config.feature
|
125
|
+
- features/nifty_layout.feature
|
126
|
+
- features/nifty_scaffold.feature
|
127
|
+
- features/step_definitions/common_steps.rb
|
128
|
+
- features/step_definitions/rails_setup_steps.rb
|
129
|
+
- features/support/env.rb
|
130
|
+
- features/support/matchers.rb
|
33
131
|
- rails_generators/nifty_authentication/lib/insert_commands.rb
|
34
132
|
- rails_generators/nifty_authentication/nifty_authentication_generator.rb
|
35
133
|
- rails_generators/nifty_authentication/templates/authentication.rb
|
@@ -117,40 +215,39 @@ files:
|
|
117
215
|
- rails_generators/nifty_scaffold/templates/views/haml/new.html.haml
|
118
216
|
- rails_generators/nifty_scaffold/templates/views/haml/show.html.haml
|
119
217
|
- rails_generators/nifty_scaffold/USAGE
|
218
|
+
- CHANGELOG
|
120
219
|
- LICENSE
|
121
|
-
- README.rdoc
|
122
220
|
- Rakefile
|
123
|
-
-
|
221
|
+
- README.rdoc
|
124
222
|
has_rdoc: true
|
125
223
|
homepage: http://github.com/ryanb/nifty-generators
|
126
224
|
licenses: []
|
127
225
|
|
128
226
|
post_install_message:
|
129
|
-
rdoc_options:
|
130
|
-
|
131
|
-
- --inline-source
|
132
|
-
- --title
|
133
|
-
- NiftyGenerators
|
134
|
-
- --main
|
135
|
-
- README.rdoc
|
227
|
+
rdoc_options: []
|
228
|
+
|
136
229
|
require_paths:
|
137
230
|
- lib
|
138
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
232
|
requirements:
|
140
233
|
- - ">="
|
141
234
|
- !ruby/object:Gem::Version
|
235
|
+
segments:
|
236
|
+
- 0
|
142
237
|
version: "0"
|
143
|
-
version:
|
144
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
239
|
requirements:
|
146
240
|
- - ">="
|
147
241
|
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
|
242
|
+
segments:
|
243
|
+
- 1
|
244
|
+
- 3
|
245
|
+
- 4
|
246
|
+
version: 1.3.4
|
150
247
|
requirements: []
|
151
248
|
|
152
|
-
rubyforge_project:
|
153
|
-
rubygems_version: 1.3.
|
249
|
+
rubyforge_project: nifty-generators
|
250
|
+
rubygems_version: 1.3.6
|
154
251
|
signing_key:
|
155
252
|
specification_version: 3
|
156
253
|
summary: A collection of useful Rails generator scripts.
|
data/lib/nifty_generators.rb
DELETED