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,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative "config/application"
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,2 @@
1
+ //= link_tree ../images
2
+ //= link_tree ../builds
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ // Entry point for the build script in your package.json
2
+ import "@hotwired/turbo-rails"
3
+ import "./controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ // This file is auto-generated by ./bin/rails stimulus:manifest:update
2
+ // Run that command whenever you add a new controller or create them with
3
+ // ./bin/rails generate stimulus controllerName
4
+
5
+ import { application } from "./application"
6
+
7
+ import HelloController from "./hello_controller"
8
+ application.register("hello", HelloController)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= content_for(:title) || "railsplanapp" %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="apple-mobile-web-app-capable" content="yes">
7
+ <%= csrf_meta_tags %>
8
+ <%= csp_meta_tag %>
9
+
10
+ <%= yield :head %>
11
+
12
+ <link rel="manifest" href="/manifest.json">
13
+ <link rel="icon" href="/icon.png" type="image/png">
14
+ <link rel="icon" href="/icon.svg" type="image/svg+xml">
15
+ <link rel="apple-touch-icon" href="/icon.png">
16
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
17
+ <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
18
+ </head>
19
+
20
+ <body>
21
+ <div class="max-w-[85rem] w-full mx-auto px-4 sm:px-6 lg:px-8 antialiased">
22
+ <% if notice.present? %>
23
+ <div id="dismiss-alert" class="hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 bg-teal-50 border border-teal-200 text-sm text-teal-800 rounded-lg p-4 dark:bg-teal-800/10 dark:border-teal-900 dark:text-teal-500" role="alert" tabindex="-1" aria-labelledby="hs-dismiss-button-label">
24
+ <div class="flex">
25
+ <div class="shrink-0">
26
+ <svg class="shrink-0 size-4 mt-0.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
27
+ <path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path>
28
+ <path d="m9 12 2 2 4-4"></path>
29
+ </svg>
30
+ </div>
31
+ <div class="ms-2">
32
+ <h3 id="hs-dismiss-button-label" class="text-sm font-medium">
33
+ <%= notice %>
34
+ </h3>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <% end %>
39
+ <div class="max-w-[85rem] w-full mx-auto mt-10">
40
+ <%= yield %>
41
+ </div>
42
+ </div>
43
+ </body>
44
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "railsplanapp",
3
+ "icons": [
4
+ {
5
+ "src": "/icon.png",
6
+ "type": "image/png",
7
+ "sizes": "512x512"
8
+ },
9
+ {
10
+ "src": "/icon.png",
11
+ "type": "image/png",
12
+ "sizes": "512x512",
13
+ "purpose": "maskable"
14
+ }
15
+ ],
16
+ "start_url": "/",
17
+ "display": "standalone",
18
+ "scope": "/",
19
+ "description": "railsplanapp.",
20
+ "theme_color": "red",
21
+ "background_color": "red"
22
+ }
@@ -0,0 +1,26 @@
1
+ // Add a service worker for processing Web Push notifications:
2
+ //
3
+ // self.addEventListener("push", async (event) => {
4
+ // const { title, options } = await event.data.json()
5
+ // event.waitUntil(self.registration.showNotification(title, options))
6
+ // })
7
+ //
8
+ // self.addEventListener("notificationclick", function(event) {
9
+ // event.notification.close()
10
+ // event.waitUntil(
11
+ // clients.matchAll({ type: "window" }).then((clientList) => {
12
+ // for (let i = 0; i < clientList.length; i++) {
13
+ // let client = clientList[i]
14
+ // let clientPath = (new URL(client.url)).pathname
15
+ //
16
+ // if (clientPath == event.notification.data.path && "focus" in client) {
17
+ // return client.focus()
18
+ // }
19
+ // }
20
+ //
21
+ // if (clients.openWindow) {
22
+ // return clients.openWindow(event.notification.data.path)
23
+ // }
24
+ // })
25
+ // )
26
+ // })
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ ARGV.unshift("--ensure-latest")
6
+
7
+ load Gem.bin_path("brakeman", "brakeman")
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_requirement
64
+ @bundler_requirement ||=
65
+ env_var_version ||
66
+ cli_arg_version ||
67
+ bundler_requirement_for(lockfile_version)
68
+ end
69
+
70
+ def bundler_requirement_for(version)
71
+ return "#{Gem::Requirement.default}.a" unless version
72
+
73
+ bundler_gem_version = Gem::Version.new(version)
74
+
75
+ bundler_gem_version.approximate_recommendation
76
+ end
77
+
78
+ def load_bundler!
79
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
80
+
81
+ activate_bundler
82
+ end
83
+
84
+ def activate_bundler
85
+ gem_error = activation_error_handling do
86
+ gem "bundler", bundler_requirement
87
+ end
88
+ return if gem_error.nil?
89
+ require_error = activation_error_handling do
90
+ require "bundler/version"
91
+ end
92
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
93
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94
+ exit 42
95
+ end
96
+
97
+ def activation_error_handling
98
+ yield
99
+ nil
100
+ rescue StandardError, LoadError => e
101
+ e
102
+ end
103
+ end
104
+
105
+ m.load_bundler!
106
+
107
+ if m.invoked_as_script?
108
+ load Gem.bin_path("bundler", "bundle")
109
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env sh
2
+
3
+ if gem list --no-installed --exact --silent foreman; then
4
+ echo "Installing foreman..."
5
+ gem install foreman
6
+ fi
7
+
8
+ # Default to port 3000 if not specified
9
+ export PORT="${PORT:-3000}"
10
+
11
+ exec foreman start -f Procfile.dev --env /dev/null "$@"
@@ -0,0 +1,13 @@
1
+ #!/bin/bash -e
2
+
3
+ # Enable jemalloc for reduced memory usage and latency.
4
+ if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
5
+ export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
6
+ fi
7
+
8
+ # If running the rails server then create or migrate existing database
9
+ if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
10
+ ./bin/rails db:prepare
11
+ fi
12
+
13
+ exec "${@}"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path("../config/application", __dir__)
3
+ require_relative "../config/boot"
4
+ require "rails/commands"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../config/boot"
3
+ require "rake"
4
+ Rake.application.run
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "bundler/setup"
4
+
5
+ # explicit rubocop config increases performance slightly while avoiding config confusion.
6
+ ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7
+
8
+ load Gem.bin_path("rubocop", "rubocop")
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ APP_ROOT = File.expand_path("..", __dir__)
5
+ APP_NAME = "railsplanapp"
6
+
7
+ def system!(*args)
8
+ system(*args, exception: true)
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts "== Installing dependencies =="
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
19
+
20
+ # Install JavaScript dependencies
21
+ system("yarn install --check-files")
22
+
23
+ # puts "\n== Copying sample files =="
24
+ # unless File.exist?("config/database.yml")
25
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
26
+ # end
27
+
28
+ puts "\n== Preparing database =="
29
+ system! "bin/rails db:prepare"
30
+
31
+ puts "\n== Removing old logs and tempfiles =="
32
+ system! "bin/rails log:clear tmp:clear"
33
+
34
+ puts "\n== Restarting application server =="
35
+ system! "bin/rails restart"
36
+
37
+ # puts "\n== Configuring puma-dev =="
38
+ # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
39
+ # system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
40
+ end
@@ -0,0 +1,42 @@
1
+ require_relative "boot"
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ require "active_record/railtie"
8
+ require "active_storage/engine"
9
+ require "action_controller/railtie"
10
+ require "action_mailer/railtie"
11
+ require "action_mailbox/engine"
12
+ require "action_text/engine"
13
+ require "action_view/railtie"
14
+ require "action_cable/engine"
15
+ # require "rails/test_unit/railtie"
16
+
17
+ # Require the gems listed in Gemfile, including any gems
18
+ # you've limited to :test, :development, or :production.
19
+ Bundler.require(*Rails.groups)
20
+
21
+ module Railsplanapp
22
+ class Application < Rails::Application
23
+ # Initialize configuration defaults for originally generated Rails version.
24
+ config.load_defaults 7.1
25
+
26
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
27
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
28
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
29
+ config.autoload_lib(ignore: %w[assets tasks])
30
+
31
+ # Configuration for the application, engines, and railties goes here.
32
+ #
33
+ # These settings can be overridden in specific environments using the files
34
+ # in config/environments, which are processed later.
35
+ #
36
+ # config.time_zone = "Central Time (US & Canada)"
37
+ # config.eager_load_paths << Rails.root.join("extras")
38
+
39
+ # Don't generate system test files.
40
+ config.generators.system_tests = nil
41
+ end
42
+ end
@@ -0,0 +1,4 @@
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,11 @@
1
+ development:
2
+ adapter: redis
3
+ url: redis://localhost:6379/1
4
+
5
+ test:
6
+ adapter: test
7
+
8
+ production:
9
+ adapter: redis
10
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
11
+ channel_prefix: railsplanapp_production
@@ -0,0 +1 @@
1
+ 3OYaiyW6ve8IdhITA4tRu2Rn9y+zjssh04V6GrCs6Li3t/G8gkmt5jhW9QDt2hxJ/oHOpRcIdUqVfJhge9QnSAaz1YXegGy+yIn1pyUeFvMoOzvLanGx8AwJ9EYjHvDOlaO4lVlGb+ZN0KX9FjD6V5IpWHEfecMBkWTuXY2OpzQxqZw5v1hD3Ep/gc514gd2lVW1a8CYl1I2yFLAeUEoGvi1yc74Ad3RnTaPsxX5ARUi3/bE9U+4FtrQB7ditI/ov+de1rIKfvPnuTkt2PGXm2BcOISlPw7m9zHZuUkmPRvkU/tn4WaoucyIH/TqJc0w7NCMxxWnFbrXjPiVFgV97A9lxX8JhHoa79UbGDEwC4PTPEJGpFJ7NTwHwCMa23CWtPm9Npl0Sr/pzLdRQc2t/ng7Wyn5--IAFJaa8D3zre+WPh--XOhJZz4uvk2yHGtTFxUhTw==
@@ -0,0 +1,85 @@
1
+ # PostgreSQL. Versions 9.3 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On macOS with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On Windows:
8
+ # gem install pg
9
+ # Choose the win32 build.
10
+ # Install PostgreSQL and put its /bin directory on your path.
11
+ #
12
+ # Configure Using Gemfile
13
+ # gem "pg"
14
+ #
15
+ default: &default
16
+ adapter: postgresql
17
+ encoding: unicode
18
+ # For details on connection pooling, see Rails configuration guide
19
+ # https://guides.rubyonrails.org/configuring.html#database-pooling
20
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
21
+
22
+
23
+ development:
24
+ <<: *default
25
+ database: railsplanapp_development
26
+
27
+ # The specified database role being used to connect to PostgreSQL.
28
+ # To create additional roles in PostgreSQL see `$ createuser --help`.
29
+ # When left blank, PostgreSQL will use the default role. This is
30
+ # the same name as the operating system user running Rails.
31
+ #username: railsplanapp
32
+
33
+ # The password associated with the PostgreSQL role (username).
34
+ #password:
35
+
36
+ # Connect on a TCP socket. Omitted by default since the client uses a
37
+ # domain socket that doesn't need configuration. Windows does not have
38
+ # domain sockets, so uncomment these lines.
39
+ #host: localhost
40
+
41
+ # The TCP port the server listens on. Defaults to 5432.
42
+ # If your server runs on a different port number, change accordingly.
43
+ #port: 5432
44
+
45
+ # Schema search path. The server defaults to $user,public
46
+ #schema_search_path: myapp,sharedapp,public
47
+
48
+ # Minimum log levels, in increasing order:
49
+ # debug5, debug4, debug3, debug2, debug1,
50
+ # log, notice, warning, error, fatal, and panic
51
+ # Defaults to warning.
52
+ #min_messages: notice
53
+
54
+ # Warning: The database defined as "test" will be erased and
55
+ # re-generated from your development database when you run "rake".
56
+ # Do not set this db to the same as development or production.
57
+ test:
58
+ <<: *default
59
+ database: railsplanapp_test
60
+
61
+ # As with config/credentials.yml, you never want to store sensitive information,
62
+ # like your database password, in your source code. If your source code is
63
+ # ever seen by anyone, they now have access to your database.
64
+ #
65
+ # Instead, provide the password or a full connection URL as an environment
66
+ # variable when you boot the app. For example:
67
+ #
68
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
69
+ #
70
+ # If the connection URL is provided in the special DATABASE_URL environment
71
+ # variable, Rails will automatically merge its configuration values on top of
72
+ # the values provided in this file. Alternatively, you can specify a connection
73
+ # URL environment variable explicitly:
74
+ #
75
+ # production:
76
+ # url: <%= ENV["MY_APP_DATABASE_URL"] %>
77
+ #
78
+ # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
79
+ # for a full overview on how database connection configuration can be specified.
80
+ #
81
+ production:
82
+ <<: *default
83
+ database: railsplanapp_production
84
+ username: railsplanapp
85
+ password: <%= ENV["RAILSPLANAPP_DATABASE_PASSWORD"] %>
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,84 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.enable_reloading = true
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing.
18
+ config.server_timing = true
19
+
20
+ # Enable/disable caching. By default caching is disabled.
21
+ # Run rails dev:cache to toggle caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ config.action_controller.perform_caching = true
24
+ config.action_controller.enable_fragment_cache_logging = true
25
+
26
+ config.cache_store = :memory_store
27
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
28
+ else
29
+ config.action_controller.perform_caching = false
30
+
31
+ config.cache_store = :null_store
32
+ end
33
+
34
+ # Store uploaded files on the local file system (see config/storage.yml for options).
35
+ config.active_storage.service = :local
36
+
37
+ # Don't care if the mailer can't send.
38
+ config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Disable caching for Action Mailer templates even if Action Controller
41
+ # caching is enabled.
42
+ config.action_mailer.perform_caching = false
43
+
44
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
45
+
46
+ # Print deprecation notices to the Rails logger.
47
+ config.active_support.deprecation = :log
48
+
49
+ # Raise exceptions for disallowed deprecations.
50
+ config.active_support.disallowed_deprecation = :raise
51
+
52
+ # Tell Active Support which deprecation messages to disallow.
53
+ config.active_support.disallowed_deprecation_warnings = []
54
+
55
+ # Raise an error on page load if there are pending migrations.
56
+ config.active_record.migration_error = :page_load
57
+
58
+ # Highlight code that triggered database queries in logs.
59
+ config.active_record.verbose_query_logs = true
60
+
61
+ # Highlight code that enqueued background job in logs.
62
+ config.active_job.verbose_enqueue_logs = true
63
+
64
+ # Suppress logger output for asset requests.
65
+ config.assets.quiet = true
66
+
67
+ # Raises error for missing translations.
68
+ # config.i18n.raise_on_missing_translations = true
69
+
70
+ # Annotate rendered view with file names.
71
+ config.action_view.annotate_rendered_view_with_filenames = true
72
+
73
+ # Uncomment if you wish to allow Action Cable access from any origin.
74
+ # config.action_cable.disable_request_forgery_protection = true
75
+
76
+ # Raise error when a before_action's only/except options reference missing actions.
77
+ config.action_controller.raise_on_missing_callback_actions = true
78
+
79
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
80
+ # config.generators.apply_rubocop_autocorrect_after_generate!
81
+
82
+ config.action_mailer.delivery_method = :letter_opener_web
83
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
84
+ end