diff --git a/.do/app.yaml b/.do/app.yaml
new file mode 100644
index 0000000..7c079be
--- /dev/null
+++ b/.do/app.yaml
@@ -0,0 +1,8 @@
+name: sample-rails
+services:
+- environment_slug: ruby-on-rails
+ github:
+ branch: main
+ deploy_on_push: true
+ repo: digitalocean/sample-rails
+ name: sample-rails
diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml
new file mode 100644
index 0000000..9eeda62
--- /dev/null
+++ b/.do/deploy.template.yaml
@@ -0,0 +1,8 @@
+spec:
+ name: sample-rails
+ services:
+ - environment_slug: ruby-on-rails
+ git:
+ branch: main
+ repo_clone_url: https://github.com/digitalocean/sample-rails.git
+ name: sample-rails
diff --git a/.dockerignore b/.dockerignore
deleted file mode 100644
index 9612375..0000000
--- a/.dockerignore
+++ /dev/null
@@ -1,37 +0,0 @@
-# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
-
-# Ignore git directory.
-/.git/
-
-# Ignore bundler config.
-/.bundle
-
-# Ignore all environment files (except templates).
-/.env*
-!/.env*.erb
-
-# Ignore all default key files.
-/config/master.key
-/config/credentials/*.key
-
-# Ignore all logfiles and tempfiles.
-/log/*
-/tmp/*
-!/log/.keep
-!/tmp/.keep
-
-# Ignore pidfiles, but keep the directory.
-/tmp/pids/*
-!/tmp/pids/.keep
-
-# Ignore storage (uploaded files in development and any SQLite databases).
-/storage/*
-!/storage/.keep
-/tmp/storage/*
-!/tmp/storage/.keep
-
-# Ignore assets.
-/node_modules/
-/app/assets/builds/*
-!/app/assets/builds/.keep
-/public/assets
diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml
new file mode 100644
index 0000000..6ce995d
--- /dev/null
+++ b/.github/dependabot.yaml
@@ -0,0 +1,65 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+# borrowed from https://github.com/dependabot/dependabot-core/blob/main/.github/dependabot.yml
+
+version: 2
+updates:
+ - package-ecosystem: "bundler"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ groups:
+ dev-dependencies:
+ dependency-type: "development"
+ update-types:
+ - "minor"
+ - "patch"
+ - package-ecosystem: "composer"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ groups:
+ dev-dependencies:
+ dependency-type: "development"
+ update-types:
+ - "minor"
+ - "patch"
+ - package-ecosystem: "docker"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "gomod"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "mix"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "npm"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ groups:
+ dev-dependencies:
+ dependency-type: "development"
+ update-types:
+ - "minor"
+ - "patch"
+ ignore:
+ - dependency-name: "npm"
+ update-types: ["version-update:semver-major"]
+ - package-ecosystem: "pip"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "pub"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.idea/testproject.iml b/.idea/testproject.iml
new file mode 100644
index 0000000..ae715dc
--- /dev/null
+++ b/.idea/testproject.iml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8459ad3..6292467 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,9 @@
-
+
+
+
@@ -21,20 +23,21 @@
- {
- "keyToString": {
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "git-widget-placeholder": "main",
- "last_opened_file_path": "/Users/nyazjaff/other/testproject",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "ruby.structure.view.model.defaults.configured": "true",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
diff --git a/.ruby-version b/.ruby-version
index a0891f5..a9cadc6 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-3.3.4
+ruby-3.2.0
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index ba704cf..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,62 +0,0 @@
-# syntax = docker/dockerfile:1
-
-# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
-ARG RUBY_VERSION=3.3.4
-FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
-
-# Rails app lives here
-WORKDIR /rails
-
-# Set production environment
-ENV RAILS_ENV="production" \
- BUNDLE_DEPLOYMENT="1" \
- BUNDLE_PATH="/usr/local/bundle" \
- BUNDLE_WITHOUT="development"
-
-
-# Throw-away build stage to reduce size of final image
-FROM base as build
-
-# Install packages needed to build gems
-RUN apt-get update -qq && \
- apt-get install --no-install-recommends -y build-essential git libvips pkg-config
-
-# Install application gems
-COPY Gemfile Gemfile.lock ./
-RUN bundle install && \
- rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
- bundle exec bootsnap precompile --gemfile
-
-# Copy application code
-COPY . .
-
-# Precompile bootsnap code for faster boot times
-RUN bundle exec bootsnap precompile app/ lib/
-
-# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
-RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
-
-
-# Final stage for app image
-FROM base
-
-# Install packages needed for deployment
-RUN apt-get update -qq && \
- apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \
- rm -rf /var/lib/apt/lists /var/cache/apt/archives
-
-# Copy built artifacts: gems, application
-COPY --from=build /usr/local/bundle /usr/local/bundle
-COPY --from=build /rails /rails
-
-# Run and own only the runtime files as a non-root user for security
-RUN useradd rails --create-home --shell /bin/bash && \
- chown -R rails:rails db log storage tmp
-USER rails:rails
-
-# Entrypoint prepares the database.
-ENTRYPOINT ["/rails/bin/docker-entrypoint"]
-
-# Start the server by default, this can be overwritten at runtime
-EXPOSE 3000
-CMD ["./bin/rails", "server"]
diff --git a/Gemfile b/Gemfile
index 00fe46b..637c8d2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,18 +1,19 @@
source "https://rubygems.org"
+git_source(:github) { |repo| "https://github.com/#{repo}.git" }
-ruby "3.3.4"
+ruby "3.2.0"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
-gem "rails", "~> 7.1.5", ">= 7.1.5.1"
+gem "rails", "~> 7.0.2", ">= 7.0.2.2"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# Use sqlite3 as the database for Active Record
-gem "sqlite3", ">= 1.4"
+gem "sqlite3", "~> 1.4"
# Use the Puma web server [https://github.com/puma/puma]
-gem "puma", ">= 5.0"
+gem "puma", "~> 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
@@ -27,7 +28,7 @@ gem "stimulus-rails"
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
-# gem "redis", ">= 4.0.1"
+# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
@@ -36,17 +37,20 @@ gem "jbuilder"
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
-gem "tzinfo-data", platforms: %i[ windows jruby ]
+gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
+# Use Sass to process CSS
+# gem "sassc-rails"
+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
- gem "debug", platforms: %i[ mri windows ]
+ gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
@@ -64,4 +68,5 @@ group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
+ gem "webdrivers"
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 530fd9a..a6a72f5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,128 +1,108 @@
GEM
remote: https://rubygems.org/
specs:
- actioncable (7.1.5.1)
- actionpack (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ actioncable (7.0.8)
+ actionpack (= 7.0.8)
+ activesupport (= 7.0.8)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- zeitwerk (~> 2.6)
- actionmailbox (7.1.5.1)
- actionpack (= 7.1.5.1)
- activejob (= 7.1.5.1)
- activerecord (= 7.1.5.1)
- activestorage (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ actionmailbox (7.0.8)
+ actionpack (= 7.0.8)
+ activejob (= 7.0.8)
+ activerecord (= 7.0.8)
+ activestorage (= 7.0.8)
+ activesupport (= 7.0.8)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
- actionmailer (7.1.5.1)
- actionpack (= 7.1.5.1)
- actionview (= 7.1.5.1)
- activejob (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ actionmailer (7.0.8)
+ actionpack (= 7.0.8)
+ actionview (= 7.0.8)
+ activejob (= 7.0.8)
+ activesupport (= 7.0.8)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
- rails-dom-testing (~> 2.2)
- actionpack (7.1.5.1)
- actionview (= 7.1.5.1)
- activesupport (= 7.1.5.1)
- nokogiri (>= 1.8.5)
- racc
- rack (>= 2.2.4)
- rack-session (>= 1.0.1)
+ rails-dom-testing (~> 2.0)
+ actionpack (7.0.8)
+ actionview (= 7.0.8)
+ activesupport (= 7.0.8)
+ rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
- rails-dom-testing (~> 2.2)
- rails-html-sanitizer (~> 1.6)
- actiontext (7.1.5.1)
- actionpack (= 7.1.5.1)
- activerecord (= 7.1.5.1)
- activestorage (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (7.0.8)
+ actionpack (= 7.0.8)
+ activerecord (= 7.0.8)
+ activestorage (= 7.0.8)
+ activesupport (= 7.0.8)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
- actionview (7.1.5.1)
- activesupport (= 7.1.5.1)
+ actionview (7.0.8)
+ activesupport (= 7.0.8)
builder (~> 3.1)
- erubi (~> 1.11)
- rails-dom-testing (~> 2.2)
- rails-html-sanitizer (~> 1.6)
- activejob (7.1.5.1)
- activesupport (= 7.1.5.1)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (7.0.8)
+ activesupport (= 7.0.8)
globalid (>= 0.3.6)
- activemodel (7.1.5.1)
- activesupport (= 7.1.5.1)
- activerecord (7.1.5.1)
- activemodel (= 7.1.5.1)
- activesupport (= 7.1.5.1)
- timeout (>= 0.4.0)
- activestorage (7.1.5.1)
- actionpack (= 7.1.5.1)
- activejob (= 7.1.5.1)
- activerecord (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ activemodel (7.0.8)
+ activesupport (= 7.0.8)
+ activerecord (7.0.8)
+ activemodel (= 7.0.8)
+ activesupport (= 7.0.8)
+ activestorage (7.0.8)
+ actionpack (= 7.0.8)
+ activejob (= 7.0.8)
+ activerecord (= 7.0.8)
+ activesupport (= 7.0.8)
marcel (~> 1.0)
- activesupport (7.1.5.1)
- base64
- benchmark (>= 0.3)
- bigdecimal
+ mini_mime (>= 1.1.0)
+ activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
- connection_pool (>= 2.2.5)
- drb
i18n (>= 1.6, < 2)
- logger (>= 1.4.2)
minitest (>= 5.1)
- mutex_m
- securerandom (>= 0.3)
tzinfo (~> 2.0)
- addressable (2.8.7)
- public_suffix (>= 2.0.2, < 7.0)
- base64 (0.2.0)
- benchmark (0.4.0)
- bigdecimal (3.1.9)
+ addressable (2.8.5)
+ public_suffix (>= 2.0.2, < 6.0)
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
- builder (3.3.0)
- capybara (3.40.0)
+ builder (3.2.4)
+ capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
- nokogiri (~> 1.11)
+ nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
- concurrent-ruby (1.3.5)
- connection_pool (2.5.0)
+ concurrent-ruby (1.2.2)
crass (1.0.6)
- date (3.4.1)
- debug (1.10.0)
- irb (~> 1.10)
- reline (>= 0.3.8)
- drb (2.2.1)
- erubi (1.13.1)
+ date (3.3.3)
+ debug (1.8.0)
+ irb (>= 1.5.0)
+ reline (>= 0.3.1)
+ erubi (1.12.0)
globalid (1.2.1)
activesupport (>= 6.1)
- i18n (1.14.7)
+ i18n (1.14.1)
concurrent-ruby (~> 1.0)
- importmap-rails (2.1.0)
+ importmap-rails (1.2.1)
actionpack (>= 6.0.0)
- activesupport (>= 6.0.0)
railties (>= 6.0.0)
- io-console (0.8.0)
- irb (1.15.1)
- pp (>= 0.6.0)
- rdoc (>= 4.0.0)
- reline (>= 0.4.2)
- jbuilder (2.13.0)
+ io-console (0.6.0)
+ irb (1.8.1)
+ rdoc
+ reline (>= 0.3.8)
+ jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
- logger (1.6.6)
- loofah (2.24.0)
+ loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
@@ -130,123 +110,93 @@ GEM
net-imap
net-pop
net-smtp
- marcel (1.0.4)
+ marcel (1.0.2)
matrix (0.4.2)
+ method_source (1.0.0)
mini_mime (1.1.5)
- minitest (5.25.5)
+ mini_portile2 (2.8.4)
+ minitest (5.20.0)
msgpack (1.8.0)
- mutex_m (0.3.0)
- net-imap (0.5.6)
+ net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
net-protocol
- net-protocol (0.2.2)
+ net-protocol (0.2.1)
timeout
- net-smtp (0.5.1)
+ net-smtp (0.3.3)
net-protocol
- nio4r (2.7.4)
- nokogiri (1.18.5-aarch64-linux-gnu)
- racc (~> 1.4)
- nokogiri (1.18.5-aarch64-linux-musl)
- racc (~> 1.4)
- nokogiri (1.18.5-arm-linux-gnu)
- racc (~> 1.4)
- nokogiri (1.18.5-arm-linux-musl)
- racc (~> 1.4)
- nokogiri (1.18.5-arm64-darwin)
+ nio4r (2.5.9)
+ nokogiri (1.15.4)
+ mini_portile2 (~> 2.8.2)
racc (~> 1.4)
- nokogiri (1.18.5-x86_64-darwin)
- racc (~> 1.4)
- nokogiri (1.18.5-x86_64-linux-gnu)
- racc (~> 1.4)
- nokogiri (1.18.5-x86_64-linux-musl)
- racc (~> 1.4)
- pp (0.6.2)
- prettyprint
- prettyprint (0.2.0)
- psych (5.2.3)
- date
+ psych (5.1.0)
stringio
- public_suffix (6.0.1)
- puma (6.6.0)
+ public_suffix (5.0.3)
+ puma (5.6.7)
nio4r (~> 2.0)
- racc (1.8.1)
- rack (3.1.12)
- rack-session (2.1.0)
- base64 (>= 0.1.0)
- rack (>= 3.0.0)
- rack-test (2.2.0)
+ racc (1.7.1)
+ rack (2.2.8)
+ rack-test (2.1.0)
rack (>= 1.3)
- rackup (2.2.1)
- rack (>= 3)
- rails (7.1.5.1)
- actioncable (= 7.1.5.1)
- actionmailbox (= 7.1.5.1)
- actionmailer (= 7.1.5.1)
- actionpack (= 7.1.5.1)
- actiontext (= 7.1.5.1)
- actionview (= 7.1.5.1)
- activejob (= 7.1.5.1)
- activemodel (= 7.1.5.1)
- activerecord (= 7.1.5.1)
- activestorage (= 7.1.5.1)
- activesupport (= 7.1.5.1)
+ rails (7.0.8)
+ actioncable (= 7.0.8)
+ actionmailbox (= 7.0.8)
+ actionmailer (= 7.0.8)
+ actionpack (= 7.0.8)
+ actiontext (= 7.0.8)
+ actionview (= 7.0.8)
+ activejob (= 7.0.8)
+ activemodel (= 7.0.8)
+ activerecord (= 7.0.8)
+ activestorage (= 7.0.8)
+ activesupport (= 7.0.8)
bundler (>= 1.15.0)
- railties (= 7.1.5.1)
+ railties (= 7.0.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
- rails-html-sanitizer (1.6.2)
+ rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
- railties (7.1.5.1)
- actionpack (= 7.1.5.1)
- activesupport (= 7.1.5.1)
- irb
- rackup (>= 1.0.0)
+ nokogiri (~> 1.14)
+ railties (7.0.8)
+ actionpack (= 7.0.8)
+ activesupport (= 7.0.8)
+ method_source
rake (>= 12.2)
- thor (~> 1.0, >= 1.2.2)
- zeitwerk (~> 2.6)
- rake (13.2.1)
- rdoc (6.12.0)
+ thor (~> 1.0)
+ zeitwerk (~> 2.5)
+ rake (13.0.6)
+ rdoc (6.5.0)
psych (>= 4.0.0)
- regexp_parser (2.10.0)
- reline (0.6.0)
+ regexp_parser (2.8.1)
+ reline (0.3.8)
io-console (~> 0.5)
- rexml (3.4.1)
- rubyzip (2.4.1)
- securerandom (0.4.1)
- selenium-webdriver (4.29.1)
- base64 (~> 0.2)
- logger (~> 1.4)
+ rexml (3.2.6)
+ rubyzip (2.3.2)
+ selenium-webdriver (4.10.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
- sprockets-rails (3.5.2)
- actionpack (>= 6.1)
- activesupport (>= 6.1)
+ sprockets-rails (3.4.2)
+ actionpack (>= 5.2)
+ activesupport (>= 5.2)
sprockets (>= 3.0.0)
- sqlite3 (2.6.0-aarch64-linux-gnu)
- sqlite3 (2.6.0-aarch64-linux-musl)
- sqlite3 (2.6.0-arm-linux-gnu)
- sqlite3 (2.6.0-arm-linux-musl)
- sqlite3 (2.6.0-arm64-darwin)
- sqlite3 (2.6.0-x86_64-darwin)
- sqlite3 (2.6.0-x86_64-linux-gnu)
- sqlite3 (2.6.0-x86_64-linux-musl)
- stimulus-rails (1.3.4)
+ sqlite3 (1.6.6)
+ mini_portile2 (~> 2.8.0)
+ stimulus-rails (1.2.2)
+ railties (>= 6.0.0)
+ stringio (3.0.8)
+ thor (1.2.2)
+ timeout (0.4.0)
+ turbo-rails (1.4.0)
+ actionpack (>= 6.0.0)
+ activejob (>= 6.0.0)
railties (>= 6.0.0)
- stringio (3.1.5)
- thor (1.3.2)
- timeout (0.4.3)
- turbo-rails (2.0.13)
- actionpack (>= 7.1.0)
- railties (>= 7.1.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
web-console (4.2.1)
@@ -254,26 +204,20 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
- websocket (1.2.11)
- websocket-driver (0.7.7)
- base64
+ webdrivers (5.3.1)
+ nokogiri (~> 1.6)
+ rubyzip (>= 1.3.0)
+ selenium-webdriver (~> 4.0, < 4.11)
+ websocket (1.2.9)
+ websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
- zeitwerk (2.7.2)
+ zeitwerk (2.6.11)
PLATFORMS
- aarch64-linux
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- arm64-darwin-23
- x86_64-darwin
- x86_64-linux
- x86_64-linux-gnu
- x86_64-linux-musl
+ ruby
DEPENDENCIES
bootsnap
@@ -281,18 +225,19 @@ DEPENDENCIES
debug
importmap-rails
jbuilder
- puma (>= 5.0)
- rails (~> 7.1.5, >= 7.1.5.1)
+ puma (~> 5.0)
+ rails (~> 7.0.2, >= 7.0.2.2)
selenium-webdriver
sprockets-rails
- sqlite3 (>= 1.4)
+ sqlite3 (~> 1.4)
stimulus-rails
turbo-rails
tzinfo-data
web-console
+ webdrivers
RUBY VERSION
- ruby 3.3.4p94
+ ruby 3.2.0p0
BUNDLED WITH
- 2.5.15
+ 2.4.19
diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js
index 1156bf8..54ad4ca 100644
--- a/app/javascript/controllers/index.js
+++ b/app/javascript/controllers/index.js
@@ -1,4 +1,11 @@
-// Import and register all your controllers from the importmap via controllers/**/*_controller
+// Import and register all your controllers from the importmap under controllers/*
+
import { application } from "controllers/application"
+
+// Eager load all controllers defined in the import map under controllers/**/*_controller
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)
+
+// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
+// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
+// lazyLoadControllersFrom("controllers", application)
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index ffd41bc..ec13eb7 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
- Testproject
+ SampleRails2
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb
index 3aac900..cbd34d2 100644
--- a/app/views/layouts/mailer.html.erb
+++ b/app/views/layouts/mailer.html.erb
@@ -1,7 +1,7 @@
-
+
diff --git a/bin/bundle b/bin/bundle
index 50da5fd..a71368e 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -27,7 +27,7 @@ m = Module.new do
bundler_version = nil
update_index = nil
ARGV.each_with_index do |a, i|
- if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
@@ -41,13 +41,13 @@ m = Module.new do
gemfile = ENV["BUNDLE_GEMFILE"]
return gemfile if gemfile && !gemfile.empty?
- File.expand_path("../Gemfile", __dir__)
+ File.expand_path("../../Gemfile", __FILE__)
end
def lockfile
lockfile =
case File.basename(gemfile)
- when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
else "#{gemfile}.lock"
end
File.expand_path(lockfile)
@@ -60,19 +60,24 @@ m = Module.new do
Regexp.last_match(1)
end
- def bundler_requirement
- @bundler_requirement ||=
- env_var_version ||
- cli_arg_version ||
- bundler_requirement_for(lockfile_version)
+ def bundler_version
+ @bundler_version ||=
+ env_var_version || cli_arg_version ||
+ lockfile_version
end
- def bundler_requirement_for(version)
- return "#{Gem::Requirement.default}.a" unless version
+ def bundler_requirement
+ return "#{Gem::Requirement.default}.a" unless bundler_version
+
+ bundler_gem_version = Gem::Version.new(bundler_version)
+
+ requirement = bundler_gem_version.approximate_recommendation
+
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
- bundler_gem_version = Gem::Version.new(version)
+ requirement += ".a" if bundler_gem_version.prerelease?
- bundler_gem_version.approximate_recommendation
+ requirement
end
def load_bundler!
diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint
deleted file mode 100755
index 67ef493..0000000
--- a/bin/docker-entrypoint
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash -e
-
-# If running the rails server then create or migrate existing database
-if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
- ./bin/rails db:prepare
-fi
-
-exec "${@}"
diff --git a/bin/setup b/bin/setup
index 3cd5a9d..ec47b79 100755
--- a/bin/setup
+++ b/bin/setup
@@ -5,7 +5,7 @@ require "fileutils"
APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
- system(*args, exception: true)
+ system(*args) || abort("\n== Command #{args} failed ==")
end
FileUtils.chdir APP_ROOT do
diff --git a/config/application.rb b/config/application.rb
index 5a5d923..e61228c 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -6,15 +6,10 @@
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
-module Testproject
+module SampleRails2
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 7.1
-
- # 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))
+ config.load_defaults 7.0
# Configuration for the application, engines, and railties goes here.
#
diff --git a/config/cable.yml b/config/cable.yml
index 92e7d13..4be0c43 100644
--- a/config/cable.yml
+++ b/config/cable.yml
@@ -7,4 +7,4 @@ test:
production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
- channel_prefix: testproject_production
+ channel_prefix: sample_rails_2_production
diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc
index c898276..d30279c 100644
--- a/config/credentials.yml.enc
+++ b/config/credentials.yml.enc
@@ -1 +1 @@
-TvIhDxxgwp7lK7sFlWIIovGpA1LbYH9fteoiPbceB8M2mFvJv4ftIKAyfCW020vgseB8m25csI756jS6w41QWCANHXZnfgiLFD7HOE4RhN8OZ7BrFhbYbepA/rk+sjJr3GwrBFtZn5nezE+qmjErNLL7gZIIm3LB7CNoWpKaoASWm4PCXxybS1faKI7waq0ECd8VXzIMzWGqMv7qcrv7zN0ka8N5SCM9yCelKPYXOIRyau/52Zao3mpKl0HgYK4OoCIZg4kfSAz4bOj5xgv6UHtx+mGZGuhI4CAQchcR29V6U8tBr02JfD5dPr4ITXm0Ttl6LJvO0dKCNplkufft1E1mTb8TpzcRRdGTrX/aO5PehZI9yMN0xCwsg2S+gRpQnSMIA0AMpseaHdVKJLRyHTLrM0/a--e1pUMajzjTD4wEVB--v4eZz0Glbs+HSEgHJMV/+w==
\ No newline at end of file
+Tp+kyTBrJ7MdsC5sK2+jIONfUjZbUH9Gk0xTlNc6/TrzQCShFL4IfPqn58X6dRMhuB22vLOtt5zYHpUc7nKtbq0IFf6CKleLCeFJTQFdNVwzJea2rTukjquVXFHCpdjdHmY3EtsVCLPyj/JxGH2kcowiMQFwt9NIfqFA101YSoxGah1SudvKxY6GuPyzbp9YAPETGIZ3dXuoAT0IcNy5+ReY0k2GAdZQjuI+2Xb6fal8SQHwOHb3PJZOZrLZ3ffUhIJr2mT1egfAbzVw7aSOjPetXHpDiGK8cOBXCXw57c+uMAY+lcqKsc65DlwDehBCPsLDKkxnQXG5ujuS4VmaAAfD60aDji2CgIFHqrJrKl/icPq7GBSdWKxlVfkQ6+X52rMJ+lOjNh/w4AgcxrjsjA3/p3e2SZ9lwc6T--0JMMgxj2iF6pwgEa--3twRLycbFrU60QnUzL+mKQ==
\ No newline at end of file
diff --git a/config/database.yml b/config/database.yml
index 796466b..fcba57f 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -11,15 +11,15 @@ default: &default
development:
<<: *default
- database: storage/development.sqlite3
+ database: db/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
+ database: db/test.sqlite3
production:
<<: *default
- database: storage/production.sqlite3
+ database: db/production.sqlite3
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 2e7fb48..8500f45 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -6,7 +6,7 @@
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
- config.enable_reloading = true
+ config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
@@ -56,9 +56,6 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = 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
@@ -70,7 +67,4 @@
# 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/config/environments/test.rb b/config/environments/test.rb
index adbb4a6..6ea4d1e 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -8,13 +8,12 @@
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
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
+ config.cache_classes = true
- # 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.
+ # Eager loading loads your whole application. When running a single test locally,
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
+ # system, or in some way before deploying your code.
config.eager_load = ENV["CI"].present?
# Configure public file server for tests with Cache-Control for performance.
@@ -24,12 +23,12 @@
}
# Show full error reports and disable caching.
- config.consider_all_requests_local = true
+ config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.cache_store = :null_store
- # Render exception templates for rescuable exceptions and raise for other exceptions.
- config.action_dispatch.show_exceptions = :rescuable
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
@@ -58,7 +57,4 @@
# 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/config/importmap.rb b/config/importmap.rb
index 909dfc5..8dce42d 100644
--- a/config/importmap.rb
+++ b/config/importmap.rb
@@ -1,7 +1,7 @@
# Pin npm packages by running ./bin/importmap
-pin "application"
-pin "@hotwired/turbo-rails", to: "turbo.min.js"
-pin "@hotwired/stimulus", to: "stimulus.min.js"
-pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
+pin "application", preload: true
+pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
+pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
+pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index b3076b3..3621f97 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -1,8 +1,8 @@
# 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
+# Define an application-wide content security policy
+# For further information see the following documentation
+# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# Rails.application.configure do
# config.content_security_policy do |policy|
@@ -16,10 +16,11 @@
# # policy.report_uri "/csp-violation-report-endpoint"
# end
#
-# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
+# # Generate session nonces for permitted importmap and inline scripts
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
-# config.content_security_policy_nonce_directives = %w(script-src style-src)
+# config.content_security_policy_nonce_directives = %w(script-src)
#
-# # Report violations without enforcing the policy.
+# # Report CSP violations to a specified URI. See:
+# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
# # config.content_security_policy_report_only = true
# end
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index c2d89e2..adc6568 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,8 +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.
+# Configure parameters to be 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, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
]
diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb
index 7db3b95..00f64d7 100644
--- a/config/initializers/permissions_policy.rb
+++ b/config/initializers/permissions_policy.rb
@@ -1,13 +1,11 @@
-# Be sure to restart your server when you modify this file.
-
# Define an application-wide HTTP permissions policy. For further
-# information see: https://developers.google.com/web/updates/2018/06/feature-policy
-
-# Rails.application.config.permissions_policy do |policy|
-# policy.camera :none
-# policy.gyroscope :none
-# policy.microphone :none
-# policy.usb :none
-# policy.fullscreen :self
-# policy.payment :self, "https://secure.example.com"
+# information see https://developers.google.com/web/updates/2018/06/feature-policy
+#
+# Rails.application.config.permissions_policy do |f|
+# f.camera :none
+# f.gyroscope :none
+# f.microphone :none
+# f.usb :none
+# f.fullscreen :self
+# f.payment :self, "https://secure.example.com"
# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6c349ae..8ca56fc 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,6 +1,6 @@
-# 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.
+# 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`:
#
@@ -16,16 +16,18 @@
#
# 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.
+# The following keys must be escaped otherwise they will not be retrieved by
+# the default I18n backend:
#
-# 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:
+# true, false, on, off, yes, no
#
-# en:
-# "yes": yup
-# enabled: "ON"
+# Instead, surround them with single quotes.
+#
+# en:
+# "true": "foo"
+#
+# To learn more, please read the Rails Internationalization guide
+# available at https://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
diff --git a/config/puma.rb b/config/puma.rb
index 7a709d7..daaf036 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,44 +1,43 @@
-# 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 can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
+#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
-rails_env = ENV.fetch("RAILS_ENV") { "development" }
-
-if rails_env == "production"
- # If you are running more than 1 thread per process, the workers count
- # should be equal to the number of processors (CPU cores) in production.
- #
- # It defaults to 1 because it's impossible to reliably detect how many
- # CPU cores are available. Make sure to set the `WEB_CONCURRENCY` environment
- # variable to match the number of processors.
- worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { 1 })
- if worker_count > 1
- workers worker_count
- else
- preload_app!
- end
-end
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
+#
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
+#
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
-environment rails_env
+#
+environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
+# Specifies the number of `workers` to boot in clustered mode.
+# Workers are forked web server processes. If using threads and workers together
+# the concurrency of the application would be max `threads` * `workers`.
+# Workers do not work on JRuby or Windows (both of which do not support
+# processes).
+#
+# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
+
+# Use the `preload_app!` method when specifying a `workers` number.
+# This directive tells Puma to first boot the application and load code
+# before forking the application. This takes advantage of Copy On Write
+# process behavior so workers use less memory.
+#
+# preload_app!
+
# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
diff --git a/config/routes.rb b/config/routes.rb
index a125ef0..4cd18cf 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,10 +1,7 @@
Rails.application.routes.draw do
- # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
-
- # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
- # Can be used by load balancers and uptime monitors to verify that the app is live.
- get "up" => "rails/health#show", as: :rails_health_check
-
- # Defines the root path route ("/")
- # root "posts#index"
-end
+ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
+ get '/rails/info/properties' , to: "rails/info#properties"
+ get '/rails/info/routes' , to: "rails/info#routes"
+ get '/rails/info' , to: "rails/info#index"
+ get '/' , to: "rails/welcome#index"
+end
\ No newline at end of file
diff --git a/db/seeds.rb b/db/seeds.rb
index 4fbd6ed..bc25fce 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,9 +1,7 @@
-# This file should ensure the existence of records required to run the application in every environment (production,
-# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
+# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
-# Example:
+# Examples:
#
-# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
-# MovieGenre.find_or_create_by!(name: genre_name)
-# end
+# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
+# Character.create(name: "Luke", movie: movies.first)
diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb
index 6340bf9..800405f 100644
--- a/test/channels/application_cable/connection_test.rb
+++ b/test/channels/application_cable/connection_test.rb
@@ -1,13 +1,11 @@
require "test_helper"
-module ApplicationCable
- class ConnectionTest < ActionCable::Connection::TestCase
- # test "connects with cookies" do
- # cookies.signed[:user_id] = 42
- #
- # connect
- #
- # assert_equal connection.user_id, "42"
- # end
- end
+class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
+ # test "connects with cookies" do
+ # cookies.signed[:user_id] = 42
+ #
+ # connect
+ #
+ # assert_equal connection.user_id, "42"
+ # end
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 0c22470..d713e37 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -2,14 +2,12 @@
require_relative "../config/environment"
require "rails/test_help"
-module ActiveSupport
- class TestCase
- # Run tests in parallel with specified workers
- parallelize(workers: :number_of_processors)
+class ActiveSupport::TestCase
+ # Run tests in parallel with specified workers
+ parallelize(workers: :number_of_processors)
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- fixtures :all
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
+ fixtures :all
- # Add more helper methods to be used by all tests here...
- end
+ # Add more helper methods to be used by all tests here...
end