From ff46b3de05992d74ca1818c370ba8648b72432e2 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 5 Jun 2020 20:31:04 +0200 Subject: [PATCH 1/4] Bump ruby version to 2.6.5 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 097a15a..57cf282 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.2 +2.6.5 From 6196900ba801d8bceffb0edff5710556e3511efd Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 5 Jun 2020 20:41:14 +0200 Subject: [PATCH 2/4] Bump dependencies to their latest version --- Gemfile | 10 +- Gemfile.lock | 263 ++++++++++++++++++++++++++++----------------------- 2 files changed, 152 insertions(+), 121 deletions(-) diff --git a/Gemfile b/Gemfile index 88893f0..53ceb89 100644 --- a/Gemfile +++ b/Gemfile @@ -3,14 +3,14 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.6.2' +ruby '2.6.5' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.2.1' +gem 'rails', '~> 6.0.3' # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server -gem 'puma', '~> 3.11' +gem 'puma', '~> 4.1' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # gem 'jbuilder', '~> 2.5' # Use ActiveModel has_secure_password @@ -23,7 +23,7 @@ gem 'puma', '~> 3.11' # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '>= 1.1.0', require: false +gem 'bootsnap', '>= 1.4.2', require: false # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible # gem 'rack-cors' @@ -56,7 +56,7 @@ group :development do gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'railroady' - gem 'rubocop', '0.72.0' + gem 'rubocop', '0.85.0' gem 'rubocop-performance' gem 'rubocop-rails' gem 'solargraph' diff --git a/Gemfile.lock b/Gemfile.lock index d4fd33b..2283d18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,112 +1,127 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.3) - actionpack (= 5.2.3) + actioncable (6.0.3.1) + actionpack (= 6.0.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) + actionmailbox (6.0.3.1) + actionpack (= 6.0.3.1) + activejob (= 6.0.3.1) + activerecord (= 6.0.3.1) + activestorage (= 6.0.3.1) + activesupport (= 6.0.3.1) + mail (>= 2.7.1) + actionmailer (6.0.3.1) + actionpack (= 6.0.3.1) + actionview (= 6.0.3.1) + activejob (= 6.0.3.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.3) - actionview (= 5.2.3) - activesupport (= 5.2.3) - rack (~> 2.0) + actionpack (6.0.3.1) + actionview (= 6.0.3.1) + activesupport (= 6.0.3.1) + rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.3) - activesupport (= 5.2.3) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.3.1) + actionpack (= 6.0.3.1) + activerecord (= 6.0.3.1) + activestorage (= 6.0.3.1) + activesupport (= 6.0.3.1) + nokogiri (>= 1.8.5) + actionview (6.0.3.1) + activesupport (= 6.0.3.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) + rails-html-sanitizer (~> 1.1, >= 1.2.0) active_model_serializers (0.10.10) actionpack (>= 4.1, < 6.1) activemodel (>= 4.1, < 6.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (5.2.3) - activesupport (= 5.2.3) + activejob (6.0.3.1) + activesupport (= 6.0.3.1) globalid (>= 0.3.6) - activemodel (5.2.3) - activesupport (= 5.2.3) - activerecord (5.2.3) - activemodel (= 5.2.3) - activesupport (= 5.2.3) - arel (>= 9.0) - activestorage (5.2.3) - actionpack (= 5.2.3) - activerecord (= 5.2.3) + activemodel (6.0.3.1) + activesupport (= 6.0.3.1) + activerecord (6.0.3.1) + activemodel (= 6.0.3.1) + activesupport (= 6.0.3.1) + activestorage (6.0.3.1) + actionpack (= 6.0.3.1) + activejob (= 6.0.3.1) + activerecord (= 6.0.3.1) marcel (~> 0.3.1) - activesupport (5.2.3) + activesupport (6.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - arel (9.0.0) + zeitwerk (~> 2.2, >= 2.2.2) ast (2.4.0) backport (1.1.2) bcrypt (3.1.13) - bootsnap (1.4.5) + benchmark (0.1.0) + bootsnap (1.4.6) msgpack (~> 1.0) - builder (3.2.3) - byebug (11.0.1) + builder (3.2.4) + byebug (11.1.3) case_transform (0.2) activesupport - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.6) coveralls (0.8.23) json (>= 1.8, < 3) simplecov (~> 0.16.1) term-ansicolor (~> 1.3) thor (>= 0.19.4, < 2.0) tins (~> 1.6) - crass (1.0.5) + crass (1.0.6) devise (4.7.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise_token_auth (1.1.3) + devise_token_auth (1.1.4) bcrypt (~> 3.0) devise (> 3.5.2, < 5) rails (>= 4.2.0, < 6.1) + sprockets (= 3.7.2) diff-lcs (1.3) docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) + e2mmap (0.1.0) erubi (1.9.0) - factory_bot (5.1.1) + factory_bot (5.2.0) activesupport (>= 4.2.0) - factory_bot_rails (5.1.1) - factory_bot (~> 5.1.0) + factory_bot_rails (5.2.0) + factory_bot (~> 5.2.0) railties (>= 4.2.0) - faker (2.7.0) - i18n (>= 1.6, < 1.8) - ffi (1.11.2) + faker (2.12.0) + i18n (>= 1.6, < 2) + ffi (1.13.0) globalid (0.4.2) activesupport (>= 4.2.0) - htmlentities (4.3.4) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.7.0) + i18n (1.8.3) concurrent-ruby (~> 1.0) - interactor (3.1.1) + interactor (3.1.2) interactor-rails (2.2.1) interactor (~> 3.0) rails (>= 4.2) jaro_winkler (1.5.4) - json (2.2.0) + json (2.3.0) jsonapi-renderer (0.2.2) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.3.1) + loofah (2.5.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -115,156 +130,172 @@ GEM rest-client (~> 2.0.2) marcel (0.3.3) mimemagic (~> 0.3.2) - method_source (0.9.2) - mime-types (3.3) + maruku (0.7.3) + method_source (1.0.0) + mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2019.1009) - mimemagic (0.3.3) + mime-types-data (3.2020.0512) + mimemagic (0.3.5) mini_mime (1.0.2) mini_portile2 (2.4.0) - minitest (5.13.0) - msgpack (1.3.1) + minitest (5.14.1) + msgpack (1.3.3) netrc (0.11.0) nio4r (2.5.2) - nokogiri (1.10.5) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) orm_adapter (0.5.0) - parallel (1.19.0) - parser (2.6.5.0) + parallel (1.19.1) + parser (2.7.1.3) ast (~> 2.4.0) - pg (1.1.4) - puma (3.12.1) - rack (2.0.7) - rack-cors (1.1.0) + pg (1.2.3) + puma (4.3.5) + nio4r (~> 2.0) + rack (2.2.2) + rack-cors (1.1.1) rack (>= 2.0.0) rack-test (1.1.0) rack (>= 1.0, < 3) railroady (1.5.3) - rails (5.2.3) - actioncable (= 5.2.3) - actionmailer (= 5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) - activemodel (= 5.2.3) - activerecord (= 5.2.3) - activestorage (= 5.2.3) - activesupport (= 5.2.3) + rails (6.0.3.1) + actioncable (= 6.0.3.1) + actionmailbox (= 6.0.3.1) + actionmailer (= 6.0.3.1) + actionpack (= 6.0.3.1) + actiontext (= 6.0.3.1) + actionview (= 6.0.3.1) + activejob (= 6.0.3.1) + activemodel (= 6.0.3.1) + activerecord (= 6.0.3.1) + activestorage (= 6.0.3.1) + activesupport (= 6.0.3.1) bundler (>= 1.3.0) - railties (= 5.2.3) + railties (= 6.0.3.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (5.2.3) - actionpack (= 5.2.3) - activesupport (= 5.2.3) + railties (6.0.3.1) + actionpack (= 6.0.3.1) + activesupport (= 6.0.3.1) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + thor (>= 0.20.3, < 2.0) rainbow (3.0.0) rake (13.0.1) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) ffi (~> 1.0) - responders (3.0.0) + regexp_parser (1.7.0) + responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) rest-client (2.0.2) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - reverse_markdown (1.3.0) + reverse_markdown (2.0.0) nokogiri - rspec-core (3.9.0) - rspec-support (~> 3.9.0) - rspec-expectations (3.9.0) + rexml (3.2.4) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) - rspec-mocks (3.9.0) + rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) - rspec-rails (3.9.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.0) - rubocop (0.72.0) - jaro_winkler (~> 1.5.1) + rspec-rails (4.0.1) + 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.3) + rubocop (0.85.0) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.0.3) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - rubocop-performance (1.5.1) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (0.0.3) + parser (>= 2.7.0.1) + rubocop-performance (1.6.1) rubocop (>= 0.71.0) - rubocop-rails (2.3.2) + rubocop-rails (2.5.2) + activesupport rack (>= 1.1) rubocop (>= 0.72.0) ruby-progressbar (1.10.1) ruby_dep (1.5.0) - shoulda-matchers (4.1.2) + shoulda-matchers (4.3.0) activesupport (>= 4.2.0) simplecov (0.16.1) docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - solargraph (0.37.2) + solargraph (0.39.8) backport (~> 1.1) + benchmark bundler (>= 1.17.2) - htmlentities (~> 4.3, >= 4.3.4) + e2mmap jaro_winkler (~> 1.5) + maruku (~> 0.7, >= 0.7.3) nokogiri (~> 1.9, >= 1.9.1) parser (~> 2.3) - reverse_markdown (~> 1.0, >= 1.0.5) + reverse_markdown (>= 1.0.5, < 3) rubocop (~> 0.52) - thor (~> 0.19, >= 0.19.4) + thor (~> 1.0) tilt (~> 2.0) - yard (~> 0.9) + yard (~> 0.9, >= 0.9.24) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.0.0) + sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.4.1) + sqlite3 (1.4.2) + sync (0.5.0) term-ansicolor (1.7.1) tins (~> 1.0) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) - tins (1.22.2) - tzinfo (1.2.5) + tins (1.25.0) + sync + tzinfo (1.2.7) thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.6) - unicode-display_width (1.6.0) + unf_ext (0.0.7.7) + unicode-display_width (1.7.0) warden (1.2.8) rack (>= 2.0.6) - websocket-driver (0.7.1) + websocket-driver (0.7.2) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) - yard (0.9.20) + websocket-extensions (0.1.5) + yard (0.9.25) + zeitwerk (2.3.0) PLATFORMS ruby DEPENDENCIES active_model_serializers - bootsnap (>= 1.1.0) + bootsnap (>= 1.4.2) byebug coveralls devise @@ -276,12 +307,12 @@ DEPENDENCIES listen (>= 3.0.5, < 3.2) mailgun-ruby pg - puma (~> 3.11) + puma (~> 4.1) rack-cors railroady - rails (~> 5.2.1) + rails (~> 6.0.3) rspec-rails - rubocop (= 0.72.0) + rubocop (= 0.85.0) rubocop-performance rubocop-rails shoulda-matchers @@ -292,7 +323,7 @@ DEPENDENCIES tzinfo-data RUBY VERSION - ruby 2.6.2p47 + ruby 2.6.5p114 BUNDLED WITH 1.17.2 From bb4a950138768c65f458132800c43ba5041ef3bf Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 5 Jun 2020 20:41:33 +0200 Subject: [PATCH 3/4] Fix warning about content/media type for Rails 6 --- spec/controllers/matches_controller_spec.rb | 2 +- spec/controllers/tournaments_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb index d36e9ba..ec9c725 100644 --- a/spec/controllers/matches_controller_spec.rb +++ b/spec/controllers/matches_controller_spec.rb @@ -49,7 +49,7 @@ RSpec.describe MatchesController, type: :controller do it 'should return success' do get :show, params: { id: @match.to_param } expect(response).to be_successful - expect(response.content_type).to eq('application/json') + expect(response.media_type).to eq('application/json') end it 'should return the correct state' do diff --git a/spec/controllers/tournaments_controller_spec.rb b/spec/controllers/tournaments_controller_spec.rb index fade45b..2e9307c 100644 --- a/spec/controllers/tournaments_controller_spec.rb +++ b/spec/controllers/tournaments_controller_spec.rb @@ -248,7 +248,7 @@ RSpec.describe TournamentsController, type: :controller do it 'renders a JSON response with the new tournament' do post :create, params: create_playoff_tournament_data expect(response).to have_http_status(:created) - expect(response.content_type).to eq('application/json') + expect(response.media_type).to eq('application/json') expect(response.location).to eq(tournament_url(Tournament.last)) end end @@ -329,7 +329,7 @@ RSpec.describe TournamentsController, type: :controller do it 'renders a JSON response with the tournament' do put :update, params: { id: @tournament.to_param }.merge(valid_update) expect(response).to have_http_status(:ok) - expect(response.content_type).to eq('application/json') + expect(response.media_type).to eq('application/json') end context 'any variable relevant for group stage to playoff transition changed' do From 4e0e099771abf2e33c9a84069a74a3806ce0368a Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 5 Jun 2020 21:04:10 +0200 Subject: [PATCH 4/4] Use ruby 2.6.5 in production Dockerfile --- docker/production/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 4305b36..8f79622 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6.2-alpine +FROM ruby:2.6.5-alpine RUN apk add --no-cache build-base tzdata sqlite sqlite-dev postgresql-dev && gem install tzinfo-data WORKDIR /app COPY Gemfile* /app/