webamm_to_rails 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +3 -0
- data/lib/webamm_to_rails/features/definitions.rb +19 -0
- data/lib/webamm_to_rails/features/devise_onlineable/definition.rb +44 -0
- data/lib/webamm_to_rails/features/devise_onlineable/definitions/connection/presenter.rb +29 -0
- data/lib/webamm_to_rails/features/devise_onlineable/definitions/connection/template.erb +17 -0
- data/lib/webamm_to_rails/features/devise_onlineable/templates/app/channels/online_channel.rb.erb +13 -0
- data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/consumer.js.erb +6 -0
- data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/index.js.erb +5 -0
- data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/online_channel.js.erb +48 -0
- data/lib/webamm_to_rails/features/devise_onlineable/templates/app/models/concerns/devise_onlineable.rb.erb +39 -0
- data/lib/webamm_to_rails/rails_boilerplate/builder.rb +318 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/Dockerfile.erb +83 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/Procfile.dev.erb +3 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/README.md.erb +24 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/Rakefile.erb +6 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/assets/config/manifest.js.erb +2 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/assets/stylesheets/application.tailwind.css.erb +3 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/channels/application_cable/channel.rb.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/channels/application_cable/connection.rb.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/helpers/application_helper.rb.erb +2 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/application.js.erb +3 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/application.js.erb +9 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/hello_controller.js.erb +7 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/index.js.erb +8 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/jobs/application_job.rb.erb +7 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/mailers/application_mailer.rb.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/models/application_record.rb.erb +3 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/application.html.erb +44 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/mailer.html.erb +13 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/mailer.text.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/manifest.json.erb +22 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/service-worker.js.erb +26 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/brakeman.erb +7 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/bundle.erb +109 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/dev.erb +11 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/docker-entrypoint.erb +13 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rails.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rake.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rubocop.erb +8 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/bin/setup.erb +40 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/application.rb.erb +42 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/boot.rb.erb +4 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/cable.yml.erb +11 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/credentials.yml.enc.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/database.yml.erb +85 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/environment.rb.erb +5 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/development.rb.erb +84 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/production.rb.erb +102 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/test.rb.erb +67 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/assets.rb.erb +12 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/content_security_policy.rb.erb +25 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/filter_parameter_logging.rb.erb +8 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/inflections.rb.erb +16 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/permissions_policy.rb.erb +13 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/locales/en.yml.erb +31 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/master.key.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/puma.rb.erb +33 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config/storage.yml.erb +34 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/config.ru.erb +6 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/db/seeds.rb.erb +9 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/dockerignore.erb +48 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/gitattributes.erb +9 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/github/dependabot.yml.erb +0 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/github/workflows/ci.yml.erb +38 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/gitignore.erb +40 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/node-version.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/404.html.erb +67 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/406-unsupported-browser.html.erb +66 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/422.html.erb +67 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/500.html.erb +66 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/icon.png.erb +0 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/icon.svg.erb +3 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/public/robots.txt.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/rubocop.yml.erb +8 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/ruby-version.erb +1 -0
- data/lib/webamm_to_rails/rails_boilerplate/templates/tailwind.config.js.erb +8 -0
- data/lib/webamm_to_rails/sources/controllers/actions/create_definition/presenter.rb +50 -0
- data/lib/webamm_to_rails/sources/controllers/actions/create_definition/template.erb +9 -0
- data/lib/webamm_to_rails/sources/controllers/actions/definition.rb +66 -0
- data/lib/webamm_to_rails/sources/controllers/actions/destroy_definition/presenter.rb +52 -0
- data/lib/webamm_to_rails/sources/controllers/actions/destroy_definition/template.erb +6 -0
- data/lib/webamm_to_rails/sources/controllers/actions/edit_definition/presenter.rb +40 -0
- data/lib/webamm_to_rails/sources/controllers/actions/edit_definition/template.erb +3 -0
- data/lib/webamm_to_rails/sources/controllers/actions/index_definition/presenter.rb +40 -0
- data/lib/webamm_to_rails/sources/controllers/actions/index_definition/template.erb +3 -0
- data/lib/webamm_to_rails/sources/controllers/actions/new_definition/presenter.rb +40 -0
- data/lib/webamm_to_rails/sources/controllers/actions/new_definition/template.erb +3 -0
- data/lib/webamm_to_rails/sources/controllers/actions/show_definition/presenter.rb +40 -0
- data/lib/webamm_to_rails/sources/controllers/actions/show_definition/template.erb +3 -0
- data/lib/webamm_to_rails/sources/controllers/actions/strong_parameters_definition/presenter.rb +50 -0
- data/lib/webamm_to_rails/sources/controllers/actions/strong_parameters_definition/template.erb +3 -0
- data/lib/webamm_to_rails/sources/controllers/actions/update_definition/presenter.rb +54 -0
- data/lib/webamm_to_rails/sources/controllers/actions/update_definition/template.erb +9 -0
- data/lib/webamm_to_rails/sources/controllers/application_controller/authentication/devise_groups/presenter.rb +49 -0
- data/lib/webamm_to_rails/sources/controllers/application_controller/authentication/devise_groups_definition/presenter.rb +30 -0
- data/lib/webamm_to_rails/sources/controllers/application_controller/definition.rb +36 -0
- data/lib/webamm_to_rails/sources/controllers/application_controller/template.erb +5 -0
- data/lib/webamm_to_rails/sources/controllers/class_definition/presenter.rb +17 -0
- data/lib/webamm_to_rails/sources/controllers/definition.rb +44 -0
- data/lib/webamm_to_rails/sources/controllers/filters/definition.rb +32 -0
- data/lib/webamm_to_rails/sources/controllers/filters/devise_definition/presenter.rb +55 -0
- data/lib/webamm_to_rails/sources/controllers/template.erb +17 -0
- data/lib/webamm_to_rails/sources/gemfile/default_set.rb +27 -0
- data/lib/webamm_to_rails/sources/gemfile/definition.rb +31 -0
- data/lib/webamm_to_rails/sources/gemfile/gem.rb +8 -0
- data/lib/webamm_to_rails/sources/gemfile/gem_definition/presenter.rb +22 -0
- data/lib/webamm_to_rails/sources/gemfile/project_set.rb +21 -0
- data/lib/webamm_to_rails/sources/gemfile/sets/authentication.rb +34 -0
- data/lib/webamm_to_rails/sources/gemfile/template.erb +17 -0
- data/lib/webamm_to_rails/sources/helpers/definitions.rb +21 -0
- data/lib/webamm_to_rails/sources/helpers/devise/presenter.rb +27 -0
- data/lib/webamm_to_rails/sources/helpers/devise/qr_code_helper/presenter.rb +19 -0
- data/lib/webamm_to_rails/sources/helpers/devise/qr_code_helper/template.erb +22 -0
- data/lib/webamm_to_rails/sources/initializers/definitions.rb +26 -0
- data/lib/webamm_to_rails/sources/initializers/devise_definition/presenter.rb +27 -0
- data/lib/webamm_to_rails/sources/initializers/devise_definition/template.erb +397 -0
- data/lib/webamm_to_rails/sources/migrations/active_storage_definition/presenter.rb +29 -0
- data/lib/webamm_to_rails/sources/migrations/active_storage_definition/template.erb +57 -0
- data/lib/webamm_to_rails/sources/migrations/associations.rb +49 -0
- data/lib/webamm_to_rails/sources/migrations/class_definition/presenter.rb +17 -0
- data/lib/webamm_to_rails/sources/migrations/column_definition/presenter.rb +38 -0
- data/lib/webamm_to_rails/sources/migrations/columns.rb +33 -0
- data/lib/webamm_to_rails/sources/migrations/definition.rb +52 -0
- data/lib/webamm_to_rails/sources/migrations/devise/definition.rb +278 -0
- data/lib/webamm_to_rails/sources/migrations/files_list.rb +98 -0
- data/lib/webamm_to_rails/sources/migrations/index_definition/presenter.rb +34 -0
- data/lib/webamm_to_rails/sources/migrations/indices.rb +33 -0
- data/lib/webamm_to_rails/sources/migrations/table_definition/presenter.rb +21 -0
- data/lib/webamm_to_rails/sources/migrations/template.erb +12 -0
- data/lib/webamm_to_rails/sources/migrations/uuid_definition/presenter.rb +29 -0
- data/lib/webamm_to_rails/sources/migrations/uuid_definition/template.erb +5 -0
- data/lib/webamm_to_rails/sources/models/association_definition/presenter.rb +49 -0
- data/lib/webamm_to_rails/sources/models/associations.rb +113 -0
- data/lib/webamm_to_rails/sources/models/attachment_definition/presenter.rb +21 -0
- data/lib/webamm_to_rails/sources/models/attachments.rb +25 -0
- data/lib/webamm_to_rails/sources/models/class_definition/presenter.rb +17 -0
- data/lib/webamm_to_rails/sources/models/concerns.rb +27 -0
- data/lib/webamm_to_rails/sources/models/definition.rb +57 -0
- data/lib/webamm_to_rails/sources/models/devise_definition/presenter.rb +49 -0
- data/lib/webamm_to_rails/sources/models/enum_definition/presenter.rb +19 -0
- data/lib/webamm_to_rails/sources/models/enums.rb +25 -0
- data/lib/webamm_to_rails/sources/models/template.erb +7 -0
- data/lib/webamm_to_rails/sources/package_json/definition.rb +27 -0
- data/lib/webamm_to_rails/sources/package_json/template.erb +21 -0
- data/lib/webamm_to_rails/sources/routes/authentication_definition/presenter.rb +21 -0
- data/lib/webamm_to_rails/sources/routes/definition.rb +38 -0
- data/lib/webamm_to_rails/sources/routes/resource_definition/presenter.rb +25 -0
- data/lib/webamm_to_rails/sources/routes/template.erb +14 -0
- data/lib/webamm_to_rails/sources/views/definition.rb +28 -0
- data/lib/webamm_to_rails/sources/views/devise/invitable/presenter.rb +31 -0
- data/lib/webamm_to_rails/sources/views/devise/invitable/templates/invitations/edit.html.erb +38 -0
- data/lib/webamm_to_rails/sources/views/devise/invitable/templates/invitations/new.html.erb +31 -0
- data/lib/webamm_to_rails/sources/views/devise/invitable/templates/mailer/invitation_instructions.html.erb +23 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/presenter.rb +32 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_credentials/refresh.html.erb +19 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_credentials/show.html.erb +70 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/_token_secret.html.erb +21 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/_trusted_devices.html.erb +12 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/edit.html.erb +48 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/recovery.html.erb +21 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/recovery_codes.html.erb +3 -0
- data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/show.html.erb +21 -0
- data/lib/webamm_to_rails/sources/views/devise/presenter.rb +37 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/presenter.rb +39 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/confirmations/new.html.erb +31 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/confirmation_instructions.html.erb +17 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/email_changed.html.erb +7 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/password_change.html.erb +3 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/reset_password_instructions.html.erb +22 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/passwords/edit.html.erb +36 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/passwords/new.html.erb +31 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/registrations/edit.html.erb +43 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/registrations/new.html.erb +39 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/sessions/new.html.erb +23 -0
- data/lib/webamm_to_rails/sources/views/devise/standard/templates/shared/_links.html.erb +27 -0
- data/lib/webamm_to_rails/sources/views/resource/edit_definition/presenter.rb +41 -0
- data/lib/webamm_to_rails/sources/views/resource/edit_definition/template.erb +1 -0
- data/lib/webamm_to_rails/sources/views/resource/form_definition/presenter.rb +50 -0
- data/lib/webamm_to_rails/sources/views/resource/form_definition/template.erb +82 -0
- data/lib/webamm_to_rails/sources/views/resource/index_definition/presenter.rb +69 -0
- data/lib/webamm_to_rails/sources/views/resource/index_definition/template.erb +78 -0
- data/lib/webamm_to_rails/sources/views/resource/new_definition/presenter.rb +41 -0
- data/lib/webamm_to_rails/sources/views/resource/new_definition/template.erb +1 -0
- data/lib/webamm_to_rails/sources/views/resource/presenter.rb +41 -0
- data/lib/webamm_to_rails/sources/views/resource/show_definition/presenter.rb +61 -0
- data/lib/webamm_to_rails/sources/views/resource/show_definition/template.erb +34 -0
- data/lib/webamm_to_rails/utils/format_code.rb +11 -0
- data/lib/webamm_to_rails/utils/format_template.rb +11 -0
- data/lib/webamm_to_rails/version.rb +5 -0
- data/lib/webamm_to_rails.rb +112 -0
- data/webamm_to_rails.gemspec +28 -0
- metadata +332 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
@@ -0,0 +1 @@
|
|
1
|
+
ruby-3.2.2
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module CreateDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'create' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def new_call
|
33
|
+
"#{@table_name.classify}.new(#{@table_name.singularize}_params)"
|
34
|
+
end
|
35
|
+
|
36
|
+
def redirection_path
|
37
|
+
if @crud_definition.actions.find { |action| action.name == 'index' }
|
38
|
+
"#{@table_name}_path"
|
39
|
+
elsif @crud_definition.actions.find { |action| action.name == 'show' }
|
40
|
+
"#{@table_name.singularize}_path(#{variable_name})"
|
41
|
+
else
|
42
|
+
"root_path"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require_relative 'new_definition/presenter'
|
2
|
+
require_relative 'edit_definition/presenter'
|
3
|
+
require_relative 'show_definition/presenter'
|
4
|
+
require_relative 'destroy_definition/presenter'
|
5
|
+
require_relative 'create_definition/presenter'
|
6
|
+
require_relative 'update_definition/presenter'
|
7
|
+
require_relative 'index_definition/presenter'
|
8
|
+
require_relative 'strong_parameters_definition/presenter'
|
9
|
+
|
10
|
+
module WebammToRails
|
11
|
+
module Sources
|
12
|
+
module Controllers
|
13
|
+
module Actions
|
14
|
+
class Definition
|
15
|
+
def initialize(crud_definition:, waml_definition:)
|
16
|
+
@crud_definition = crud_definition
|
17
|
+
@waml_definition = waml_definition
|
18
|
+
end
|
19
|
+
|
20
|
+
def collection
|
21
|
+
actions.select(&:render?).group_by(&:access_scope)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def actions
|
27
|
+
[
|
28
|
+
::WebammToRails::Sources::Controllers::Actions::IndexDefinition::Presenter.new(
|
29
|
+
table_name: @crud_definition.table,
|
30
|
+
crud_definition: @crud_definition
|
31
|
+
),
|
32
|
+
::WebammToRails::Sources::Controllers::Actions::NewDefinition::Presenter.new(
|
33
|
+
table_name: @crud_definition.table,
|
34
|
+
crud_definition: @crud_definition
|
35
|
+
),
|
36
|
+
::WebammToRails::Sources::Controllers::Actions::EditDefinition::Presenter.new(
|
37
|
+
table_name: @crud_definition.table,
|
38
|
+
crud_definition: @crud_definition
|
39
|
+
),
|
40
|
+
::WebammToRails::Sources::Controllers::Actions::ShowDefinition::Presenter.new(
|
41
|
+
table_name: @crud_definition.table,
|
42
|
+
crud_definition: @crud_definition
|
43
|
+
),
|
44
|
+
::WebammToRails::Sources::Controllers::Actions::DestroyDefinition::Presenter.new(
|
45
|
+
table_name: @crud_definition.table,
|
46
|
+
crud_definition: @crud_definition
|
47
|
+
),
|
48
|
+
::WebammToRails::Sources::Controllers::Actions::CreateDefinition::Presenter.new(
|
49
|
+
table_name: @crud_definition.table,
|
50
|
+
crud_definition: @crud_definition
|
51
|
+
),
|
52
|
+
::WebammToRails::Sources::Controllers::Actions::UpdateDefinition::Presenter.new(
|
53
|
+
table_name: @crud_definition.table,
|
54
|
+
crud_definition: @crud_definition
|
55
|
+
),
|
56
|
+
::WebammToRails::Sources::Controllers::Actions::StrongParametersDefinition::Presenter.new(
|
57
|
+
crud_definition: @crud_definition,
|
58
|
+
waml_definition: @waml_definition
|
59
|
+
)
|
60
|
+
]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module DestroyDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'destroy' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def find_call
|
33
|
+
"#{@table_name.classify}.find(params[:id])"
|
34
|
+
end
|
35
|
+
|
36
|
+
def redirection_path
|
37
|
+
if @crud_definition.actions.find { |action| action.name == 'index' }
|
38
|
+
"#{@table_name}_path"
|
39
|
+
else
|
40
|
+
"root_path"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def resource_name
|
45
|
+
@table_name.classify
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module EditDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'update' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def find_call
|
33
|
+
"#{@table_name.classify}.find(params[:id])"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module IndexDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'index' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def all_call
|
33
|
+
"#{@table_name.classify}.all"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module NewDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'create' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def new_call
|
33
|
+
"#{@table_name.classify}.new"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module ShowDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'show' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def find_call
|
33
|
+
"#{@table_name.classify}.find(params[:id])"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/webamm_to_rails/sources/controllers/actions/strong_parameters_definition/presenter.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module StrongParametersDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(crud_definition:, waml_definition:)
|
8
|
+
@crud_definition = crud_definition
|
9
|
+
@waml_definition = waml_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render?
|
13
|
+
@crud_definition.actions.any? { |action| action.name.in?(%w[create update]) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def render
|
17
|
+
template_path = File.expand_path('template.erb', __dir__)
|
18
|
+
template_content = File.read(template_path)
|
19
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
20
|
+
|
21
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
22
|
+
end
|
23
|
+
|
24
|
+
def access_scope = :private
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def method_name
|
29
|
+
"def #{@crud_definition.table.singularize}_params"
|
30
|
+
end
|
31
|
+
|
32
|
+
def param_name
|
33
|
+
":#{@crud_definition.table.singularize}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def permitted_attributes
|
37
|
+
model_definition.columns.map(&:name).map { |name| ":#{name}" }.join(', ')
|
38
|
+
end
|
39
|
+
|
40
|
+
def model_definition
|
41
|
+
@model_definition ||= @waml_definition.database.schema.find do |definition|
|
42
|
+
definition.table == @crud_definition.table
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module WebammToRails
|
2
|
+
module Sources
|
3
|
+
module Controllers
|
4
|
+
module Actions
|
5
|
+
module UpdateDefinition
|
6
|
+
class Presenter
|
7
|
+
def initialize(table_name:, crud_definition:)
|
8
|
+
@table_name = table_name
|
9
|
+
@crud_definition = crud_definition
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
template_path = File.expand_path('template.erb', __dir__)
|
14
|
+
template_content = File.read(template_path)
|
15
|
+
raw_content = ERB.new(template_content, trim_mode: '-').result(instance_eval { binding })
|
16
|
+
|
17
|
+
::WebammToRails::Utils::FormatCode.call(raw_content)
|
18
|
+
end
|
19
|
+
|
20
|
+
def access_scope = :public
|
21
|
+
|
22
|
+
def render?
|
23
|
+
@crud_definition.actions.find { |action| action.name == 'update' }.present?
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def variable_name
|
29
|
+
"@#{@table_name.singularize}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def find_call
|
33
|
+
"#{@table_name.classify}.find(params[:id])"
|
34
|
+
end
|
35
|
+
|
36
|
+
def update_call
|
37
|
+
"#{variable_name}.update(#{@table_name.singularize}_params)"
|
38
|
+
end
|
39
|
+
|
40
|
+
def redirection_path
|
41
|
+
if @crud_definition.actions.find { |action| action.name == 'index' }
|
42
|
+
"#{@table_name}_path"
|
43
|
+
elsif @crud_definition.actions.find { |action| action.name == 'show' }
|
44
|
+
"#{@table_name.singularize}_path(#{variable_name})"
|
45
|
+
else
|
46
|
+
"root_path"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|