model_base_generators 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/Rakefile +13 -1
- data/example/.gitignore +2 -0
- data/example/.rspec +2 -0
- data/example/Gemfile +72 -0
- data/example/Gemfile.lock +304 -0
- data/example/Rakefile +6 -0
- data/example/app/assets/config/manifest.js +5 -0
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/javascripts/application.js +13 -0
- data/example/app/assets/javascripts/cable.js +13 -0
- data/example/app/assets/javascripts/channels/.keep +0 -0
- data/example/app/assets/stylesheets/application.css +15 -0
- data/example/app/channels/application_cable/channel.rb +4 -0
- data/example/app/channels/application_cable/connection.rb +4 -0
- data/example/app/controllers/application_controller.rb +3 -0
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/controllers/concerns/authentication.rb +12 -0
- data/{examples → example}/app/controllers/issues_controller.rb +1 -1
- data/example/app/controllers/projects_controller.rb +62 -0
- data/example/app/helpers/application_helper.rb +2 -0
- data/example/app/helpers/issues_helper.rb +2 -0
- data/example/app/helpers/projects_helper.rb +2 -0
- data/example/app/jobs/application_job.rb +2 -0
- data/example/app/mailers/application_mailer.rb +4 -0
- data/example/app/models/ability.rb +35 -0
- data/example/app/models/application_record.rb +3 -0
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/models/issue.rb +16 -0
- data/example/app/models/project.rb +6 -0
- data/example/app/models/user.rb +25 -0
- data/example/app/validations/ar_internal_metadatum_validation.rb +8 -0
- data/example/app/validations/issue_validation.rb +9 -0
- data/example/app/validations/project_validation.rb +8 -0
- data/example/app/validations/user_validation.rb +10 -0
- data/{examples → example}/app/views/issues/_form.html.erb +8 -1
- data/{examples/app/views/issues/index.html.erb → example/app/views/issues/_table.html.erb} +2 -7
- data/{examples → example}/app/views/issues/edit.html.erb +0 -0
- data/example/app/views/issues/index.html.erb +9 -0
- data/{examples → example}/app/views/issues/new.html.erb +0 -0
- data/{examples → example}/app/views/issues/show.html.erb +6 -0
- data/example/app/views/layouts/application.html.erb +14 -0
- data/example/app/views/layouts/mailer.html.erb +13 -0
- data/example/app/views/layouts/mailer.text.erb +1 -0
- data/{examples → example}/app/views/projects/_form.html.erb +7 -0
- data/{examples/app/views/projects/index.html.erb → example/app/views/projects/_table.html.erb} +2 -9
- data/{examples → example}/app/views/projects/edit.html.erb +0 -0
- data/example/app/views/projects/index.html.erb +9 -0
- data/{examples → example}/app/views/projects/new.html.erb +0 -0
- data/{examples → example}/app/views/projects/show.html.erb +2 -0
- data/example/bin/bundle +3 -0
- data/example/bin/rails +4 -0
- data/example/bin/rake +4 -0
- data/example/bin/setup +34 -0
- data/example/bin/update +29 -0
- data/example/config/application.rb +20 -0
- data/example/config/boot.rb +5 -0
- data/example/config/cable.yml +9 -0
- data/example/config/database.yml +25 -0
- data/example/config/environment.rb +5 -0
- data/example/config/environments/development.rb +56 -0
- data/example/config/environments/production.rb +86 -0
- data/example/config/environments/test.rb +42 -0
- data/example/config/initializers/application_controller_renderer.rb +6 -0
- data/example/config/initializers/assets.rb +11 -0
- data/example/config/initializers/backtrace_silencers.rb +7 -0
- data/example/config/initializers/cookies_serializer.rb +5 -0
- data/example/config/initializers/devise.rb +274 -0
- data/example/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/config/initializers/inflections.rb +16 -0
- data/example/config/initializers/mime_types.rb +4 -0
- data/example/config/initializers/new_framework_defaults.rb +24 -0
- data/example/config/initializers/pretty_validation.rb +5 -0
- data/example/config/initializers/session_store.rb +3 -0
- data/example/config/initializers/wrap_parameters.rb +14 -0
- data/example/config/locales/devise.en.yml +62 -0
- data/example/config/locales/en.yml +23 -0
- data/example/config/puma.rb +47 -0
- data/example/config/routes.rb +6 -0
- data/example/config/secrets.yml +22 -0
- data/example/config/spring.rb +6 -0
- data/example/config.ru +5 -0
- data/example/db/schema.rb +34 -0
- data/example/lib/assets/.keep +0 -0
- data/example/log/.keep +0 -0
- data/example/public/404.html +67 -0
- data/example/public/422.html +67 -0
- data/example/public/500.html +66 -0
- data/example/public/apple-touch-icon-precomposed.png +0 -0
- data/example/public/apple-touch-icon.png +0 -0
- data/example/public/favicon.ico +0 -0
- data/{examples → example}/spec/controllers/issues_controller_spec.rb +6 -6
- data/{examples → example}/spec/controllers/projects_controller_spec.rb +4 -4
- data/example/spec/factories/issues.rb +8 -0
- data/example/spec/factories/projects.rb +6 -0
- data/example/spec/factories/users.rb +8 -0
- data/example/spec/rails_helper.rb +57 -0
- data/{examples → example}/spec/routing/issues_routing_spec.rb +0 -0
- data/{examples → example}/spec/routing/projects_routing_spec.rb +0 -0
- data/example/spec/spec_helper.rb +99 -0
- data/example/spec/support/controller_macros.rb +18 -0
- data/example/spec/support/devise.rb +16 -0
- data/{examples → example}/spec/views/issues/edit.html.erb_spec.rb +4 -1
- data/example/spec/views/issues/index.html.erb_spec.rb +21 -0
- data/{examples → example}/spec/views/issues/new.html.erb_spec.rb +4 -1
- data/example/spec/views/issues/show.html.erb_spec.rb +17 -0
- data/{examples → example}/spec/views/projects/edit.html.erb_spec.rb +3 -1
- data/example/spec/views/projects/index.html.erb_spec.rb +18 -0
- data/{examples → example}/spec/views/projects/new.html.erb_spec.rb +3 -1
- data/example/spec/views/projects/show.html.erb_spec.rb +14 -0
- data/example/tmp/.keep +0 -0
- data/lib/model_base/column_attribute.rb +63 -2
- data/lib/model_base/config.rb +13 -2
- data/lib/model_base/generators/erb/scaffold.rb +23 -0
- data/lib/model_base/generators/factory_girl/model.rb +37 -0
- data/lib/model_base/meta_model.rb +77 -13
- data/lib/model_base/version.rb +1 -1
- data/lib/model_base.rb +4 -0
- data/lib/templates/controller.rb +1 -1
- data/lib/templates/erb/scaffold/_form.html.erb +1 -1
- data/lib/templates/erb/scaffold/_table.html.erb +39 -0
- data/lib/templates/erb/scaffold/index.html.erb +1 -38
- data/lib/templates/erb/scaffold/show.html.erb +3 -1
- data/lib/templates/factory_girl/factory.rb +11 -0
- data/lib/templates/rspec/scaffold/controller_spec.rb +8 -13
- data/lib/templates/rspec/scaffold/edit_spec.rb +3 -3
- data/lib/templates/rspec/scaffold/index_spec.rb +13 -3
- data/lib/templates/rspec/scaffold/new_spec.rb +3 -2
- data/lib/templates/rspec/scaffold/show_spec.rb +4 -4
- metadata +115 -25
- data/examples/spec/views/issues/index.html.erb_spec.rb +0 -17
- data/examples/spec/views/issues/show.html.erb_spec.rb +0 -14
- data/examples/spec/views/projects/index.html.erb_spec.rb +0 -15
- data/examples/spec/views/projects/show.html.erb_spec.rb +0 -12
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_base_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -125,32 +125,120 @@ files:
|
|
125
125
|
- Rakefile
|
126
126
|
- bin/console
|
127
127
|
- bin/setup
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
128
|
+
- example/.gitignore
|
129
|
+
- example/.rspec
|
130
|
+
- example/Gemfile
|
131
|
+
- example/Gemfile.lock
|
132
|
+
- example/Rakefile
|
133
|
+
- example/app/assets/config/manifest.js
|
134
|
+
- example/app/assets/images/.keep
|
135
|
+
- example/app/assets/javascripts/application.js
|
136
|
+
- example/app/assets/javascripts/cable.js
|
137
|
+
- example/app/assets/javascripts/channels/.keep
|
138
|
+
- example/app/assets/stylesheets/application.css
|
139
|
+
- example/app/channels/application_cable/channel.rb
|
140
|
+
- example/app/channels/application_cable/connection.rb
|
141
|
+
- example/app/controllers/application_controller.rb
|
142
|
+
- example/app/controllers/concerns/.keep
|
143
|
+
- example/app/controllers/concerns/authentication.rb
|
144
|
+
- example/app/controllers/issues_controller.rb
|
145
|
+
- example/app/controllers/projects_controller.rb
|
146
|
+
- example/app/helpers/application_helper.rb
|
147
|
+
- example/app/helpers/issues_helper.rb
|
148
|
+
- example/app/helpers/projects_helper.rb
|
149
|
+
- example/app/jobs/application_job.rb
|
150
|
+
- example/app/mailers/application_mailer.rb
|
151
|
+
- example/app/models/ability.rb
|
152
|
+
- example/app/models/application_record.rb
|
153
|
+
- example/app/models/concerns/.keep
|
154
|
+
- example/app/models/issue.rb
|
155
|
+
- example/app/models/project.rb
|
156
|
+
- example/app/models/user.rb
|
157
|
+
- example/app/validations/ar_internal_metadatum_validation.rb
|
158
|
+
- example/app/validations/issue_validation.rb
|
159
|
+
- example/app/validations/project_validation.rb
|
160
|
+
- example/app/validations/user_validation.rb
|
161
|
+
- example/app/views/issues/_form.html.erb
|
162
|
+
- example/app/views/issues/_table.html.erb
|
163
|
+
- example/app/views/issues/edit.html.erb
|
164
|
+
- example/app/views/issues/index.html.erb
|
165
|
+
- example/app/views/issues/new.html.erb
|
166
|
+
- example/app/views/issues/show.html.erb
|
167
|
+
- example/app/views/layouts/application.html.erb
|
168
|
+
- example/app/views/layouts/mailer.html.erb
|
169
|
+
- example/app/views/layouts/mailer.text.erb
|
170
|
+
- example/app/views/projects/_form.html.erb
|
171
|
+
- example/app/views/projects/_table.html.erb
|
172
|
+
- example/app/views/projects/edit.html.erb
|
173
|
+
- example/app/views/projects/index.html.erb
|
174
|
+
- example/app/views/projects/new.html.erb
|
175
|
+
- example/app/views/projects/show.html.erb
|
176
|
+
- example/bin/bundle
|
177
|
+
- example/bin/rails
|
178
|
+
- example/bin/rake
|
179
|
+
- example/bin/setup
|
180
|
+
- example/bin/update
|
181
|
+
- example/config.ru
|
182
|
+
- example/config/application.rb
|
183
|
+
- example/config/boot.rb
|
184
|
+
- example/config/cable.yml
|
185
|
+
- example/config/database.yml
|
186
|
+
- example/config/environment.rb
|
187
|
+
- example/config/environments/development.rb
|
188
|
+
- example/config/environments/production.rb
|
189
|
+
- example/config/environments/test.rb
|
190
|
+
- example/config/initializers/application_controller_renderer.rb
|
191
|
+
- example/config/initializers/assets.rb
|
192
|
+
- example/config/initializers/backtrace_silencers.rb
|
193
|
+
- example/config/initializers/cookies_serializer.rb
|
194
|
+
- example/config/initializers/devise.rb
|
195
|
+
- example/config/initializers/filter_parameter_logging.rb
|
196
|
+
- example/config/initializers/inflections.rb
|
197
|
+
- example/config/initializers/mime_types.rb
|
198
|
+
- example/config/initializers/new_framework_defaults.rb
|
199
|
+
- example/config/initializers/pretty_validation.rb
|
200
|
+
- example/config/initializers/session_store.rb
|
201
|
+
- example/config/initializers/wrap_parameters.rb
|
202
|
+
- example/config/locales/devise.en.yml
|
203
|
+
- example/config/locales/en.yml
|
204
|
+
- example/config/puma.rb
|
205
|
+
- example/config/routes.rb
|
206
|
+
- example/config/secrets.yml
|
207
|
+
- example/config/spring.rb
|
208
|
+
- example/db/schema.rb
|
209
|
+
- example/lib/assets/.keep
|
210
|
+
- example/log/.keep
|
211
|
+
- example/public/404.html
|
212
|
+
- example/public/422.html
|
213
|
+
- example/public/500.html
|
214
|
+
- example/public/apple-touch-icon-precomposed.png
|
215
|
+
- example/public/apple-touch-icon.png
|
216
|
+
- example/public/favicon.ico
|
217
|
+
- example/spec/controllers/issues_controller_spec.rb
|
218
|
+
- example/spec/controllers/projects_controller_spec.rb
|
219
|
+
- example/spec/factories/issues.rb
|
220
|
+
- example/spec/factories/projects.rb
|
221
|
+
- example/spec/factories/users.rb
|
222
|
+
- example/spec/rails_helper.rb
|
223
|
+
- example/spec/routing/issues_routing_spec.rb
|
224
|
+
- example/spec/routing/projects_routing_spec.rb
|
225
|
+
- example/spec/spec_helper.rb
|
226
|
+
- example/spec/support/controller_macros.rb
|
227
|
+
- example/spec/support/devise.rb
|
228
|
+
- example/spec/views/issues/edit.html.erb_spec.rb
|
229
|
+
- example/spec/views/issues/index.html.erb_spec.rb
|
230
|
+
- example/spec/views/issues/new.html.erb_spec.rb
|
231
|
+
- example/spec/views/issues/show.html.erb_spec.rb
|
232
|
+
- example/spec/views/projects/edit.html.erb_spec.rb
|
233
|
+
- example/spec/views/projects/index.html.erb_spec.rb
|
234
|
+
- example/spec/views/projects/new.html.erb_spec.rb
|
235
|
+
- example/spec/views/projects/show.html.erb_spec.rb
|
236
|
+
- example/tmp/.keep
|
151
237
|
- lib/model_base.rb
|
152
238
|
- lib/model_base/column_attribute.rb
|
153
239
|
- lib/model_base/config.rb
|
240
|
+
- lib/model_base/generators/erb/scaffold.rb
|
241
|
+
- lib/model_base/generators/factory_girl/model.rb
|
154
242
|
- lib/model_base/generators/model_support.rb
|
155
243
|
- lib/model_base/meta_model.rb
|
156
244
|
- lib/model_base/railtie.rb
|
@@ -159,10 +247,12 @@ files:
|
|
159
247
|
- lib/templates/api_controller.rb
|
160
248
|
- lib/templates/controller.rb
|
161
249
|
- lib/templates/erb/scaffold/_form.html.erb
|
250
|
+
- lib/templates/erb/scaffold/_table.html.erb
|
162
251
|
- lib/templates/erb/scaffold/edit.html.erb
|
163
252
|
- lib/templates/erb/scaffold/index.html.erb
|
164
253
|
- lib/templates/erb/scaffold/new.html.erb
|
165
254
|
- lib/templates/erb/scaffold/show.html.erb
|
255
|
+
- lib/templates/factory_girl/factory.rb
|
166
256
|
- lib/templates/rspec/helper/helper_spec.rb
|
167
257
|
- lib/templates/rspec/integration/request_spec.rb
|
168
258
|
- lib/templates/rspec/model/model_spec.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe "issues/index", type: :view do
|
4
|
-
before(:each) do
|
5
|
-
assign(:issues, [
|
6
|
-
FactoryGirl.create(:issue),
|
7
|
-
FactoryGirl.create(:issue),
|
8
|
-
])
|
9
|
-
end
|
10
|
-
|
11
|
-
it "renders a list of issues" do
|
12
|
-
render
|
13
|
-
assert_select "tr>td", :text => 2.to_s, :count => 2
|
14
|
-
assert_select "tr>td", :text => "Title".to_s, :count => 2
|
15
|
-
assert_select "tr>td", :text => 3.to_s, :count => 2
|
16
|
-
end
|
17
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe "issues/show", type: :view do
|
4
|
-
before(:each) do
|
5
|
-
@issue = assign(:issue, FactoryGirl.create(:issue))
|
6
|
-
end
|
7
|
-
|
8
|
-
it "renders attributes in <p>" do
|
9
|
-
render
|
10
|
-
expect(rendered).to match(/2/)
|
11
|
-
expect(rendered).to match(/Title/)
|
12
|
-
expect(rendered).to match(/3/)
|
13
|
-
end
|
14
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe "projects/index", type: :view do
|
4
|
-
before(:each) do
|
5
|
-
assign(:projects, [
|
6
|
-
FactoryGirl.create(:project),
|
7
|
-
FactoryGirl.create(:project),
|
8
|
-
])
|
9
|
-
end
|
10
|
-
|
11
|
-
it "renders a list of projects" do
|
12
|
-
render
|
13
|
-
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
14
|
-
end
|
15
|
-
end
|