From 3fe0a07cdc4c48f38ff427b888be718bac4a3988 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 11 Sep 2025 12:22:32 -0400 Subject: [PATCH] rails plugin new gems/fizzy-saas --mountable --- Gemfile | 2 + gems/fizzy-saas/.github/dependabot.yml | 12 ++ gems/fizzy-saas/.github/workflows/ci.yml | 69 +++++++++++ gems/fizzy-saas/.gitignore | 10 ++ gems/fizzy-saas/.rubocop.yml | 8 ++ gems/fizzy-saas/Gemfile | 16 +++ gems/fizzy-saas/README.md | 28 +++++ gems/fizzy-saas/Rakefile | 8 ++ .../app/assets/images/fizzy/saas/.keep | 0 .../stylesheets/fizzy/saas/application.css | 15 +++ .../fizzy-saas/app/controllers/concerns/.keep | 0 .../fizzy/saas/application_controller.rb | 6 + .../helpers/fizzy/saas/application_helper.rb | 6 + .../app/jobs/fizzy/saas/application_job.rb | 6 + .../mailers/fizzy/saas/application_mailer.rb | 8 ++ gems/fizzy-saas/app/models/concerns/.keep | 0 .../models/fizzy/saas/application_record.rb | 7 ++ .../layouts/fizzy/saas/application.html.erb | 17 +++ gems/fizzy-saas/bin/rails | 14 +++ gems/fizzy-saas/bin/rubocop | 8 ++ gems/fizzy-saas/config/routes.rb | 2 + gems/fizzy-saas/fizzy-saas.gemspec | 25 ++++ gems/fizzy-saas/lib/fizzy/saas.rb | 8 ++ gems/fizzy-saas/lib/fizzy/saas/engine.rb | 7 ++ gems/fizzy-saas/lib/fizzy/saas/version.rb | 5 + .../lib/tasks/fizzy/saas_tasks.rake | 4 + gems/fizzy-saas/test/controllers/.keep | 0 gems/fizzy-saas/test/dummy/Rakefile | 6 + .../test/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 +++ .../app/controllers/application_controller.rb | 4 + .../test/dummy/app/controllers/concerns/.keep | 0 .../dummy/app/helpers/application_helper.rb | 2 + .../test/dummy/app/jobs/application_job.rb | 7 ++ .../dummy/app/mailers/application_mailer.rb | 4 + .../dummy/app/models/application_record.rb | 3 + .../test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 28 +++++ .../dummy/app/views/layouts/mailer.html.erb | 13 ++ .../dummy/app/views/layouts/mailer.text.erb | 1 + .../dummy/app/views/pwa/manifest.json.erb | 22 ++++ .../dummy/app/views/pwa/service-worker.js | 26 ++++ gems/fizzy-saas/test/dummy/bin/bundler-audit | 6 + gems/fizzy-saas/test/dummy/bin/ci | 6 + gems/fizzy-saas/test/dummy/bin/dev | 2 + gems/fizzy-saas/test/dummy/bin/rails | 4 + gems/fizzy-saas/test/dummy/bin/rake | 4 + gems/fizzy-saas/test/dummy/bin/setup | 35 ++++++ gems/fizzy-saas/test/dummy/config.ru | 6 + .../test/dummy/config/application.rb | 29 +++++ gems/fizzy-saas/test/dummy/config/boot.rb | 5 + .../test/dummy/config/bundler-audit.yml | 5 + gems/fizzy-saas/test/dummy/config/cable.yml | 10 ++ gems/fizzy-saas/test/dummy/config/ci.rb | 19 +++ .../fizzy-saas/test/dummy/config/database.yml | 32 +++++ .../test/dummy/config/environment.rb | 5 + .../dummy/config/environments/development.rb | 72 +++++++++++ .../dummy/config/environments/production.rb | 89 ++++++++++++++ .../test/dummy/config/environments/test.rb | 53 ++++++++ .../test/dummy/config/initializers/assets.rb | 7 ++ .../initializers/content_security_policy.rb | 29 +++++ .../initializers/filter_parameter_logging.rb | 8 ++ .../dummy/config/initializers/inflections.rb | 16 +++ .../test/dummy/config/locales/en.yml | 31 +++++ gems/fizzy-saas/test/dummy/config/puma.rb | 39 ++++++ gems/fizzy-saas/test/dummy/config/routes.rb | 3 + gems/fizzy-saas/test/dummy/config/storage.yml | 27 +++++ gems/fizzy-saas/test/dummy/log/.keep | 0 gems/fizzy-saas/test/dummy/public/400.html | 114 ++++++++++++++++++ gems/fizzy-saas/test/dummy/public/404.html | 114 ++++++++++++++++++ .../dummy/public/406-unsupported-browser.html | 114 ++++++++++++++++++ gems/fizzy-saas/test/dummy/public/422.html | 114 ++++++++++++++++++ gems/fizzy-saas/test/dummy/public/500.html | 114 ++++++++++++++++++ gems/fizzy-saas/test/dummy/public/icon.png | Bin 0 -> 4166 bytes gems/fizzy-saas/test/dummy/public/icon.svg | 3 + gems/fizzy-saas/test/fixtures/files/.keep | 0 gems/fizzy-saas/test/fizzy/saas_test.rb | 7 ++ gems/fizzy-saas/test/helpers/.keep | 0 gems/fizzy-saas/test/integration/.keep | 0 .../test/integration/navigation_test.rb | 7 ++ gems/fizzy-saas/test/mailers/.keep | 0 gems/fizzy-saas/test/models/.keep | 0 gems/fizzy-saas/test/test_helper.rb | 15 +++ 83 files changed, 1566 insertions(+) create mode 100644 gems/fizzy-saas/.github/dependabot.yml create mode 100644 gems/fizzy-saas/.github/workflows/ci.yml create mode 100644 gems/fizzy-saas/.gitignore create mode 100644 gems/fizzy-saas/.rubocop.yml create mode 100644 gems/fizzy-saas/Gemfile create mode 100644 gems/fizzy-saas/README.md create mode 100644 gems/fizzy-saas/Rakefile create mode 100644 gems/fizzy-saas/app/assets/images/fizzy/saas/.keep create mode 100644 gems/fizzy-saas/app/assets/stylesheets/fizzy/saas/application.css create mode 100644 gems/fizzy-saas/app/controllers/concerns/.keep create mode 100644 gems/fizzy-saas/app/controllers/fizzy/saas/application_controller.rb create mode 100644 gems/fizzy-saas/app/helpers/fizzy/saas/application_helper.rb create mode 100644 gems/fizzy-saas/app/jobs/fizzy/saas/application_job.rb create mode 100644 gems/fizzy-saas/app/mailers/fizzy/saas/application_mailer.rb create mode 100644 gems/fizzy-saas/app/models/concerns/.keep create mode 100644 gems/fizzy-saas/app/models/fizzy/saas/application_record.rb create mode 100644 gems/fizzy-saas/app/views/layouts/fizzy/saas/application.html.erb create mode 100755 gems/fizzy-saas/bin/rails create mode 100755 gems/fizzy-saas/bin/rubocop create mode 100644 gems/fizzy-saas/config/routes.rb create mode 100644 gems/fizzy-saas/fizzy-saas.gemspec create mode 100644 gems/fizzy-saas/lib/fizzy/saas.rb create mode 100644 gems/fizzy-saas/lib/fizzy/saas/engine.rb create mode 100644 gems/fizzy-saas/lib/fizzy/saas/version.rb create mode 100644 gems/fizzy-saas/lib/tasks/fizzy/saas_tasks.rake create mode 100644 gems/fizzy-saas/test/controllers/.keep create mode 100644 gems/fizzy-saas/test/dummy/Rakefile create mode 100644 gems/fizzy-saas/test/dummy/app/assets/images/.keep create mode 100644 gems/fizzy-saas/test/dummy/app/assets/stylesheets/application.css create mode 100644 gems/fizzy-saas/test/dummy/app/controllers/application_controller.rb create mode 100644 gems/fizzy-saas/test/dummy/app/controllers/concerns/.keep create mode 100644 gems/fizzy-saas/test/dummy/app/helpers/application_helper.rb create mode 100644 gems/fizzy-saas/test/dummy/app/jobs/application_job.rb create mode 100644 gems/fizzy-saas/test/dummy/app/mailers/application_mailer.rb create mode 100644 gems/fizzy-saas/test/dummy/app/models/application_record.rb create mode 100644 gems/fizzy-saas/test/dummy/app/models/concerns/.keep create mode 100644 gems/fizzy-saas/test/dummy/app/views/layouts/application.html.erb create mode 100644 gems/fizzy-saas/test/dummy/app/views/layouts/mailer.html.erb create mode 100644 gems/fizzy-saas/test/dummy/app/views/layouts/mailer.text.erb create mode 100644 gems/fizzy-saas/test/dummy/app/views/pwa/manifest.json.erb create mode 100644 gems/fizzy-saas/test/dummy/app/views/pwa/service-worker.js create mode 100755 gems/fizzy-saas/test/dummy/bin/bundler-audit create mode 100755 gems/fizzy-saas/test/dummy/bin/ci create mode 100755 gems/fizzy-saas/test/dummy/bin/dev create mode 100755 gems/fizzy-saas/test/dummy/bin/rails create mode 100755 gems/fizzy-saas/test/dummy/bin/rake create mode 100755 gems/fizzy-saas/test/dummy/bin/setup create mode 100644 gems/fizzy-saas/test/dummy/config.ru create mode 100644 gems/fizzy-saas/test/dummy/config/application.rb create mode 100644 gems/fizzy-saas/test/dummy/config/boot.rb create mode 100644 gems/fizzy-saas/test/dummy/config/bundler-audit.yml create mode 100644 gems/fizzy-saas/test/dummy/config/cable.yml create mode 100644 gems/fizzy-saas/test/dummy/config/ci.rb create mode 100644 gems/fizzy-saas/test/dummy/config/database.yml create mode 100644 gems/fizzy-saas/test/dummy/config/environment.rb create mode 100644 gems/fizzy-saas/test/dummy/config/environments/development.rb create mode 100644 gems/fizzy-saas/test/dummy/config/environments/production.rb create mode 100644 gems/fizzy-saas/test/dummy/config/environments/test.rb create mode 100644 gems/fizzy-saas/test/dummy/config/initializers/assets.rb create mode 100644 gems/fizzy-saas/test/dummy/config/initializers/content_security_policy.rb create mode 100644 gems/fizzy-saas/test/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 gems/fizzy-saas/test/dummy/config/initializers/inflections.rb create mode 100644 gems/fizzy-saas/test/dummy/config/locales/en.yml create mode 100644 gems/fizzy-saas/test/dummy/config/puma.rb create mode 100644 gems/fizzy-saas/test/dummy/config/routes.rb create mode 100644 gems/fizzy-saas/test/dummy/config/storage.yml create mode 100644 gems/fizzy-saas/test/dummy/log/.keep create mode 100644 gems/fizzy-saas/test/dummy/public/400.html create mode 100644 gems/fizzy-saas/test/dummy/public/404.html create mode 100644 gems/fizzy-saas/test/dummy/public/406-unsupported-browser.html create mode 100644 gems/fizzy-saas/test/dummy/public/422.html create mode 100644 gems/fizzy-saas/test/dummy/public/500.html create mode 100644 gems/fizzy-saas/test/dummy/public/icon.png create mode 100644 gems/fizzy-saas/test/dummy/public/icon.svg create mode 100644 gems/fizzy-saas/test/fixtures/files/.keep create mode 100644 gems/fizzy-saas/test/fizzy/saas_test.rb create mode 100644 gems/fizzy-saas/test/helpers/.keep create mode 100644 gems/fizzy-saas/test/integration/.keep create mode 100644 gems/fizzy-saas/test/integration/navigation_test.rb create mode 100644 gems/fizzy-saas/test/mailers/.keep create mode 100644 gems/fizzy-saas/test/models/.keep create mode 100644 gems/fizzy-saas/test/test_helper.rb diff --git a/Gemfile b/Gemfile index d60542c70..f6f7e063f 100644 --- a/Gemfile +++ b/Gemfile @@ -71,3 +71,5 @@ group :test do gem "vcr" gem "mocha" end + +gem "fizzy-saas", path: "gems/fizzy-saas" \ No newline at end of file diff --git a/gems/fizzy-saas/.github/dependabot.yml b/gems/fizzy-saas/.github/dependabot.yml new file mode 100644 index 000000000..83610cfa4 --- /dev/null +++ b/gems/fizzy-saas/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 diff --git a/gems/fizzy-saas/.github/workflows/ci.yml b/gems/fizzy-saas/.github/workflows/ci.yml new file mode 100644 index 000000000..ef5e97c73 --- /dev/null +++ b/gems/fizzy-saas/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + env: + RUBY_VERSION: ruby-3.4.5 + RUBOCOP_CACHE_ROOT: tmp/rubocop + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ env.RUBY_VERSION }} + bundler-cache: true + + - name: Prepare RuboCop cache + uses: actions/cache@v4 + env: + DEPENDENCIES_HASH: ${{ hashFiles('**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }} + with: + path: ${{ env.RUBOCOP_CACHE_ROOT }} + key: rubocop-${{ runner.os }}-${{ env.RUBY_VERSION }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }} + restore-keys: | + rubocop-${{ runner.os }}-${{ env.RUBY_VERSION }}-${{ env.DEPENDENCIES_HASH }}- + + - name: Lint code for consistent style + run: bin/rubocop -f github + + test: + runs-on: ubuntu-latest + + # services: + # redis: + # image: valkey/valkey:8 + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby-3.4.5 + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore diff --git a/gems/fizzy-saas/.gitignore b/gems/fizzy-saas/.gitignore new file mode 100644 index 000000000..a3ee5aad3 --- /dev/null +++ b/gems/fizzy-saas/.gitignore @@ -0,0 +1,10 @@ +/.bundle/ +/doc/ +/log/*.log +/pkg/ +/tmp/ +/test/dummy/db/*.sqlite3 +/test/dummy/db/*.sqlite3-* +/test/dummy/log/*.log +/test/dummy/storage/ +/test/dummy/tmp/ diff --git a/gems/fizzy-saas/.rubocop.yml b/gems/fizzy-saas/.rubocop.yml new file mode 100644 index 000000000..f9d86d4a5 --- /dev/null +++ b/gems/fizzy-saas/.rubocop.yml @@ -0,0 +1,8 @@ +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false diff --git a/gems/fizzy-saas/Gemfile b/gems/fizzy-saas/Gemfile new file mode 100644 index 000000000..8b4783bea --- /dev/null +++ b/gems/fizzy-saas/Gemfile @@ -0,0 +1,16 @@ +source "https://rubygems.org" + +# Specify your gem's dependencies in fizzy-saas.gemspec. +gemspec + +gem "puma" + +gem "sqlite3" + +gem "propshaft" + +# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] +gem "rubocop-rails-omakase", require: false + +# Start debugger with binding.b [https://github.com/ruby/debug] +# gem "debug", ">= 1.0.0" diff --git a/gems/fizzy-saas/README.md b/gems/fizzy-saas/README.md new file mode 100644 index 000000000..ecaa3ede6 --- /dev/null +++ b/gems/fizzy-saas/README.md @@ -0,0 +1,28 @@ +# Fizzy::Saas +Short description and motivation. + +## Usage +How to use my plugin. + +## Installation +Add this line to your application's Gemfile: + +```ruby +gem "fizzy-saas" +``` + +And then execute: +```bash +$ bundle +``` + +Or install it yourself as: +```bash +$ gem install fizzy-saas +``` + +## Contributing +Contribution directions go here. + +## License +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/gems/fizzy-saas/Rakefile b/gems/fizzy-saas/Rakefile new file mode 100644 index 000000000..e7793b5c1 --- /dev/null +++ b/gems/fizzy-saas/Rakefile @@ -0,0 +1,8 @@ +require "bundler/setup" + +APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) +load "rails/tasks/engine.rake" + +load "rails/tasks/statistics.rake" + +require "bundler/gem_tasks" diff --git a/gems/fizzy-saas/app/assets/images/fizzy/saas/.keep b/gems/fizzy-saas/app/assets/images/fizzy/saas/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/app/assets/stylesheets/fizzy/saas/application.css b/gems/fizzy-saas/app/assets/stylesheets/fizzy/saas/application.css new file mode 100644 index 000000000..0ebd7fe82 --- /dev/null +++ b/gems/fizzy-saas/app/assets/stylesheets/fizzy/saas/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/gems/fizzy-saas/app/controllers/concerns/.keep b/gems/fizzy-saas/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/app/controllers/fizzy/saas/application_controller.rb b/gems/fizzy-saas/app/controllers/fizzy/saas/application_controller.rb new file mode 100644 index 000000000..529ee8f01 --- /dev/null +++ b/gems/fizzy-saas/app/controllers/fizzy/saas/application_controller.rb @@ -0,0 +1,6 @@ +module Fizzy + module Saas + class ApplicationController < ActionController::Base + end + end +end diff --git a/gems/fizzy-saas/app/helpers/fizzy/saas/application_helper.rb b/gems/fizzy-saas/app/helpers/fizzy/saas/application_helper.rb new file mode 100644 index 000000000..1a03deb30 --- /dev/null +++ b/gems/fizzy-saas/app/helpers/fizzy/saas/application_helper.rb @@ -0,0 +1,6 @@ +module Fizzy + module Saas + module ApplicationHelper + end + end +end diff --git a/gems/fizzy-saas/app/jobs/fizzy/saas/application_job.rb b/gems/fizzy-saas/app/jobs/fizzy/saas/application_job.rb new file mode 100644 index 000000000..afa507101 --- /dev/null +++ b/gems/fizzy-saas/app/jobs/fizzy/saas/application_job.rb @@ -0,0 +1,6 @@ +module Fizzy + module Saas + class ApplicationJob < ActiveJob::Base + end + end +end diff --git a/gems/fizzy-saas/app/mailers/fizzy/saas/application_mailer.rb b/gems/fizzy-saas/app/mailers/fizzy/saas/application_mailer.rb new file mode 100644 index 000000000..09eb29e63 --- /dev/null +++ b/gems/fizzy-saas/app/mailers/fizzy/saas/application_mailer.rb @@ -0,0 +1,8 @@ +module Fizzy + module Saas + class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" + end + end +end diff --git a/gems/fizzy-saas/app/models/concerns/.keep b/gems/fizzy-saas/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/app/models/fizzy/saas/application_record.rb b/gems/fizzy-saas/app/models/fizzy/saas/application_record.rb new file mode 100644 index 000000000..880ec7eaa --- /dev/null +++ b/gems/fizzy-saas/app/models/fizzy/saas/application_record.rb @@ -0,0 +1,7 @@ +module Fizzy + module Saas + class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true + end + end +end diff --git a/gems/fizzy-saas/app/views/layouts/fizzy/saas/application.html.erb b/gems/fizzy-saas/app/views/layouts/fizzy/saas/application.html.erb new file mode 100644 index 000000000..144b37838 --- /dev/null +++ b/gems/fizzy-saas/app/views/layouts/fizzy/saas/application.html.erb @@ -0,0 +1,17 @@ + + + + Fizzy saas + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= yield :head %> + + <%= stylesheet_link_tag "fizzy/saas/application", media: "all" %> + + + +<%= yield %> + + + diff --git a/gems/fizzy-saas/bin/rails b/gems/fizzy-saas/bin/rails new file mode 100755 index 000000000..42a0e5bce --- /dev/null +++ b/gems/fizzy-saas/bin/rails @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails gems +# installed from the root of your application. + +ENGINE_ROOT = File.expand_path("..", __dir__) +ENGINE_PATH = File.expand_path("../lib/fizzy/saas/engine", __dir__) +APP_PATH = File.expand_path("../test/dummy/config/application", __dir__) + +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) + +require "rails/all" +require "rails/engine/commands" diff --git a/gems/fizzy-saas/bin/rubocop b/gems/fizzy-saas/bin/rubocop new file mode 100755 index 000000000..40330c0ff --- /dev/null +++ b/gems/fizzy-saas/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/gems/fizzy-saas/config/routes.rb b/gems/fizzy-saas/config/routes.rb new file mode 100644 index 000000000..675eba816 --- /dev/null +++ b/gems/fizzy-saas/config/routes.rb @@ -0,0 +1,2 @@ +Fizzy::Saas::Engine.routes.draw do +end diff --git a/gems/fizzy-saas/fizzy-saas.gemspec b/gems/fizzy-saas/fizzy-saas.gemspec new file mode 100644 index 000000000..52c150c94 --- /dev/null +++ b/gems/fizzy-saas/fizzy-saas.gemspec @@ -0,0 +1,25 @@ +require_relative "lib/fizzy/saas/version" + +Gem::Specification.new do |spec| + spec.name = "fizzy-saas" + spec.version = Fizzy::Saas::VERSION + spec.authors = [ "Mike Dalessio" ] + spec.email = [ "mike@37signals.com" ] + spec.homepage = "TODO" + spec.summary = "TODO: Summary of Fizzy::Saas." + spec.description = "TODO: Description of Fizzy::Saas." + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host" + # to allow pushing to a single host or delete this section to allow pushing to any host. + spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here." + spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." + + spec.files = Dir.chdir(File.expand_path(__dir__)) do + Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] + end + + spec.add_dependency "rails", ">= 8.1.0.beta1" +end diff --git a/gems/fizzy-saas/lib/fizzy/saas.rb b/gems/fizzy-saas/lib/fizzy/saas.rb new file mode 100644 index 000000000..bfdd34dfa --- /dev/null +++ b/gems/fizzy-saas/lib/fizzy/saas.rb @@ -0,0 +1,8 @@ +require "fizzy/saas/version" +require "fizzy/saas/engine" + +module Fizzy + module Saas + # Your code goes here... + end +end diff --git a/gems/fizzy-saas/lib/fizzy/saas/engine.rb b/gems/fizzy-saas/lib/fizzy/saas/engine.rb new file mode 100644 index 000000000..5af88bb33 --- /dev/null +++ b/gems/fizzy-saas/lib/fizzy/saas/engine.rb @@ -0,0 +1,7 @@ +module Fizzy + module Saas + class Engine < ::Rails::Engine + isolate_namespace Fizzy::Saas + end + end +end diff --git a/gems/fizzy-saas/lib/fizzy/saas/version.rb b/gems/fizzy-saas/lib/fizzy/saas/version.rb new file mode 100644 index 000000000..7a95d2d05 --- /dev/null +++ b/gems/fizzy-saas/lib/fizzy/saas/version.rb @@ -0,0 +1,5 @@ +module Fizzy + module Saas + VERSION = "0.1.0" + end +end diff --git a/gems/fizzy-saas/lib/tasks/fizzy/saas_tasks.rake b/gems/fizzy-saas/lib/tasks/fizzy/saas_tasks.rake new file mode 100644 index 000000000..8fe948d94 --- /dev/null +++ b/gems/fizzy-saas/lib/tasks/fizzy/saas_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :fizzy_saas do +# # Task goes here +# end diff --git a/gems/fizzy-saas/test/controllers/.keep b/gems/fizzy-saas/test/controllers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/dummy/Rakefile b/gems/fizzy-saas/test/dummy/Rakefile new file mode 100644 index 000000000..9a5ea7383 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/gems/fizzy-saas/test/dummy/app/assets/images/.keep b/gems/fizzy-saas/test/dummy/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/dummy/app/assets/stylesheets/application.css b/gems/fizzy-saas/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 000000000..0ebd7fe82 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/gems/fizzy-saas/test/dummy/app/controllers/application_controller.rb b/gems/fizzy-saas/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 000000000..0d95db22b --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,4 @@ +class ApplicationController < ActionController::Base + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + allow_browser versions: :modern +end diff --git a/gems/fizzy-saas/test/dummy/app/controllers/concerns/.keep b/gems/fizzy-saas/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/dummy/app/helpers/application_helper.rb b/gems/fizzy-saas/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/gems/fizzy-saas/test/dummy/app/jobs/application_job.rb b/gems/fizzy-saas/test/dummy/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/gems/fizzy-saas/test/dummy/app/mailers/application_mailer.rb b/gems/fizzy-saas/test/dummy/app/mailers/application_mailer.rb new file mode 100644 index 000000000..3c34c8148 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/gems/fizzy-saas/test/dummy/app/models/application_record.rb b/gems/fizzy-saas/test/dummy/app/models/application_record.rb new file mode 100644 index 000000000..b63caeb8a --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/gems/fizzy-saas/test/dummy/app/models/concerns/.keep b/gems/fizzy-saas/test/dummy/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/dummy/app/views/layouts/application.html.erb b/gems/fizzy-saas/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 000000000..da908d39c --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,28 @@ + + + + <%= content_for(:title) || "Dummy" %> + + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= yield :head %> + + <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> + <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> + + + + + + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app %> + + + + <%= yield %> + + diff --git a/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.html.erb b/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.html.erb new file mode 100644 index 000000000..3aac9002e --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.text.erb b/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.text.erb new file mode 100644 index 000000000..37f0bddbd --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/gems/fizzy-saas/test/dummy/app/views/pwa/manifest.json.erb b/gems/fizzy-saas/test/dummy/app/views/pwa/manifest.json.erb new file mode 100644 index 000000000..a3c046e47 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/views/pwa/manifest.json.erb @@ -0,0 +1,22 @@ +{ + "name": "Dummy", + "icons": [ + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "Dummy.", + "theme_color": "red", + "background_color": "red" +} diff --git a/gems/fizzy-saas/test/dummy/app/views/pwa/service-worker.js b/gems/fizzy-saas/test/dummy/app/views/pwa/service-worker.js new file mode 100644 index 000000000..b3a13fb7b --- /dev/null +++ b/gems/fizzy-saas/test/dummy/app/views/pwa/service-worker.js @@ -0,0 +1,26 @@ +// Add a service worker for processing Web Push notifications: +// +// self.addEventListener("push", async (event) => { +// const { title, options } = await event.data.json() +// event.waitUntil(self.registration.showNotification(title, options)) +// }) +// +// self.addEventListener("notificationclick", function(event) { +// event.notification.close() +// event.waitUntil( +// clients.matchAll({ type: "window" }).then((clientList) => { +// for (let i = 0; i < clientList.length; i++) { +// let client = clientList[i] +// let clientPath = (new URL(client.url)).pathname +// +// if (clientPath == event.notification.data.path && "focus" in client) { +// return client.focus() +// } +// } +// +// if (clients.openWindow) { +// return clients.openWindow(event.notification.data.path) +// } +// }) +// ) +// }) diff --git a/gems/fizzy-saas/test/dummy/bin/bundler-audit b/gems/fizzy-saas/test/dummy/bin/bundler-audit new file mode 100755 index 000000000..e2ef22690 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/bundler-audit @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "bundler/audit/cli" + +ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check") +Bundler::Audit::CLI.start diff --git a/gems/fizzy-saas/test/dummy/bin/ci b/gems/fizzy-saas/test/dummy/bin/ci new file mode 100755 index 000000000..4137ad5bb --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/ci @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "active_support/continuous_integration" + +CI = ActiveSupport::ContinuousIntegration +require_relative "../config/ci.rb" diff --git a/gems/fizzy-saas/test/dummy/bin/dev b/gems/fizzy-saas/test/dummy/bin/dev new file mode 100755 index 000000000..5f91c2054 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/gems/fizzy-saas/test/dummy/bin/rails b/gems/fizzy-saas/test/dummy/bin/rails new file mode 100755 index 000000000..efc037749 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/gems/fizzy-saas/test/dummy/bin/rake b/gems/fizzy-saas/test/dummy/bin/rake new file mode 100755 index 000000000..4fbf10b96 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/gems/fizzy-saas/test/dummy/bin/setup b/gems/fizzy-saas/test/dummy/bin/setup new file mode 100755 index 000000000..81be011e8 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/bin/setup @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby +require "fileutils" + +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + system! "bin/rails db:reset" if ARGV.include?("--reset") + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end +end diff --git a/gems/fizzy-saas/test/dummy/config.ru b/gems/fizzy-saas/test/dummy/config.ru new file mode 100644 index 000000000..4a3c09a68 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/gems/fizzy-saas/test/dummy/config/application.rb b/gems/fizzy-saas/test/dummy/config/application.rb new file mode 100644 index 000000000..6e61f6bf7 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/application.rb @@ -0,0 +1,29 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Dummy + class Application < Rails::Application + config.load_defaults Rails::VERSION::STRING.to_f + + # For compatibility with applications that use this config + config.action_controller.include_all_helpers = false + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/gems/fizzy-saas/test/dummy/config/boot.rb b/gems/fizzy-saas/test/dummy/config/boot.rb new file mode 100644 index 000000000..116591a4e --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) + +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) +$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) diff --git a/gems/fizzy-saas/test/dummy/config/bundler-audit.yml b/gems/fizzy-saas/test/dummy/config/bundler-audit.yml new file mode 100644 index 000000000..e74b3af94 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/bundler-audit.yml @@ -0,0 +1,5 @@ +# Audit all gems listed in the Gemfile for known security problems by running bin/bundler-audit. +# CVEs that are not relevant to the application can be enumerated on the ignore list below. + +ignore: + - CVE-THAT-DOES-NOT-APPLY diff --git a/gems/fizzy-saas/test/dummy/config/cable.yml b/gems/fizzy-saas/test/dummy/config/cable.yml new file mode 100644 index 000000000..98367f895 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: dummy_production diff --git a/gems/fizzy-saas/test/dummy/config/ci.rb b/gems/fizzy-saas/test/dummy/config/ci.rb new file mode 100644 index 000000000..8eec396d5 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/ci.rb @@ -0,0 +1,19 @@ +# Run using bin/ci + +CI.run do + step "Setup", "bin/setup --skip-server" + + step "Security: Gem audit", "bin/bundler-audit" + + step "Tests: Rails", "bin/rails test" + step "Tests: System", "bin/rails test:system" + step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant" + + # Optional: set a green GitHub commit status to unblock PR merge. + # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`. + # if success? + # step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff" + # else + # failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again." + # end +end diff --git a/gems/fizzy-saas/test/dummy/config/database.yml b/gems/fizzy-saas/test/dummy/config/database.yml new file mode 100644 index 000000000..807964145 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/database.yml @@ -0,0 +1,32 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: storage/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: storage/test.sqlite3 + + +# SQLite3 write its data on the local filesystem, as such it requires +# persistent disks. If you are deploying to a managed service, you should +# make sure it provides disk persistence, as many don't. +# +# Similarly, if you deploy your application as a Docker container, you must +# ensure the database is located in a persisted volume. +production: + <<: *default + # database: path/to/persistent/storage/production.sqlite3 diff --git a/gems/fizzy-saas/test/dummy/config/environment.rb b/gems/fizzy-saas/test/dummy/config/environment.rb new file mode 100644 index 000000000..cac531577 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/gems/fizzy-saas/test/dummy/config/environments/development.rb b/gems/fizzy-saas/test/dummy/config/environments/development.rb new file mode 100644 index 000000000..db9ee276c --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/environments/development.rb @@ -0,0 +1,72 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Make code changes take effect immediately without server restart. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing. + config.server_timing = true + + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + else + config.action_controller.perform_caching = false + end + + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. + config.action_mailer.perform_caching = false + + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/gems/fizzy-saas/test/dummy/config/environments/production.rb b/gems/fizzy-saas/test/dummy/config/environments/production.rb new file mode 100644 index 000000000..90824bc48 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/environments/production.rb @@ -0,0 +1,89 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). + config.eager_load = true + + # Full error reports are disabled. + config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true + + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + + # Change to "debug" to log everything (including potentially personally-identifiable information!). + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. + # config.cache_store = :mem_cache_store + + # Replace the default in-process and non-durable queuing backend for Active Job. + # config.active_job.queue_adapter = :resque + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/gems/fizzy-saas/test/dummy/config/environments/test.rb b/gems/fizzy-saas/test/dummy/config/environments/test.rb new file mode 100644 index 000000000..c2095b117 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/environments/test.rb @@ -0,0 +1,53 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + + # Show full error reports. + config.consider_all_requests_local = true + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/gems/fizzy-saas/test/dummy/config/initializers/assets.rb b/gems/fizzy-saas/test/dummy/config/initializers/assets.rb new file mode 100644 index 000000000..487324424 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/initializers/assets.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path diff --git a/gems/fizzy-saas/test/dummy/config/initializers/content_security_policy.rb b/gems/fizzy-saas/test/dummy/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..d51d71397 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/initializers/content_security_policy.rb @@ -0,0 +1,29 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag` +# # if the corresponding directives are specified in `content_security_policy_nonce_directives`. +# # config.content_security_policy_nonce_auto = true +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/gems/fizzy-saas/test/dummy/config/initializers/filter_parameter_logging.rb b/gems/fizzy-saas/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..c0b717f7e --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc +] diff --git a/gems/fizzy-saas/test/dummy/config/initializers/inflections.rb b/gems/fizzy-saas/test/dummy/config/initializers/inflections.rb new file mode 100644 index 000000000..3860f659e --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/gems/fizzy-saas/test/dummy/config/locales/en.yml b/gems/fizzy-saas/test/dummy/config/locales/en.yml new file mode 100644 index 000000000..6c349ae5e --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/gems/fizzy-saas/test/dummy/config/puma.rb b/gems/fizzy-saas/test/dummy/config/puma.rb new file mode 100644 index 000000000..1c317b410 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/puma.rb @@ -0,0 +1,39 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. +# +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. +# +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. You can set it to `auto` to automatically start a worker +# for each available processor. +# +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/gems/fizzy-saas/test/dummy/config/routes.rb b/gems/fizzy-saas/test/dummy/config/routes.rb new file mode 100644 index 000000000..2f058eb62 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + mount Fizzy::Saas::Engine => "/fizzy-saas" +end diff --git a/gems/fizzy-saas/test/dummy/config/storage.yml b/gems/fizzy-saas/test/dummy/config/storage.yml new file mode 100644 index 000000000..927dc537c --- /dev/null +++ b/gems/fizzy-saas/test/dummy/config/storage.yml @@ -0,0 +1,27 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/gems/fizzy-saas/test/dummy/log/.keep b/gems/fizzy-saas/test/dummy/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/dummy/public/400.html b/gems/fizzy-saas/test/dummy/public/400.html new file mode 100644 index 000000000..f59c79ab8 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you're the application owner check the logs for more information.

+
+
+ + + + diff --git a/gems/fizzy-saas/test/dummy/public/404.html b/gems/fizzy-saas/test/dummy/public/404.html new file mode 100644 index 000000000..26d16027c --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/404.html @@ -0,0 +1,114 @@ + + + + + + + The page you were looking for doesn't exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.

+
+
+ + + + diff --git a/gems/fizzy-saas/test/dummy/public/406-unsupported-browser.html b/gems/fizzy-saas/test/dummy/public/406-unsupported-browser.html new file mode 100644 index 000000000..9532a9ccd --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/406-unsupported-browser.html @@ -0,0 +1,114 @@ + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + + diff --git a/gems/fizzy-saas/test/dummy/public/422.html b/gems/fizzy-saas/test/dummy/public/422.html new file mode 100644 index 000000000..ed5a5805d --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/422.html @@ -0,0 +1,114 @@ + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn't have access to. If you're the application owner check the logs for more information.

+
+
+ + + + diff --git a/gems/fizzy-saas/test/dummy/public/500.html b/gems/fizzy-saas/test/dummy/public/500.html new file mode 100644 index 000000000..318723853 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/500.html @@ -0,0 +1,114 @@ + + + + + + + We're sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We're sorry, but something went wrong.
If you're the application owner check the logs for more information.

+
+
+ + + + diff --git a/gems/fizzy-saas/test/dummy/public/icon.png b/gems/fizzy-saas/test/dummy/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c9dbfbbd2f7c1421ffd5727188146213abbcef GIT binary patch literal 4166 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 literal 0 HcmV?d00001 diff --git a/gems/fizzy-saas/test/dummy/public/icon.svg b/gems/fizzy-saas/test/dummy/public/icon.svg new file mode 100644 index 000000000..04b34bf83 --- /dev/null +++ b/gems/fizzy-saas/test/dummy/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/gems/fizzy-saas/test/fixtures/files/.keep b/gems/fizzy-saas/test/fixtures/files/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/fizzy/saas_test.rb b/gems/fizzy-saas/test/fizzy/saas_test.rb new file mode 100644 index 000000000..98bd4f019 --- /dev/null +++ b/gems/fizzy-saas/test/fizzy/saas_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class Fizzy::SaasTest < ActiveSupport::TestCase + test "it has a version number" do + assert Fizzy::Saas::VERSION + end +end diff --git a/gems/fizzy-saas/test/helpers/.keep b/gems/fizzy-saas/test/helpers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/integration/.keep b/gems/fizzy-saas/test/integration/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/integration/navigation_test.rb b/gems/fizzy-saas/test/integration/navigation_test.rb new file mode 100644 index 000000000..ebbc098ac --- /dev/null +++ b/gems/fizzy-saas/test/integration/navigation_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class NavigationTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/gems/fizzy-saas/test/mailers/.keep b/gems/fizzy-saas/test/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/models/.keep b/gems/fizzy-saas/test/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/gems/fizzy-saas/test/test_helper.rb b/gems/fizzy-saas/test/test_helper.rb new file mode 100644 index 000000000..cf669c893 --- /dev/null +++ b/gems/fizzy-saas/test/test_helper.rb @@ -0,0 +1,15 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require_relative "../test/dummy/config/environment" +ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ] +ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__) +require "rails/test_help" + +# Load fixtures from the engine +if ActiveSupport::TestCase.respond_to?(:fixture_paths=) + ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ] + ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths + ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files" + ActiveSupport::TestCase.fixtures :all +end