From 8340b2f0b5ecf1cdfcd8c81dd3965dfa455a6d97 Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Sat, 17 Sep 2022 22:05:40 -0400 Subject: [PATCH 1/8] update to new public key --- app/views/layouts/_head.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 5bd29b94..a77b2ca1 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -6,7 +6,7 @@ %meta{:content => "RefugeRestrooms.org", :name => "author"}/ %meta{:content => "initial-scale=1, maximum-scale=1", :name => "viewport"}/ -%script{:src => "https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&key=AIzaSyBXcCrqzMlm-ZmtNQve7AuipNdE4vySUF0"} +%script{:src => "https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&key=AIzaSyCEjTsxAkHtqGhECdsqNwwpW5pslQcJuuE"} = javascript_include_tag "https://www.google.com/recaptcha/api.js", :async => true, :defer => true = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true = javascript_pack_tag "application", "data-turbolinks-track": "reload" From 520e8c5e95a825c37c54ab52d579d6e13f906a95 Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 21:48:09 -0400 Subject: [PATCH 2/8] upgrade to rails 6 --- .env | 8 +- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile | 9 +- Gemfile.lock | 468 +++++++++++++++++++++++---------------------- docker-compose.yml | 4 +- 6 files changed, 252 insertions(+), 241 deletions(-) diff --git a/.env b/.env index d852c2e4..88eb0f4c 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -export DEVISE_SECRET_KEY=3f4915489bd10fdbacb4f22dbf772a4be6e2d2d1616a1af7913f0f6645784ddffd6a71ab9f69a99ed7941f16d3092e1872bc4bc9add5a0615c630c90f94fc032 -export RAILS_SECRET_KEY=4944cf251e3dbf309ed71ebcd8990a1479d793011cd4011761e3fbea9ecc59edefd0cb49a0ed9b5c0261ab0dda841962bb7dd28fd3f99579bfa2beec26329961 -export RECAPTCHA_SITE_KEY=6Le_W5gUAAAAAJFOELNu2LkSR2E6sXYIVZrMe6V0 -export RECAPTCHA_SECRET_KEY=6Le_W5gUAAAAABZpnGQtfVaQdfluuLrf8wihooeo +DEVISE_SECRET_KEY=3f4915489bd10fdbacb4f22dbf772a4be6e2d2d1616a1af7913f0f6645784ddffd6a71ab9f69a99ed7941f16d3092e1872bc4bc9add5a0615c630c90f94fc032 +RAILS_SECRET_KEY=4944cf251e3dbf309ed71ebcd8990a1479d793011cd4011761e3fbea9ecc59edefd0cb49a0ed9b5c0261ab0dda841962bb7dd28fd3f99579bfa2beec26329961 +RECAPTCHA_SITE_KEY=6Le_W5gUAAAAAJFOELNu2LkSR2E6sXYIVZrMe6V0 +RECAPTCHA_SECRET_KEY=6Le_W5gUAAAAABZpnGQtfVaQdfluuLrf8wihooeo diff --git a/.ruby-version b/.ruby-version index 49cdd668..fd2a0186 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.6 +3.1.0 diff --git a/Dockerfile b/Dockerfile index 76f02820..5fff93c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7.6-slim +FROM ruby:3.1.0-slim # Add basic binaries RUN apt-get update \ diff --git a/Gemfile b/Gemfile index 1bd81fa5..3551291f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '2.7.6' +ruby '3.1.0' -gem 'rails', '5.2.8' +gem 'rails', '6.1.7' gem 'activeadmin', '~> 2.1' gem 'bootsnap', require: false @@ -9,7 +9,7 @@ gem 'bootstrap-sass', '>= 3.4.1' gem 'bugsnag' gem 'coffee-rails', '~> 4.2' gem 'country_select' -gem 'devise', '~> 4.6' +gem 'devise', '~> 4.8.1' gem 'geocoder', '~> 1.6.1' gem 'grape', '~> 1.3.0' gem 'grape-swagger' @@ -21,6 +21,7 @@ gem 'jbuilder', '~> 2.5' gem 'kaminari', '~> 1.1' gem 'kaminari-grape', '~> 1.0' gem 'mail_form', '>= 1.7.0' +gem 'net-smtp' gem 'pg' gem 'pg_search' gem 'puma' @@ -37,9 +38,7 @@ gem 'webpacker', '~> 5' group :development, :test do gem 'better_errors', '~> 2.9.1' gem 'binding_of_caller' - gem 'dotenv-rails', '~> 2.2.1' gem 'factory_bot_rails', '~> 4.8.2' - gem 'listen', '>= 3.0.5', '< 3.2' gem 'pry' gem 'rspec-rails' gem 'rubocop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 7f9758cb..4eee0bd8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,88 +1,105 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.8) - actionpack (= 5.2.8) + actioncable (6.1.7) + actionpack (= 6.1.7) + activesupport (= 6.1.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.8) - actionpack (= 5.2.8) - actionview (= 5.2.8) - activejob (= 5.2.8) + actionmailbox (6.1.7) + actionpack (= 6.1.7) + activejob (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + mail (>= 2.7.1) + actionmailer (6.1.7) + actionpack (= 6.1.7) + actionview (= 6.1.7) + activejob (= 6.1.7) + activesupport (= 6.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.8) - actionview (= 5.2.8) - activesupport (= 5.2.8) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.7) + actionview (= 6.1.7) + activesupport (= 6.1.7) + rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8) - activesupport (= 5.2.8) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7) + actionpack (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + nokogiri (>= 1.8.5) + actionview (6.1.7) + activesupport (= 6.1.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activeadmin (2.7.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activeadmin (2.13.1) arbre (~> 1.2, >= 1.2.1) - formtastic (~> 3.1) + formtastic (>= 3.1, < 5.0) formtastic_i18n (~> 0.4) inherited_resources (~> 1.7) jquery-rails (~> 4.2) - kaminari (~> 1.0, >= 1.0.1) - railties (>= 5.2, < 6.1) - ransack (~> 2.1, >= 2.1.1) - sassc-rails (~> 2.1) - sprockets (>= 3.0, < 4.1) - activejob (5.2.8) - activesupport (= 5.2.8) + kaminari (~> 1.0, >= 1.2.1) + railties (>= 6.1, < 7.1) + ransack (>= 2.1.1, < 4) + activejob (6.1.7) + activesupport (= 6.1.7) globalid (>= 0.3.6) - activemodel (5.2.8) - activesupport (= 5.2.8) - activerecord (5.2.8) - activemodel (= 5.2.8) - activesupport (= 5.2.8) - arel (>= 9.0) - activestorage (5.2.8) - actionpack (= 5.2.8) - activerecord (= 5.2.8) - marcel (~> 1.0.0) - activesupport (5.2.8) + activemodel (6.1.7) + activesupport (= 6.1.7) + activerecord (6.1.7) + activemodel (= 6.1.7) + activesupport (= 6.1.7) + activestorage (6.1.7) + actionpack (= 6.1.7) + activejob (= 6.1.7) + activerecord (= 6.1.7) + activesupport (= 6.1.7) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - arbre (1.2.1) - activesupport (>= 3.0.0) - arel (9.0.0) - ast (2.4.1) - autoprefixer-rails (9.7.5) - execjs - bcrypt (3.1.13) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + arbre (1.5.0) + activesupport (>= 3.0.0, < 7.1) + ruby2_keywords (>= 0.0.2, < 1.0) + ast (2.4.2) + autoprefixer-rails (10.4.7.0) + execjs (~> 2) + bcrypt (3.1.18) better_errors (2.9.1) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) - binding_of_caller (0.8.0) + binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.4.6) - msgpack (~> 1.0) + bootsnap (1.13.0) + msgpack (~> 1.2) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) - bugsnag (6.13.0) + bugsnag (6.24.2) concurrent-ruby (~> 1.0) builder (3.2.4) - capybara (3.32.0) + capybara (3.37.1) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) cliver (0.3.2) coderay (1.1.3) @@ -94,256 +111,252 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.10) - countries (3.0.1) - i18n_data (~> 0.10.0) + countries (5.1.2) sixarm_ruby_unaccent (~> 1.1) - unicode_utils (~> 1.4) - country_select (4.0.0) - countries (~> 3.0) - sort_alphabetical (~> 1.0) + country_select (8.0.0) + countries (~> 5.0) crack (0.4.5) rexml crass (1.0.6) - database_cleaner (1.8.3) - debug_inspector (0.0.3) - devise (4.7.1) + database_cleaner (2.0.1) + database_cleaner-active_record (~> 2.0.0) + database_cleaner-active_record (2.0.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + debug_inspector (1.1.0) + devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.3) - docile (1.3.2) - dotenv (2.2.2) - dotenv-rails (2.2.2) - dotenv (= 2.2.2) - railties (>= 3.2, < 6.0) - dry-configurable (0.11.5) + diff-lcs (1.5.0) + digest (3.1.0) + docile (1.4.0) + dry-container (0.11.0) concurrent-ruby (~> 1.0) - dry-core (~> 0.4, >= 0.4.7) - dry-equalizer (~> 0.2) - dry-container (0.7.2) + dry-core (0.8.1) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.4.9) + dry-inflector (0.3.0) + dry-logic (1.2.0) concurrent-ruby (~> 1.0) - dry-equalizer (0.3.0) - dry-inflector (0.2.0) - dry-logic (1.0.6) - concurrent-ruby (~> 1.0) - dry-core (~> 0.2) - dry-equalizer (~> 0.2) - dry-types (1.4.0) + dry-core (~> 0.5, >= 0.5) + dry-types (1.5.1) concurrent-ruby (~> 1.0) dry-container (~> 0.3) - dry-core (~> 0.4, >= 0.4.4) - dry-equalizer (~> 0.3) + dry-core (~> 0.5, >= 0.5) dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 1.0, >= 1.0.2) - erubi (1.10.0) - execjs (2.7.0) + erubi (1.11.0) + execjs (2.8.1) factory_bot (4.8.2) activesupport (>= 3.0.0) factory_bot_rails (4.8.2) factory_bot (~> 4.8.2) railties (>= 3.0.0) - ffi (1.12.2) - formtastic (3.1.5) - actionpack (>= 3.2.13) - formtastic_i18n (0.6.0) - geocoder (1.6.3) + ffi (1.15.5) + formtastic (4.0.0) + actionpack (>= 5.2.0) + formtastic_i18n (0.7.0) + geocoder (1.6.7) globalid (1.0.0) activesupport (>= 5.0) - grape (1.3.1) + grape (1.3.3) activesupport builder dry-types (>= 1.1) mustermann-grape (~> 1.0.0) rack (>= 1.3.0) rack-accept - grape-kaminari (0.1.9) - grape - kaminari - grape-swagger (1.0.0) - grape (~> 1.3.0) - haml (5.2.0) - temple (>= 0.8.0) + grape-kaminari (0.4.1) + grape (>= 1.0, != 1.4.0) + kaminari-grape + grape-swagger (1.5.0) + grape (~> 1.3) + haml (6.0.4) + temple (>= 0.8.2) + thor tilt - has_scope (0.7.2) - actionpack (>= 4.1) - activesupport (>= 4.1) + has_scope (0.8.0) + actionpack (>= 5.2) + activesupport (>= 5.2) hashdiff (1.0.1) high_voltage (3.0.0) http_accept_language (2.1.1) - i18n (1.10.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) i18n-debug (1.2.0) i18n (< 2) - i18n_data (0.10.0) - inherited_resources (1.11.0) - actionpack (>= 5.0, < 6.1) + inherited_resources (1.13.1) + actionpack (>= 5.2, < 7.1) has_scope (~> 0.6) - railties (>= 5.0, < 6.1) + railties (>= 5.2, < 7.1) responders (>= 2, < 4) - jbuilder (2.10.0) + io-wait (0.2.1) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) - jquery-rails (4.4.0) + jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.3.0) - kaminari (1.2.1) + json (2.6.2) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) kaminari-grape (1.0.1) grape kaminari-core (~> 1.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - loofah (2.18.0) + loofah (2.19.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - mail_form (1.8.0) - actionmailer (>= 5.0) - activemodel (>= 5.0) + mail_form (1.9.0) + actionmailer (>= 5.2) + activemodel (>= 5.2) marcel (1.0.2) + matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.15.0) - msgpack (1.3.3) - mustermann (1.1.1) + minitest (5.16.3) + msgpack (1.6.0) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - mustermann-grape (1.0.1) + mustermann-grape (1.0.2) mustermann (>= 1.0.0) + net-protocol (0.1.2) + io-wait + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout nio4r (2.5.8) - nokogiri (1.13.6) - mini_portile2 (~> 2.8.0) + nokogiri (1.13.8-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.13.8-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - parallel (1.19.2) - parser (2.7.2.0) + parallel (1.22.1) + parser (3.1.2.1) ast (~> 2.4.1) - pg (1.2.3) - pg_search (2.3.2) + pg (1.4.3) + pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) poltergeist (1.18.1) capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - polyamorous (2.3.2) - activerecord (>= 5.2.1) - pry (0.13.0) + pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) - puma (5.6.4) + psych (4.0.6) + stringio + public_suffix (5.0.0) + puma (5.6.5) nio4r (~> 2.0) racc (1.6.0) - rack (2.2.3.1) + rack (2.2.4) rack-accept (0.4.5) rack (>= 0.4) rack-cors (1.1.1) rack (>= 2.0.0) rack-jsonp (1.3.1) rack - rack-proxy (0.7.0) + rack-proxy (0.7.4) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.8) - actioncable (= 5.2.8) - actionmailer (= 5.2.8) - actionpack (= 5.2.8) - actionview (= 5.2.8) - activejob (= 5.2.8) - activemodel (= 5.2.8) - activerecord (= 5.2.8) - activestorage (= 5.2.8) - activesupport (= 5.2.8) - bundler (>= 1.3.0) - railties (= 5.2.8) + rack-test (2.0.2) + rack (>= 1.3) + rails (6.1.7) + actioncable (= 6.1.7) + actionmailbox (= 6.1.7) + actionmailer (= 6.1.7) + actionpack (= 6.1.7) + actiontext (= 6.1.7) + actionview (= 6.1.7) + activejob (= 6.1.7) + activemodel (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + bundler (>= 1.15.0) + railties (= 6.1.7) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) - railties (5.2.8) - actionpack (= 5.2.8) - activesupport (= 5.2.8) + railties (6.1.7) + actionpack (= 6.1.7) + activesupport (= 6.1.7) method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rainbow (3.0.0) + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) rake (13.0.6) rakismet (1.5.4) - ransack (2.3.2) - activerecord (>= 5.2.1) - activesupport (>= 5.2.1) + ransack (3.2.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) i18n - polyamorous (= 2.3.2) - rb-fsevent (0.10.3) - rb-inotify (0.10.1) - ffi (~> 1.0) - rdoc (6.3.1) - regexp_parser (1.7.0) - responders (3.0.0) + rdoc (6.4.0) + psych (>= 4.0.0) + regexp_parser (2.6.0) + responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) rexml (3.2.5) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.1) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-rails (4.0.0) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.9) - rspec-expectations (~> 3.9) - rspec-mocks (~> 3.9) - rspec-support (~> 3.9) - rspec-support (3.9.2) - rubocop (0.92.0) + rspec-support (~> 3.11.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.11.1) + rubocop (1.36.0) + json (~> 2.3) parallel (~> 1.10) - parser (>= 2.7.1.5) + parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) - rexml - rubocop-ast (>= 0.5.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.7.1) - parser (>= 2.7.1.5) - rubocop-rails (2.8.1) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.21.0) + parser (>= 3.1.1.0) + rubocop-rails (2.16.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.87.0) - rubocop-rspec (1.43.2) - rubocop (~> 0.87) - ruby-progressbar (1.10.1) - ruby2_keywords (0.0.2) - ruby_dep (1.5.0) - sassc (2.2.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-rspec (2.13.2) + rubocop (~> 1.33) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) @@ -351,20 +364,18 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sdoc (1.1.0) + sdoc (2.4.0) rdoc (>= 5.0) semantic_range (3.0.0) - simple_form (5.0.2) - actionpack (>= 5.0) - activemodel (>= 5.0) + simple_form (5.1.0) + actionpack (>= 5.2) + activemodel (>= 5.2) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) sixarm_ruby_unaccent (1.2.0) - sort_alphabetical (1.1.0) - unicode_utils (>= 1.2.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -372,26 +383,26 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) + stringio (3.0.2) temple (0.8.2) thor (1.2.1) - thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.0.11) + timeout (0.2.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (1.7.0) - unicode_utils (1.4.0) - warden (1.2.8) - rack (>= 2.0.6) - webmock (3.12.1) + unicode-display_width (2.3.0) + warden (1.2.9) + rack (>= 2.0.9) + webmock (3.12.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (5.4.0) + webpacker (5.4.3) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) @@ -401,9 +412,11 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.6.1) PLATFORMS - ruby + x86_64-darwin-21 + x86_64-linux DEPENDENCIES activeadmin (~> 2.1) @@ -416,8 +429,7 @@ DEPENDENCIES coffee-rails (~> 4.2) country_select database_cleaner - devise (~> 4.6) - dotenv-rails (~> 2.2.1) + devise (~> 4.8.1) factory_bot_rails (~> 4.8.2) geocoder (~> 1.6.1) grape (~> 1.3.0) @@ -430,8 +442,8 @@ DEPENDENCIES jbuilder (~> 2.5) kaminari (~> 1.1) kaminari-grape (~> 1.0) - listen (>= 3.0.5, < 3.2) mail_form (>= 1.7.0) + net-smtp pg pg_search poltergeist @@ -439,7 +451,7 @@ DEPENDENCIES puma rack-cors rack-jsonp - rails (= 5.2.8) + rails (= 6.1.7) rakismet rspec-rails rubocop @@ -457,7 +469,7 @@ DEPENDENCIES webpacker (~> 5) RUBY VERSION - ruby 2.7.6p219 + ruby 3.1.0p0 BUNDLED WITH - 2.1.4 + 2.3.3 diff --git a/docker-compose.yml b/docker-compose.yml index 447d2682..f952188e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,12 +6,12 @@ volumes: services: db: - image: postgres:alpine + image: postgres + restart: always environment: POSTGRES_PASSWORD: uaI7m2kmWd949DMv4dCh web: - platform: linux/amd64 environment: PGPASSWORD: uaI7m2kmWd949DMv4dCh build: . From 5cbbd9c8eda5cd03bbe2d2b1802db55257c1cee9 Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 21:55:46 -0400 Subject: [PATCH 3/8] add net gems to Gemfile --- Gemfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3551291f..38eb6b07 100644 --- a/Gemfile +++ b/Gemfile @@ -21,7 +21,9 @@ gem 'jbuilder', '~> 2.5' gem 'kaminari', '~> 1.1' gem 'kaminari-grape', '~> 1.0' gem 'mail_form', '>= 1.7.0' -gem 'net-smtp' +gem 'net-smtp', require: false +gem 'net-imap', require: false +gem 'net-pop', require: false gem 'pg' gem 'pg_search' gem 'puma' From bfd288f6931cfc3f3b33a19b3084274827c4c6a6 Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 21:59:30 -0400 Subject: [PATCH 4/8] update lock file --- Gemfile.lock | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 4eee0bd8..652db717 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -235,6 +235,10 @@ GEM ruby2_keywords (~> 0.0.1) mustermann-grape (1.0.2) mustermann (>= 1.0.0) + net-imap (0.3.1) + net-protocol + net-pop (0.1.2) + net-protocol net-protocol (0.1.2) io-wait timeout @@ -443,6 +447,8 @@ DEPENDENCIES kaminari (~> 1.1) kaminari-grape (~> 1.0) mail_form (>= 1.7.0) + net-imap + net-pop net-smtp pg pg_search From 147eabf42050c579a9f3677860b7150b30251ebc Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 22:28:02 -0400 Subject: [PATCH 5/8] fix linting errors with upgrade --- .rubocop.yml | 2 +- app/controllers/application_controller.rb | 4 ++-- app/controllers/restrooms_controller.rb | 4 ++-- app/helpers/recaptcha_helper.rb | 2 +- app/models/restroom.rb | 3 +-- spec/api/v1/restrooms_spec.rb | 22 +++++++++---------- spec/controllers/pages_controller_spec.rb | 8 +++---- spec/controllers/restrooms_controller_spec.rb | 5 +++-- spec/features/restrooms_spec.rb | 8 +++---- spec/services/save_restroom_spec.rb | 4 ++-- spec/spec_helper.rb | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9fa6b7d4..25ac65cf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -38,7 +38,7 @@ Style/StringLiterals: Enabled: false Metrics/BlockLength: - ExcludedMethods: + AllowedMethods: - describe - context - factory diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8135a7c..2d0759c0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,10 +10,10 @@ def mobile_filter_header @mobile = true end - def switch_locale(&action) + def switch_locale(&) locale = http_accept_language.language_region_compatible_from(I18n.available_locales) locale ||= I18n.default_locale - I18n.with_locale(locale, &action) + I18n.with_locale(locale, &) end end diff --git a/app/controllers/restrooms_controller.rb b/app/controllers/restrooms_controller.rb index 826918af..f134d917 100644 --- a/app/controllers/restrooms_controller.rb +++ b/app/controllers/restrooms_controller.rb @@ -59,7 +59,7 @@ def create redirect_to restroom_path(@restroom.edit_id) end elsif @restroom.errors.key?(:spam) - flash[:notice] = I18n.t('restroom.flash.spam') + flash.now[:notice] = I18n.t('restroom.flash.spam') render 'new' else display_errors @@ -79,7 +79,7 @@ def update elsif params[:restroom][:upvote] Restroom.increment_counter(:upvote, @restroom.id) # rubocop:disable Rails/SkipsModelValidations elsif @restroom.update(permitted_params) - flash[:notice] = I18n.t('restroom.flash.updated') + flash.now[:notice] = I18n.t('restroom.flash.updated') else display_errors render 'edit' diff --git a/app/helpers/recaptcha_helper.rb b/app/helpers/recaptcha_helper.rb index de995d60..bddf831c 100644 --- a/app/helpers/recaptcha_helper.rb +++ b/app/helpers/recaptcha_helper.rb @@ -15,7 +15,7 @@ def self.valid_token?(token) def self.verify(token) # Get secret from env - secret = ENV['RECAPTCHA_SECRET_KEY'] + secret = ENV.fetch('RECAPTCHA_SECRET_KEY', nil) uri = URI('https://www.google.com/recaptcha/api/siteverify') request = Net::HTTP::Post.new(uri) diff --git a/app/models/restroom.rb b/app/models/restroom.rb index 58a3dd6b..a1414de2 100644 --- a/app/models/restroom.rb +++ b/app/models/restroom.rb @@ -1,5 +1,4 @@ -# Note: -# In the dataset on which the application is based, UNISEX is coded by 0, ADA +# NOTE: In the dataset on which the application is based, UNISEX is coded by 0, ADA # (accessible) is coded by 1 class Restroom < ApplicationRecord diff --git a/spec/api/v1/restrooms_spec.rb b/spec/api/v1/restrooms_spec.rb index 98e305e2..23329a55 100644 --- a/spec/api/v1/restrooms_spec.rb +++ b/spec/api/v1/restrooms_spec.rb @@ -5,7 +5,7 @@ create_list(:restroom, 15) get '/api/v1/restrooms' - assert_response :success + expect(response).to have_http_status(:success) json = JSON.parse(response.body) previous_record = nil @@ -33,7 +33,7 @@ create_list(:restroom, 15) get '/api/v1/restrooms' - assert_response :success + expect(response).to have_http_status(:success) json = JSON.parse(response.body) expect(json.length).to eq(10) @@ -60,7 +60,7 @@ end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "returns unisex restro3ms" do @@ -78,7 +78,7 @@ end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "returns accessible restrooms" do @@ -121,7 +121,7 @@ create_list(:restroom, 15) get '/api/v1/restrooms/search', params: { query: 'San Francisco' } - assert_response :success + expect(response).to have_http_status(:success) json = JSON.parse(response.body) expect(json.length).to eq(10) @@ -148,7 +148,7 @@ end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "finds two coffeeshops with unisex restrooms" do @@ -170,7 +170,7 @@ end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "finds two coffeeshops with accessible restrooms" do @@ -195,11 +195,11 @@ month: Time.current.month, year: Time.current.year } - get "/api/v1/restrooms/by_date", params: params + get "/api/v1/restrooms/by_date", params: end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "finds all restrooms" do @@ -215,11 +215,11 @@ month: Time.current.month, year: Time.current.year } - get "/api/v1/restrooms/by_date", params: params + get "/api/v1/restrooms/by_date", params: end it "is successful" do - assert_response :success + expect(response).to have_http_status(:success) end it "finds all but one of the restrooms" do diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb index 433e8d95..4ddcd738 100644 --- a/spec/controllers/pages_controller_spec.rb +++ b/spec/controllers/pages_controller_spec.rb @@ -5,21 +5,21 @@ it "#index" do get :index - assert_response :success + expect(response).to have_http_status(:success) end it "#about" do get :show, params: { id: 'about' } - assert_response :success + expect(response).to have_http_status(:success) end it "#signs" do get :show, params: { id: 'signs' } - assert_response :success + expect(response).to have_http_status(:success) end it "#text" do get :show, params: { id: 'text' } - assert_response :success + expect(response).to have_http_status(:success) end end diff --git a/spec/controllers/restrooms_controller_spec.rb b/spec/controllers/restrooms_controller_spec.rb index f123d487..1ba2372b 100644 --- a/spec/controllers/restrooms_controller_spec.rb +++ b/spec/controllers/restrooms_controller_spec.rb @@ -5,11 +5,12 @@ it "#index" do get :index - assert_response :success + + expect(response).to have_http_status(:success) end describe "voting" do - let(:restroom) { FactoryBot.create(:restroom) } + let(:restroom) { create(:restroom) } it "can downvote" do post_params = { diff --git a/spec/features/restrooms_spec.rb b/spec/features/restrooms_spec.rb index 6298be5c..2077a35b 100644 --- a/spec/features/restrooms_spec.rb +++ b/spec/features/restrooms_spec.rb @@ -22,7 +22,7 @@ fill_in 'restroom[street]', with: 'Spamstreet' fill_in 'restroom[city]', with: 'Spamland' fill_in 'restroom[state]', with: 'Spamstate' - find('#restroom_country').find(:xpath, "option[contains(., 'Canada')][1]").select_option + find_by_id('restroom_country').find(:xpath, "option[contains(., 'Canada')][1]").select_option click_button 'Save Restroom' expect(page).to have_content("Your submission was rejected as spam.") @@ -77,7 +77,7 @@ find('.current-location-button').click # TODO: Figure out why this isn't working. # print page.html - page.has_css?(".mapToggle", visible: true) + expect(page).to have_css(".mapToggle", :visible) # find('.mapToggle').click # print page.html @@ -113,7 +113,7 @@ find(".guess-btn").click - page.has_css?(".nearby-container .listItem", visible: :visible) + expect(page).to have_css(".nearby-container .listItem", visible: :visible) end it "does not show nearby restrooms when they don't exist" do @@ -123,7 +123,7 @@ find(".guess-btn").click - page.has_css?(".nearby-container .none", visible: :visible) + expect(page).to have_css(".nearby-container .none", visible: :visible) end end diff --git a/spec/services/save_restroom_spec.rb b/spec/services/save_restroom_spec.rb index 933eaeb8..dcd96724 100644 --- a/spec/services/save_restroom_spec.rb +++ b/spec/services/save_restroom_spec.rb @@ -9,7 +9,7 @@ expect(Restroom.all.size).to eq(1) expect(actual_restroom.id).to eq(1) expect(actual_restroom.edit_id).to eq(1) - expect(actual_restroom.approved?).to eq(true) + expect(actual_restroom.approved?).to be(true) end it 'creates an error for spam' do @@ -30,6 +30,6 @@ expect(Restroom.all.size).to eq(1) expect(actual_restroom.edit_id).to eq(1) - expect(actual_restroom.approved?).to eq(false) + expect(actual_restroom.approved?).to be(false) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index aa96df63..094b3f3f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,7 +14,7 @@ # run twice. It is recommended that you do not name files matching this glob to # end with _spec.rb. You can configure this pattern with with the --pattern # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } # rubocop:disable Lint/NonDeterministicRequireOrder +Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } # Checks for pending migrations before tests are run. # If you are not using ActiveRecord, you can remove this line. From 3a83550c85057564be9448d623be067bef2f0019 Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 23:28:48 -0400 Subject: [PATCH 6/8] use proper "visible" syntax --- db/schema.rb | 10 +++++----- spec/features/restrooms_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index ff0a49f4..c60ea362 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,11 +2,11 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. diff --git a/spec/features/restrooms_spec.rb b/spec/features/restrooms_spec.rb index 2077a35b..2ccd1d55 100644 --- a/spec/features/restrooms_spec.rb +++ b/spec/features/restrooms_spec.rb @@ -77,7 +77,7 @@ find('.current-location-button').click # TODO: Figure out why this isn't working. # print page.html - expect(page).to have_css(".mapToggle", :visible) + expect(page).to have_css(".mapToggle", visible: :visible) # find('.mapToggle').click # print page.html From 29cb40582fb7c994ad394dc7413264d59e9b14bd Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Tue, 4 Oct 2022 23:51:01 -0400 Subject: [PATCH 7/8] update API gems --- Gemfile | 6 +++--- Gemfile.lock | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 38eb6b07..14d92b0c 100644 --- a/Gemfile +++ b/Gemfile @@ -11,14 +11,14 @@ gem 'coffee-rails', '~> 4.2' gem 'country_select' gem 'devise', '~> 4.8.1' gem 'geocoder', '~> 1.6.1' -gem 'grape', '~> 1.3.0' +gem 'grape', '~> 1.6.2' gem 'grape-swagger' -gem 'grape-kaminari' +gem 'grape-kaminari', '~> 0.4.3' gem 'haml' gem 'high_voltage', '~> 3.0.0' gem 'http_accept_language' gem 'jbuilder', '~> 2.5' -gem 'kaminari', '~> 1.1' +gem 'kaminari', '~> 1.2.2' gem 'kaminari-grape', '~> 1.0' gem 'mail_form', '>= 1.7.0' gem 'net-smtp', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 652db717..c596884e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,15 +162,15 @@ GEM geocoder (1.6.7) globalid (1.0.0) activesupport (>= 5.0) - grape (1.3.3) + grape (1.6.2) activesupport builder dry-types (>= 1.1) mustermann-grape (~> 1.0.0) rack (>= 1.3.0) rack-accept - grape-kaminari (0.4.1) - grape (>= 1.0, != 1.4.0) + grape-kaminari (0.4.3) + grape (>= 1.6.1) kaminari-grape grape-swagger (1.5.0) grape (~> 1.3) @@ -436,15 +436,15 @@ DEPENDENCIES devise (~> 4.8.1) factory_bot_rails (~> 4.8.2) geocoder (~> 1.6.1) - grape (~> 1.3.0) - grape-kaminari + grape (~> 1.6.2) + grape-kaminari (~> 0.4.3) grape-swagger haml high_voltage (~> 3.0.0) http_accept_language i18n-debug jbuilder (~> 2.5) - kaminari (~> 1.1) + kaminari (~> 1.2.2) kaminari-grape (~> 1.0) mail_form (>= 1.7.0) net-imap From 2ec766e3f84b928d936ba74f4dfcedb697eed70a Mon Sep 17 00:00:00 2001 From: Mikena Wood Date: Wed, 5 Oct 2022 00:35:23 -0400 Subject: [PATCH 8/8] change to old css rspec helper --- spec/features/restrooms_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/features/restrooms_spec.rb b/spec/features/restrooms_spec.rb index 2ccd1d55..b2a69ab5 100644 --- a/spec/features/restrooms_spec.rb +++ b/spec/features/restrooms_spec.rb @@ -69,6 +69,7 @@ expect(find('button.current-location-button')['aria-label']).to be_truthy end + # rubocop:disable RSpec/NoExpectationExample it 'displays a map' do create(:oakland_restroom) @@ -77,7 +78,7 @@ find('.current-location-button').click # TODO: Figure out why this isn't working. # print page.html - expect(page).to have_css(".mapToggle", visible: :visible) + page.has_css?(".mapToggle", visible: true) # find('.mapToggle').click # print page.html @@ -100,7 +101,7 @@ click_on "Preview" - expect(page).to have_css("div#mapArea", visible: :visible) + page.has_css?(".nearby-container .listItem", visible: :visible) end end @@ -113,7 +114,7 @@ find(".guess-btn").click - expect(page).to have_css(".nearby-container .listItem", visible: :visible) + page.has_css?(".nearby-container .listItem", visible: :visible) end it "does not show nearby restrooms when they don't exist" do @@ -123,9 +124,10 @@ find(".guess-btn").click - expect(page).to have_css(".nearby-container .none", visible: :visible) + page.has_css?(".nearby-container .none", visible: :visible) end end + # rubocop:enable RSpec/NoExpectationExample describe "edit" do it "creates an edit listing" do