webamm_to_rails 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -0
  3. data/lib/webamm_to_rails/features/definitions.rb +19 -0
  4. data/lib/webamm_to_rails/features/devise_onlineable/definition.rb +44 -0
  5. data/lib/webamm_to_rails/features/devise_onlineable/definitions/connection/presenter.rb +29 -0
  6. data/lib/webamm_to_rails/features/devise_onlineable/definitions/connection/template.erb +17 -0
  7. data/lib/webamm_to_rails/features/devise_onlineable/templates/app/channels/online_channel.rb.erb +13 -0
  8. data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/consumer.js.erb +6 -0
  9. data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/index.js.erb +5 -0
  10. data/lib/webamm_to_rails/features/devise_onlineable/templates/app/javascript/channels/online_channel.js.erb +48 -0
  11. data/lib/webamm_to_rails/features/devise_onlineable/templates/app/models/concerns/devise_onlineable.rb.erb +39 -0
  12. data/lib/webamm_to_rails/rails_boilerplate/builder.rb +318 -0
  13. data/lib/webamm_to_rails/rails_boilerplate/templates/Dockerfile.erb +83 -0
  14. data/lib/webamm_to_rails/rails_boilerplate/templates/Procfile.dev.erb +3 -0
  15. data/lib/webamm_to_rails/rails_boilerplate/templates/README.md.erb +24 -0
  16. data/lib/webamm_to_rails/rails_boilerplate/templates/Rakefile.erb +6 -0
  17. data/lib/webamm_to_rails/rails_boilerplate/templates/app/assets/config/manifest.js.erb +2 -0
  18. data/lib/webamm_to_rails/rails_boilerplate/templates/app/assets/stylesheets/application.tailwind.css.erb +3 -0
  19. data/lib/webamm_to_rails/rails_boilerplate/templates/app/channels/application_cable/channel.rb.erb +4 -0
  20. data/lib/webamm_to_rails/rails_boilerplate/templates/app/channels/application_cable/connection.rb.erb +4 -0
  21. data/lib/webamm_to_rails/rails_boilerplate/templates/app/helpers/application_helper.rb.erb +2 -0
  22. data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/application.js.erb +3 -0
  23. data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/application.js.erb +9 -0
  24. data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/hello_controller.js.erb +7 -0
  25. data/lib/webamm_to_rails/rails_boilerplate/templates/app/javascript/controllers/index.js.erb +8 -0
  26. data/lib/webamm_to_rails/rails_boilerplate/templates/app/jobs/application_job.rb.erb +7 -0
  27. data/lib/webamm_to_rails/rails_boilerplate/templates/app/mailers/application_mailer.rb.erb +4 -0
  28. data/lib/webamm_to_rails/rails_boilerplate/templates/app/models/application_record.rb.erb +3 -0
  29. data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/application.html.erb +44 -0
  30. data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/mailer.html.erb +13 -0
  31. data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/layouts/mailer.text.erb +1 -0
  32. data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/manifest.json.erb +22 -0
  33. data/lib/webamm_to_rails/rails_boilerplate/templates/app/views/pwa/service-worker.js.erb +26 -0
  34. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/brakeman.erb +7 -0
  35. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/bundle.erb +109 -0
  36. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/dev.erb +11 -0
  37. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/docker-entrypoint.erb +13 -0
  38. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rails.erb +4 -0
  39. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rake.erb +4 -0
  40. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/rubocop.erb +8 -0
  41. data/lib/webamm_to_rails/rails_boilerplate/templates/bin/setup.erb +40 -0
  42. data/lib/webamm_to_rails/rails_boilerplate/templates/config/application.rb.erb +42 -0
  43. data/lib/webamm_to_rails/rails_boilerplate/templates/config/boot.rb.erb +4 -0
  44. data/lib/webamm_to_rails/rails_boilerplate/templates/config/cable.yml.erb +11 -0
  45. data/lib/webamm_to_rails/rails_boilerplate/templates/config/credentials.yml.enc.erb +1 -0
  46. data/lib/webamm_to_rails/rails_boilerplate/templates/config/database.yml.erb +85 -0
  47. data/lib/webamm_to_rails/rails_boilerplate/templates/config/environment.rb.erb +5 -0
  48. data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/development.rb.erb +84 -0
  49. data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/production.rb.erb +102 -0
  50. data/lib/webamm_to_rails/rails_boilerplate/templates/config/environments/test.rb.erb +67 -0
  51. data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/assets.rb.erb +12 -0
  52. data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/content_security_policy.rb.erb +25 -0
  53. data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/filter_parameter_logging.rb.erb +8 -0
  54. data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/inflections.rb.erb +16 -0
  55. data/lib/webamm_to_rails/rails_boilerplate/templates/config/initializers/permissions_policy.rb.erb +13 -0
  56. data/lib/webamm_to_rails/rails_boilerplate/templates/config/locales/en.yml.erb +31 -0
  57. data/lib/webamm_to_rails/rails_boilerplate/templates/config/master.key.erb +1 -0
  58. data/lib/webamm_to_rails/rails_boilerplate/templates/config/puma.rb.erb +33 -0
  59. data/lib/webamm_to_rails/rails_boilerplate/templates/config/storage.yml.erb +34 -0
  60. data/lib/webamm_to_rails/rails_boilerplate/templates/config.ru.erb +6 -0
  61. data/lib/webamm_to_rails/rails_boilerplate/templates/db/seeds.rb.erb +9 -0
  62. data/lib/webamm_to_rails/rails_boilerplate/templates/dockerignore.erb +48 -0
  63. data/lib/webamm_to_rails/rails_boilerplate/templates/gitattributes.erb +9 -0
  64. data/lib/webamm_to_rails/rails_boilerplate/templates/github/dependabot.yml.erb +0 -0
  65. data/lib/webamm_to_rails/rails_boilerplate/templates/github/workflows/ci.yml.erb +38 -0
  66. data/lib/webamm_to_rails/rails_boilerplate/templates/gitignore.erb +40 -0
  67. data/lib/webamm_to_rails/rails_boilerplate/templates/node-version.erb +1 -0
  68. data/lib/webamm_to_rails/rails_boilerplate/templates/public/404.html.erb +67 -0
  69. data/lib/webamm_to_rails/rails_boilerplate/templates/public/406-unsupported-browser.html.erb +66 -0
  70. data/lib/webamm_to_rails/rails_boilerplate/templates/public/422.html.erb +67 -0
  71. data/lib/webamm_to_rails/rails_boilerplate/templates/public/500.html.erb +66 -0
  72. data/lib/webamm_to_rails/rails_boilerplate/templates/public/icon.png.erb +0 -0
  73. data/lib/webamm_to_rails/rails_boilerplate/templates/public/icon.svg.erb +3 -0
  74. data/lib/webamm_to_rails/rails_boilerplate/templates/public/robots.txt.erb +1 -0
  75. data/lib/webamm_to_rails/rails_boilerplate/templates/rubocop.yml.erb +8 -0
  76. data/lib/webamm_to_rails/rails_boilerplate/templates/ruby-version.erb +1 -0
  77. data/lib/webamm_to_rails/rails_boilerplate/templates/tailwind.config.js.erb +8 -0
  78. data/lib/webamm_to_rails/sources/controllers/actions/create_definition/presenter.rb +50 -0
  79. data/lib/webamm_to_rails/sources/controllers/actions/create_definition/template.erb +9 -0
  80. data/lib/webamm_to_rails/sources/controllers/actions/definition.rb +66 -0
  81. data/lib/webamm_to_rails/sources/controllers/actions/destroy_definition/presenter.rb +52 -0
  82. data/lib/webamm_to_rails/sources/controllers/actions/destroy_definition/template.erb +6 -0
  83. data/lib/webamm_to_rails/sources/controllers/actions/edit_definition/presenter.rb +40 -0
  84. data/lib/webamm_to_rails/sources/controllers/actions/edit_definition/template.erb +3 -0
  85. data/lib/webamm_to_rails/sources/controllers/actions/index_definition/presenter.rb +40 -0
  86. data/lib/webamm_to_rails/sources/controllers/actions/index_definition/template.erb +3 -0
  87. data/lib/webamm_to_rails/sources/controllers/actions/new_definition/presenter.rb +40 -0
  88. data/lib/webamm_to_rails/sources/controllers/actions/new_definition/template.erb +3 -0
  89. data/lib/webamm_to_rails/sources/controllers/actions/show_definition/presenter.rb +40 -0
  90. data/lib/webamm_to_rails/sources/controllers/actions/show_definition/template.erb +3 -0
  91. data/lib/webamm_to_rails/sources/controllers/actions/strong_parameters_definition/presenter.rb +50 -0
  92. data/lib/webamm_to_rails/sources/controllers/actions/strong_parameters_definition/template.erb +3 -0
  93. data/lib/webamm_to_rails/sources/controllers/actions/update_definition/presenter.rb +54 -0
  94. data/lib/webamm_to_rails/sources/controllers/actions/update_definition/template.erb +9 -0
  95. data/lib/webamm_to_rails/sources/controllers/application_controller/authentication/devise_groups/presenter.rb +49 -0
  96. data/lib/webamm_to_rails/sources/controllers/application_controller/authentication/devise_groups_definition/presenter.rb +30 -0
  97. data/lib/webamm_to_rails/sources/controllers/application_controller/definition.rb +36 -0
  98. data/lib/webamm_to_rails/sources/controllers/application_controller/template.erb +5 -0
  99. data/lib/webamm_to_rails/sources/controllers/class_definition/presenter.rb +17 -0
  100. data/lib/webamm_to_rails/sources/controllers/definition.rb +44 -0
  101. data/lib/webamm_to_rails/sources/controllers/filters/definition.rb +32 -0
  102. data/lib/webamm_to_rails/sources/controllers/filters/devise_definition/presenter.rb +55 -0
  103. data/lib/webamm_to_rails/sources/controllers/template.erb +17 -0
  104. data/lib/webamm_to_rails/sources/gemfile/default_set.rb +27 -0
  105. data/lib/webamm_to_rails/sources/gemfile/definition.rb +31 -0
  106. data/lib/webamm_to_rails/sources/gemfile/gem.rb +8 -0
  107. data/lib/webamm_to_rails/sources/gemfile/gem_definition/presenter.rb +22 -0
  108. data/lib/webamm_to_rails/sources/gemfile/project_set.rb +21 -0
  109. data/lib/webamm_to_rails/sources/gemfile/sets/authentication.rb +34 -0
  110. data/lib/webamm_to_rails/sources/gemfile/template.erb +17 -0
  111. data/lib/webamm_to_rails/sources/helpers/definitions.rb +21 -0
  112. data/lib/webamm_to_rails/sources/helpers/devise/presenter.rb +27 -0
  113. data/lib/webamm_to_rails/sources/helpers/devise/qr_code_helper/presenter.rb +19 -0
  114. data/lib/webamm_to_rails/sources/helpers/devise/qr_code_helper/template.erb +22 -0
  115. data/lib/webamm_to_rails/sources/initializers/definitions.rb +26 -0
  116. data/lib/webamm_to_rails/sources/initializers/devise_definition/presenter.rb +27 -0
  117. data/lib/webamm_to_rails/sources/initializers/devise_definition/template.erb +397 -0
  118. data/lib/webamm_to_rails/sources/migrations/active_storage_definition/presenter.rb +29 -0
  119. data/lib/webamm_to_rails/sources/migrations/active_storage_definition/template.erb +57 -0
  120. data/lib/webamm_to_rails/sources/migrations/associations.rb +49 -0
  121. data/lib/webamm_to_rails/sources/migrations/class_definition/presenter.rb +17 -0
  122. data/lib/webamm_to_rails/sources/migrations/column_definition/presenter.rb +38 -0
  123. data/lib/webamm_to_rails/sources/migrations/columns.rb +33 -0
  124. data/lib/webamm_to_rails/sources/migrations/definition.rb +52 -0
  125. data/lib/webamm_to_rails/sources/migrations/devise/definition.rb +278 -0
  126. data/lib/webamm_to_rails/sources/migrations/files_list.rb +98 -0
  127. data/lib/webamm_to_rails/sources/migrations/index_definition/presenter.rb +34 -0
  128. data/lib/webamm_to_rails/sources/migrations/indices.rb +33 -0
  129. data/lib/webamm_to_rails/sources/migrations/table_definition/presenter.rb +21 -0
  130. data/lib/webamm_to_rails/sources/migrations/template.erb +12 -0
  131. data/lib/webamm_to_rails/sources/migrations/uuid_definition/presenter.rb +29 -0
  132. data/lib/webamm_to_rails/sources/migrations/uuid_definition/template.erb +5 -0
  133. data/lib/webamm_to_rails/sources/models/association_definition/presenter.rb +49 -0
  134. data/lib/webamm_to_rails/sources/models/associations.rb +113 -0
  135. data/lib/webamm_to_rails/sources/models/attachment_definition/presenter.rb +21 -0
  136. data/lib/webamm_to_rails/sources/models/attachments.rb +25 -0
  137. data/lib/webamm_to_rails/sources/models/class_definition/presenter.rb +17 -0
  138. data/lib/webamm_to_rails/sources/models/concerns.rb +27 -0
  139. data/lib/webamm_to_rails/sources/models/definition.rb +57 -0
  140. data/lib/webamm_to_rails/sources/models/devise_definition/presenter.rb +49 -0
  141. data/lib/webamm_to_rails/sources/models/enum_definition/presenter.rb +19 -0
  142. data/lib/webamm_to_rails/sources/models/enums.rb +25 -0
  143. data/lib/webamm_to_rails/sources/models/template.erb +7 -0
  144. data/lib/webamm_to_rails/sources/package_json/definition.rb +27 -0
  145. data/lib/webamm_to_rails/sources/package_json/template.erb +21 -0
  146. data/lib/webamm_to_rails/sources/routes/authentication_definition/presenter.rb +21 -0
  147. data/lib/webamm_to_rails/sources/routes/definition.rb +38 -0
  148. data/lib/webamm_to_rails/sources/routes/resource_definition/presenter.rb +25 -0
  149. data/lib/webamm_to_rails/sources/routes/template.erb +14 -0
  150. data/lib/webamm_to_rails/sources/views/definition.rb +28 -0
  151. data/lib/webamm_to_rails/sources/views/devise/invitable/presenter.rb +31 -0
  152. data/lib/webamm_to_rails/sources/views/devise/invitable/templates/invitations/edit.html.erb +38 -0
  153. data/lib/webamm_to_rails/sources/views/devise/invitable/templates/invitations/new.html.erb +31 -0
  154. data/lib/webamm_to_rails/sources/views/devise/invitable/templates/mailer/invitation_instructions.html.erb +23 -0
  155. data/lib/webamm_to_rails/sources/views/devise/otp/presenter.rb +32 -0
  156. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_credentials/refresh.html.erb +19 -0
  157. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_credentials/show.html.erb +70 -0
  158. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/_token_secret.html.erb +21 -0
  159. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/_trusted_devices.html.erb +12 -0
  160. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/edit.html.erb +48 -0
  161. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/recovery.html.erb +21 -0
  162. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/recovery_codes.html.erb +3 -0
  163. data/lib/webamm_to_rails/sources/views/devise/otp/templates/otp_tokens/show.html.erb +21 -0
  164. data/lib/webamm_to_rails/sources/views/devise/presenter.rb +37 -0
  165. data/lib/webamm_to_rails/sources/views/devise/standard/presenter.rb +39 -0
  166. data/lib/webamm_to_rails/sources/views/devise/standard/templates/confirmations/new.html.erb +31 -0
  167. data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/confirmation_instructions.html.erb +17 -0
  168. data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/email_changed.html.erb +7 -0
  169. data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/password_change.html.erb +3 -0
  170. data/lib/webamm_to_rails/sources/views/devise/standard/templates/mailer/reset_password_instructions.html.erb +22 -0
  171. data/lib/webamm_to_rails/sources/views/devise/standard/templates/passwords/edit.html.erb +36 -0
  172. data/lib/webamm_to_rails/sources/views/devise/standard/templates/passwords/new.html.erb +31 -0
  173. data/lib/webamm_to_rails/sources/views/devise/standard/templates/registrations/edit.html.erb +43 -0
  174. data/lib/webamm_to_rails/sources/views/devise/standard/templates/registrations/new.html.erb +39 -0
  175. data/lib/webamm_to_rails/sources/views/devise/standard/templates/sessions/new.html.erb +23 -0
  176. data/lib/webamm_to_rails/sources/views/devise/standard/templates/shared/_links.html.erb +27 -0
  177. data/lib/webamm_to_rails/sources/views/resource/edit_definition/presenter.rb +41 -0
  178. data/lib/webamm_to_rails/sources/views/resource/edit_definition/template.erb +1 -0
  179. data/lib/webamm_to_rails/sources/views/resource/form_definition/presenter.rb +50 -0
  180. data/lib/webamm_to_rails/sources/views/resource/form_definition/template.erb +82 -0
  181. data/lib/webamm_to_rails/sources/views/resource/index_definition/presenter.rb +69 -0
  182. data/lib/webamm_to_rails/sources/views/resource/index_definition/template.erb +78 -0
  183. data/lib/webamm_to_rails/sources/views/resource/new_definition/presenter.rb +41 -0
  184. data/lib/webamm_to_rails/sources/views/resource/new_definition/template.erb +1 -0
  185. data/lib/webamm_to_rails/sources/views/resource/presenter.rb +41 -0
  186. data/lib/webamm_to_rails/sources/views/resource/show_definition/presenter.rb +61 -0
  187. data/lib/webamm_to_rails/sources/views/resource/show_definition/template.erb +34 -0
  188. data/lib/webamm_to_rails/utils/format_code.rb +11 -0
  189. data/lib/webamm_to_rails/utils/format_template.rb +11 -0
  190. data/lib/webamm_to_rails/version.rb +5 -0
  191. data/lib/webamm_to_rails.rb +112 -0
  192. data/webamm_to_rails.gemspec +28 -0
  193. 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>
