rubaidh-generators 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +8 -0
- data/Rakefile +29 -0
- data/TODO +11 -0
- data/bin/rubaidh_rails +11 -0
- data/generators/rubaidh_controller/USAGE +31 -0
- data/generators/rubaidh_controller/rubaidh_controller_generator.rb +40 -0
- data/generators/rubaidh_controller/templates/controller.rb +17 -0
- data/generators/rubaidh_controller/templates/controller_spec.rb +29 -0
- data/generators/rubaidh_controller/templates/view.html.erb +2 -0
- data/generators/rubaidh_helper/USAGE +23 -0
- data/generators/rubaidh_helper/rubaidh_helper_generator.rb +27 -0
- data/generators/rubaidh_helper/templates/helper.rb +12 -0
- data/generators/rubaidh_helper/templates/helper_spec.rb +14 -0
- data/generators/rubaidh_model/USAGE +25 -0
- data/generators/rubaidh_model/rubaidh_model_generator.rb +29 -0
- data/generators/rubaidh_model/templates/migration.rb +25 -0
- data/generators/rubaidh_model/templates/model.rb +15 -0
- data/generators/rubaidh_model/templates/model_exemplar.rb +13 -0
- data/generators/rubaidh_model/templates/model_spec.rb +31 -0
- data/generators/rubaidh_named_base.rb +31 -0
- data/generators/rubaidh_scaffold/USAGE +29 -0
- data/generators/rubaidh_scaffold/rubaidh_scaffold_generator.rb +90 -0
- data/generators/rubaidh_scaffold/templates/controller.rb +76 -0
- data/generators/rubaidh_scaffold/templates/controller_spec.rb +251 -0
- data/generators/rubaidh_scaffold/templates/partial_form.html.erb +13 -0
- data/generators/rubaidh_scaffold/templates/partial_layout.html.erb +13 -0
- data/generators/rubaidh_scaffold/templates/partial_model.html.erb +8 -0
- data/generators/rubaidh_scaffold/templates/routing_spec.rb +73 -0
- data/generators/rubaidh_scaffold/templates/view_edit.html.erb +6 -0
- data/generators/rubaidh_scaffold/templates/view_index.html.erb +5 -0
- data/generators/rubaidh_scaffold/templates/view_new.html.erb +5 -0
- data/generators/rubaidh_scaffold/templates/view_show.html.erb +11 -0
- data/generators.gemspec +52 -0
- data/templates/rubaidh.rb +82 -0
- metadata +97 -0
@@ -0,0 +1,251 @@
|
|
1
|
+
# <%= class_name %> Controller Spec
|
2
|
+
#
|
3
|
+
# Created on <%= Time.now.to_s :long %> by <%= user_full_name %> as part
|
4
|
+
# of the "<%= project_name %>" project.
|
5
|
+
#
|
6
|
+
#--
|
7
|
+
# Copyright (c) 2006-<%= Time.now.year %> Rubaidh Ltd. All rights reserved.
|
8
|
+
# See LICENSE in the top level source code folder for permissions.
|
9
|
+
#++
|
10
|
+
|
11
|
+
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
|
12
|
+
|
13
|
+
describe <%= controller_class_name %>Controller do
|
14
|
+
def mock_<%= file_name %>(stubs={})
|
15
|
+
@mock_<%= file_name %> ||= mock_model(<%= class_name %>, stubs)
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "responding to GET index" do
|
19
|
+
before(:each) do
|
20
|
+
@<%= table_name %> = [mock_<%= file_name %>]
|
21
|
+
<%= class_name %>.stub!(:find).and_return(@<%= table_name %>)
|
22
|
+
end
|
23
|
+
|
24
|
+
def do_get
|
25
|
+
get :index
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should be successful" do
|
29
|
+
do_get
|
30
|
+
response.should be_success
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should render the index template" do
|
34
|
+
do_get
|
35
|
+
response.should render_template(:index)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should query the model for a list of <%= table_name %>" do
|
39
|
+
<%= class_name %>.should_receive(:find).with(:all).and_return([mock_<%= file_name %>])
|
40
|
+
do_get
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should expose all <%= table_name %> as @<%= table_name %>" do
|
44
|
+
do_get
|
45
|
+
assigns[:<%= table_name %>].should == [mock_<%= file_name %>]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "responding to GET show" do
|
50
|
+
before(:each) do
|
51
|
+
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>)
|
52
|
+
end
|
53
|
+
|
54
|
+
def do_get
|
55
|
+
get :show, :id => "37"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should be successful" do
|
59
|
+
do_get
|
60
|
+
response.should be_success
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should render the show template" do
|
64
|
+
do_get
|
65
|
+
response.should render_template(:show)
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should query the model for the requested <%= file_name %>" do
|
69
|
+
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
70
|
+
do_get
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should expose the requested <%= file_name %> as @<%= file_name %>" do
|
74
|
+
do_get
|
75
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "responding to GET new" do
|
80
|
+
before(:each) do
|
81
|
+
<%= class_name %>.stub!(:new).and_return(mock_<%= file_name %>)
|
82
|
+
end
|
83
|
+
|
84
|
+
def do_get
|
85
|
+
get :new
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should ask the model for a new <%= file_name %>" do
|
89
|
+
<%= class_name %>.should_receive(:new).and_return(mock_<%= file_name %>)
|
90
|
+
do_get
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should expose a new <%= file_name %> as @<%= file_name %>" do
|
94
|
+
do_get
|
95
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
describe "responding to GET edit" do
|
100
|
+
before(:each) do
|
101
|
+
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>)
|
102
|
+
end
|
103
|
+
|
104
|
+
def do_get
|
105
|
+
get :edit, :id => "37"
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should be successful" do
|
109
|
+
do_get
|
110
|
+
response.should be_success
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should render the edit template" do
|
114
|
+
do_get
|
115
|
+
response.should render_template(:edit)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should query the model for the requested <%= file_name %>" do
|
119
|
+
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
120
|
+
do_get
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should expose the requested <%= file_name %> as @<%= file_name %>" do
|
124
|
+
do_get
|
125
|
+
assigns[:<%= file_name %>].should equal(mock_<%= file_name %>)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe "responding to POST create" do
|
130
|
+
before(:each) do
|
131
|
+
<%= class_name %>.stub!(:new).and_return(mock_<%= file_name %>)
|
132
|
+
mock_<%= file_name %>.stub!(:save)
|
133
|
+
end
|
134
|
+
|
135
|
+
def do_post
|
136
|
+
post :create, :<%= file_name %> => { "dummy" => "parameters" }
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should build a new <%= file_name %> with the supplied parameters" do
|
140
|
+
<%= class_name %>.should_receive(:new).with({ "dummy" => "parameters" })
|
141
|
+
do_post
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should attempt to save the new <%= file_name %>" do
|
145
|
+
mock_<%= file_name %>.should_receive(:save)
|
146
|
+
do_post
|
147
|
+
end
|
148
|
+
|
149
|
+
describe "with valid params" do
|
150
|
+
before(:each) do
|
151
|
+
mock_<%= file_name %>.stub!(:save).and_return(true)
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should redirect to the created <%= file_name %>" do
|
155
|
+
do_post
|
156
|
+
response.should redirect_to(<%= file_name %>_url(mock_<%= file_name %>))
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
describe "with invalid params" do
|
161
|
+
before(:each) do
|
162
|
+
mock_<%= file_name %>.stub!(:save).and_return(false)
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should expose a newly created but unsaved <%= file_name %> as @<%= file_name %>" do
|
166
|
+
do_post
|
167
|
+
assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should re-render the 'new' template" do
|
171
|
+
do_post
|
172
|
+
response.should render_template(:new)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
describe "responding to PUT udpate" do
|
178
|
+
before(:each) do
|
179
|
+
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>)
|
180
|
+
mock_<%= file_name %>.stub!(:update_attributes)
|
181
|
+
end
|
182
|
+
|
183
|
+
def do_put
|
184
|
+
put :update, :id => "37", :<%= file_name %> => { "dummy" => "parameters" }
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should query the model for the requested <%= file_name %>" do
|
188
|
+
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
189
|
+
do_put
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should attempt to update the attributes of the requested <%= file_name %>" do
|
193
|
+
mock_<%= file_name %>.should_receive(:update_attributes).with({ "dummy" => "parameters" })
|
194
|
+
do_put
|
195
|
+
end
|
196
|
+
|
197
|
+
describe "with valid params" do
|
198
|
+
before(:each) do
|
199
|
+
mock_<%= file_name %>.stub!(:update_attributes).and_return(true)
|
200
|
+
end
|
201
|
+
|
202
|
+
it "should redirect to the <%= file_name %>" do
|
203
|
+
do_put
|
204
|
+
response.should redirect_to(<%= file_name %>_url(mock_<%= file_name %>))
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
describe "with invalid params" do
|
209
|
+
before(:each) do
|
210
|
+
mock_<%= file_name %>.stub!(:update_attributes).and_return(false)
|
211
|
+
end
|
212
|
+
|
213
|
+
it "should expose the <%= file_name %> as @<%= file_name %>" do
|
214
|
+
do_put
|
215
|
+
assigns(:<%= file_name %>).should equal(mock_<%= file_name %>)
|
216
|
+
end
|
217
|
+
|
218
|
+
it "should re-render the 'edit' template" do
|
219
|
+
do_put
|
220
|
+
response.should render_template(:edit)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
|
226
|
+
describe "responding to DELETE destroy" do
|
227
|
+
before(:each) do
|
228
|
+
<%= class_name %>.stub!(:find).and_return(mock_<%= file_name %>)
|
229
|
+
mock_<%= file_name %>.stub!(:destroy)
|
230
|
+
end
|
231
|
+
|
232
|
+
def do_delete(params = {})
|
233
|
+
delete :destroy, { :id => "37" }.merge(params)
|
234
|
+
end
|
235
|
+
|
236
|
+
it "should query the model for the requested <%= file_name %>" do
|
237
|
+
<%= class_name %>.should_receive(:find).with("37").and_return(mock_<%= file_name %>)
|
238
|
+
do_delete
|
239
|
+
end
|
240
|
+
|
241
|
+
it "should destroy the requested <%= file_name %>" do
|
242
|
+
mock_<%= file_name %>.should_receive(:destroy)
|
243
|
+
do_delete
|
244
|
+
end
|
245
|
+
|
246
|
+
it "should redirect to the <%= table_name %> index action" do
|
247
|
+
do_delete
|
248
|
+
response.should redirect_to(<%= table_name %>_url)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%% form_for(<%= singular_name %>) do |f| %>
|
2
|
+
<%%= f.error_messages %>
|
3
|
+
|
4
|
+
<% for attribute in attributes -%>
|
5
|
+
<p>
|
6
|
+
<%%= f.label :<%= attribute.name %> %><br />
|
7
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
8
|
+
</p>
|
9
|
+
<% end -%>
|
10
|
+
<p>
|
11
|
+
<%%= f.submit <%= singular_name %>.new_record? ? "Create" : "Update" %>
|
12
|
+
</p>
|
13
|
+
<%% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<tr>
|
2
|
+
<% for attribute in attributes -%>
|
3
|
+
<td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
|
4
|
+
<% end -%>
|
5
|
+
<td><%%= link_to 'Show', <%= singular_name %> %></td>
|
6
|
+
<td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
|
7
|
+
<td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
|
8
|
+
</tr>
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# <%= class_name %> Controller Spec
|
2
|
+
#
|
3
|
+
# Created on <%= Time.now.to_s :long %> by <%= user_full_name %> as part
|
4
|
+
# of the "<%= project_name %>" project.
|
5
|
+
#
|
6
|
+
#--
|
7
|
+
# Copyright (c) 2006-<%= Time.now.year %> Rubaidh Ltd. All rights reserved.
|
8
|
+
# See LICENSE in the top level source code folder for permissions.
|
9
|
+
#++
|
10
|
+
|
11
|
+
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
|
12
|
+
|
13
|
+
describe <%= controller_class_name %>Controller do
|
14
|
+
describe "route generation" do
|
15
|
+
it "should map #index" do
|
16
|
+
route_for(:controller => "<%= table_name %>", :action => "index").should == "/<%= table_name %>"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should map #new" do
|
20
|
+
route_for(:controller => "<%= table_name %>", :action => "new").should == "/<%= table_name %>/new"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should map #create" do
|
24
|
+
route_for(:controller => "<%= table_name %>", :action => "create").should == { :path => "/<%= table_name %>", :method => :post }
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should map #show" do
|
28
|
+
route_for(:controller => "<%= table_name %>", :action => "show", :id => "1").should == "/<%= table_name %>/1"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should map #edit" do
|
32
|
+
route_for(:controller => "<%= table_name %>", :action => "edit", :id => "1").should == "/<%= table_name %>/1/edit"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should map #update" do
|
36
|
+
route_for(:controller => "<%= table_name %>", :action => "update", :id => "1").should == { :path => "/<%= table_name %>/1", :method => :put }
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should map #destroy" do
|
40
|
+
route_for(:controller => "<%= table_name %>", :action => "destroy", :id => "1").should == { :path => "/<%= table_name %>/1", :method => :delete }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "route recognition" do
|
45
|
+
it "should generate params for #index" do
|
46
|
+
params_from(:get, "/<%= table_name %>").should == {:controller => "<%= table_name %>", :action => "index"}
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should generate params for #new" do
|
50
|
+
params_from(:get, "/<%= table_name %>/new").should == {:controller => "<%= table_name %>", :action => "new"}
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should generate params for #create" do
|
54
|
+
params_from(:post, "/<%= table_name %>").should == {:controller => "<%= table_name %>", :action => "create"}
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should generate params for #show" do
|
58
|
+
params_from(:get, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "show", :id => "1"}
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should generate params for #edit" do
|
62
|
+
params_from(:get, "/<%= table_name %>/1/edit").should == {:controller => "<%= table_name %>", :action => "edit", :id => "1"}
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should generate params for #update" do
|
66
|
+
params_from(:put, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "update", :id => "1"}
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should generate params for #destroy" do
|
70
|
+
params_from(:delete, "/<%= table_name %>/1").should == {:controller => "<%= table_name %>", :action => "destroy", :id => "1"}
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1>Showing <%= singular_name.humanize %></h1>
|
2
|
+
|
3
|
+
<% attributes.each do |attribute| -%>
|
4
|
+
<dl>
|
5
|
+
<dt><%= attribute.column.human_name %></dt>
|
6
|
+
<dd><%%=h @<%= singular_name %>.<%= attribute.name %> %></dd>
|
7
|
+
</dl>
|
8
|
+
|
9
|
+
<% end -%>
|
10
|
+
<p><%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
|
11
|
+
<%%= link_to 'Back', <%= plural_name %>_path %></p>
|
data/generators.gemspec
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = 'generators'
|
3
|
+
s.version = '1.0.1'
|
4
|
+
s.date = '2009-02-13'
|
5
|
+
s.authors = ['Graeme Mathieson', 'Rubaidh Ltd']
|
6
|
+
s.email = 'support@rubaidh.com'
|
7
|
+
s.rubyforge_project = 'rubaidh'
|
8
|
+
s.homepage = 'http://rubaidh.com/portfolio/open-source'
|
9
|
+
s.summary = '[Rails] Generators for building Ruby on Rails projects the Rubaidh Way'
|
10
|
+
|
11
|
+
s.description = 'Generators for building Ruby on Rails projects the Rubaidh Way'
|
12
|
+
|
13
|
+
s.files = %w(
|
14
|
+
.gitignore MIT-LICENSE Rakefile README.rdoc TODO generators.gemspec
|
15
|
+
bin/rubaidh_rails
|
16
|
+
generators/rubaidh_controller/rubaidh_controller_generator.rb
|
17
|
+
generators/rubaidh_controller/templates/controller.rb
|
18
|
+
generators/rubaidh_controller/templates/controller_spec.rb
|
19
|
+
generators/rubaidh_controller/templates/view.html.erb
|
20
|
+
generators/rubaidh_controller/USAGE
|
21
|
+
generators/rubaidh_helper/rubaidh_helper_generator.rb
|
22
|
+
generators/rubaidh_helper/templates/helper.rb
|
23
|
+
generators/rubaidh_helper/templates/helper_spec.rb
|
24
|
+
generators/rubaidh_helper/USAGE
|
25
|
+
generators/rubaidh_model/rubaidh_model_generator.rb
|
26
|
+
generators/rubaidh_model/templates/migration.rb
|
27
|
+
generators/rubaidh_model/templates/model.rb
|
28
|
+
generators/rubaidh_model/templates/model_exemplar.rb
|
29
|
+
generators/rubaidh_model/templates/model_spec.rb
|
30
|
+
generators/rubaidh_model/USAGE
|
31
|
+
generators/rubaidh_named_base.rb
|
32
|
+
generators/rubaidh_scaffold/rubaidh_scaffold_generator.rb
|
33
|
+
generators/rubaidh_scaffold/templates/controller.rb
|
34
|
+
generators/rubaidh_scaffold/templates/controller_spec.rb
|
35
|
+
generators/rubaidh_scaffold/templates/partial_form.html.erb
|
36
|
+
generators/rubaidh_scaffold/templates/partial_layout.html.erb
|
37
|
+
generators/rubaidh_scaffold/templates/partial_model.html.erb
|
38
|
+
generators/rubaidh_scaffold/templates/routing_spec.rb
|
39
|
+
generators/rubaidh_scaffold/templates/view_edit.html.erb
|
40
|
+
generators/rubaidh_scaffold/templates/view_index.html.erb
|
41
|
+
generators/rubaidh_scaffold/templates/view_new.html.erb
|
42
|
+
generators/rubaidh_scaffold/templates/view_show.html.erb
|
43
|
+
generators/rubaidh_scaffold/USAGE
|
44
|
+
templates/rubaidh.rb
|
45
|
+
)
|
46
|
+
|
47
|
+
s.add_dependency 'rails', '>=2.3.0'
|
48
|
+
|
49
|
+
s.bindir = "bin"
|
50
|
+
s.executables = ["rubaidh_rails"]
|
51
|
+
s.default_executable = "rubaidh_rails"
|
52
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
git :init
|
3
|
+
|
4
|
+
# Have git ignore a pile of useless things.
|
5
|
+
file ".gitignore", <<-GITIGNORE
|
6
|
+
# Log files
|
7
|
+
/log/*.log
|
8
|
+
|
9
|
+
# Temporary files
|
10
|
+
/tmp
|
11
|
+
|
12
|
+
# Generated documentation
|
13
|
+
/doc/api
|
14
|
+
/doc/app
|
15
|
+
/doc/plugins
|
16
|
+
|
17
|
+
# RSpec test coverage
|
18
|
+
/coverage
|
19
|
+
GITIGNORE
|
20
|
+
|
21
|
+
# Don't delete the log folder, thanks, git.
|
22
|
+
file "log/.keep", ""
|
23
|
+
|
24
|
+
git :add => '.'
|
25
|
+
git :commit => "-m 'Initial commit of application skeleton.'"
|
26
|
+
|
27
|
+
# Pull in all our favourite testing tools.
|
28
|
+
plugin 'remarkable', :git => 'git://github.com/carlosbrando/remarkable.git', :submodule => true
|
29
|
+
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git', :submodule => true
|
30
|
+
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git', :submodule => true
|
31
|
+
plugin 'webrat', :git => 'git://github.com/brynary/webrat.git', :submodule => true
|
32
|
+
plugin 'webrat', :git => 'git://github.com/aslakhellesoy/cucumber.git', :submodule => true
|
33
|
+
plugin 'object_daddy', :git => 'git://github.com/flogic/object_daddy.git', :submodule => true
|
34
|
+
generate 'rspec'
|
35
|
+
generate 'cucumber'
|
36
|
+
git :add => '.'
|
37
|
+
git :commit => "-m 'Pull in submodules, and install support, for RSpec/Cucumber testing tools.'"
|
38
|
+
|
39
|
+
# Remave the existing Test::Unit test suite code.
|
40
|
+
git :rm => "-rf test"
|
41
|
+
run "rm -rf test"
|
42
|
+
git :commit => "-m 'Remove Test::Unit test suite.'"
|
43
|
+
|
44
|
+
# Create the databases and an emtpy db schema for VC.
|
45
|
+
rake "db:create:all"
|
46
|
+
rake "db:migrate"
|
47
|
+
git :add => "db/schema.rb"
|
48
|
+
git :commit => "-m 'Create a blank database schema.'"
|
49
|
+
|
50
|
+
# Hoptoad Notifier for notification of production errors
|
51
|
+
plugin 'hoptoad_notifier', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git', :submodule => true
|
52
|
+
file 'app/controllers/application_controller.rb', <<-RUBY
|
53
|
+
class ApplicationController < ActionController::Base
|
54
|
+
helper :all
|
55
|
+
protect_from_forgery
|
56
|
+
filter_parameter_logging :password
|
57
|
+
|
58
|
+
include HoptoadNotifier::Catcher
|
59
|
+
end
|
60
|
+
RUBY
|
61
|
+
|
62
|
+
initializer 'hoptoad.rb', <<-RUBY
|
63
|
+
HoptoadNotifier.configure do |config|
|
64
|
+
# FIXME Insert Hoptoad API key.
|
65
|
+
config.api_key = 'Insert API Key here'
|
66
|
+
end
|
67
|
+
RUBY
|
68
|
+
|
69
|
+
git :add => '.'
|
70
|
+
git :commit => "-m 'Incorporate Hoptoad exception notification support.'"
|
71
|
+
|
72
|
+
# Capistrano-ification
|
73
|
+
capify!
|
74
|
+
git :add => '.'
|
75
|
+
git :commit => "-m 'Capistrano configuration.'"
|
76
|
+
|
77
|
+
# Tidy up the public folder
|
78
|
+
git :rm => "public/index.html public/robots.txt public/favicon.ico public/images/rails.png"
|
79
|
+
git :commit => " -m 'Remove static files we will not need.'"
|
80
|
+
|
81
|
+
# And I think that'll do for now. What, you want me to automate the writing of
|
82
|
+
# the app too?! :-)
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubaidh-generators
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Graeme Mathieson
|
8
|
+
- Rubaidh Ltd
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-02-13 00:00:00 -08:00
|
14
|
+
default_executable: rubaidh_rails
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rails
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.3.0
|
24
|
+
version:
|
25
|
+
description: Generators for building Ruby on Rails projects the Rubaidh Way
|
26
|
+
email: support@rubaidh.com
|
27
|
+
executables:
|
28
|
+
- rubaidh_rails
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- MIT-LICENSE
|
36
|
+
- Rakefile
|
37
|
+
- README.rdoc
|
38
|
+
- TODO
|
39
|
+
- generators.gemspec
|
40
|
+
- bin/rubaidh_rails
|
41
|
+
- generators/rubaidh_controller/rubaidh_controller_generator.rb
|
42
|
+
- generators/rubaidh_controller/templates/controller.rb
|
43
|
+
- generators/rubaidh_controller/templates/controller_spec.rb
|
44
|
+
- generators/rubaidh_controller/templates/view.html.erb
|
45
|
+
- generators/rubaidh_controller/USAGE
|
46
|
+
- generators/rubaidh_helper/rubaidh_helper_generator.rb
|
47
|
+
- generators/rubaidh_helper/templates/helper.rb
|
48
|
+
- generators/rubaidh_helper/templates/helper_spec.rb
|
49
|
+
- generators/rubaidh_helper/USAGE
|
50
|
+
- generators/rubaidh_model/rubaidh_model_generator.rb
|
51
|
+
- generators/rubaidh_model/templates/migration.rb
|
52
|
+
- generators/rubaidh_model/templates/model.rb
|
53
|
+
- generators/rubaidh_model/templates/model_exemplar.rb
|
54
|
+
- generators/rubaidh_model/templates/model_spec.rb
|
55
|
+
- generators/rubaidh_model/USAGE
|
56
|
+
- generators/rubaidh_named_base.rb
|
57
|
+
- generators/rubaidh_scaffold/rubaidh_scaffold_generator.rb
|
58
|
+
- generators/rubaidh_scaffold/templates/controller.rb
|
59
|
+
- generators/rubaidh_scaffold/templates/controller_spec.rb
|
60
|
+
- generators/rubaidh_scaffold/templates/partial_form.html.erb
|
61
|
+
- generators/rubaidh_scaffold/templates/partial_layout.html.erb
|
62
|
+
- generators/rubaidh_scaffold/templates/partial_model.html.erb
|
63
|
+
- generators/rubaidh_scaffold/templates/routing_spec.rb
|
64
|
+
- generators/rubaidh_scaffold/templates/view_edit.html.erb
|
65
|
+
- generators/rubaidh_scaffold/templates/view_index.html.erb
|
66
|
+
- generators/rubaidh_scaffold/templates/view_new.html.erb
|
67
|
+
- generators/rubaidh_scaffold/templates/view_show.html.erb
|
68
|
+
- generators/rubaidh_scaffold/USAGE
|
69
|
+
- templates/rubaidh.rb
|
70
|
+
has_rdoc: false
|
71
|
+
homepage: http://rubaidh.com/portfolio/open-source
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options: []
|
74
|
+
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: "0"
|
88
|
+
version:
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project: rubaidh
|
92
|
+
rubygems_version: 1.2.0
|
93
|
+
signing_key:
|
94
|
+
specification_version: 2
|
95
|
+
summary: "[Rails] Generators for building Ruby on Rails projects the Rubaidh Way"
|
96
|
+
test_files: []
|
97
|
+
|