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,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,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 @@
|
|
1
|
+
<%= yield %>
|
@@ -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,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,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 @@
|
|
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,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
|