@@ -0,0 +1,3 @@
1
+ <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="100%" height="100%" fill="red"/>
3
+ </svg>
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
@@ -0,0 +1,8 @@
1
+ # Omakase Ruby styling for Rails
2
+ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3
+
4
+ # Overwrite or add rules to create your own house style
5
+ #
6
+ # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7
+ # Layout/SpaceInsideArrayLiteralBrackets:
8
+ # Enabled: false
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ content: [
3
+ './app/views/**/*.html.erb',
4
+ './app/helpers/**/*.rb',
5
+ './app/assets/stylesheets/**/*.css',
6
+ './app/javascript/**/*.js'
7
+ ]
8
+ }
@@ -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,9 @@
1
+ def create
2
+ <%= variable_name %> = <%= new_call %>
3
+
4
+ if <%= variable_name %>.save
5
+ redirect_to <%= redirection_path %>
6
+ else
7
+ render :new, status: :unprocessable_entity
8
+ end
9
+ 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,6 @@
1
+ def destroy
2
+ <%= variable_name %> = <%= find_call %>
3
+ <%= variable_name %>.destroy!
4
+
5
+ redirect_to <%= redirection_path %>, notice: '<%= resource_name %> was successfully destroyed.'
6
+ 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,3 @@
1
+ def edit
2
+ <%= variable_name %> = <%= find_call %>
3
+ 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,3 @@
1
+ def index
2
+ <%= variable_name %> = <%= all_call %>
3
+ 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,3 @@
1
+ def new
2
+ <%= variable_name %> = <%= new_call %>
3
+ 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
@@ -0,0 +1,3 @@
1
+ def show
2
+ <%= variable_name %> = <%= find_call %>
3
+ end
@@ -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,3 @@
1
+ <%= method_name %>
2
+ params.require(<%= param_name %>).permit(<%= permitted_attributes %>)
3
+ 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
@@ -0,0 +1,9 @@
1
+ def update
2
+ <%= variable_name %> = <%= find_call %>
3
+
4
+ if <%= update_call %>
5
+ redirect_to <%= redirection_path %>
6
+ else
7
+ render :edit, status: :unprocessable_entity
8
+ end
9
+ end