From c41a9c29a28a95919b31597da6bd5c9b59ffedb4 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Jul 2021 11:10:39 +0100 Subject: [PATCH 1/3] Bump gettext to v3.3.x Fixes #6381 --- .github/dependabot.yml | 6 ------ Gemfile | 4 ++-- Gemfile.lock | 14 ++++++++++---- Gemfile.rails_next.lock | 14 ++++++++++---- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 67ebeef44d..94ea6c68a4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,9 +14,6 @@ updates: - dependency-name: capybara versions: - ">= 3.16.0" - - dependency-name: fast_gettext - versions: - - ">= 2.0.3" - dependency-name: icalendar versions: - ">= 2.6.0" @@ -77,9 +74,6 @@ updates: - dependency-name: capybara versions: - ">= 3.33.0" - - dependency-name: gettext - versions: - - ">= 3.3.0" - dependency-name: rolify versions: - ">= 6.0.0" diff --git a/Gemfile b/Gemfile index 42aebd7dcc..96165a2a39 100644 --- a/Gemfile +++ b/Gemfile @@ -139,8 +139,8 @@ gem 'gender_detector', '~> 2.0.0' gem 'i18n', '~> 1.8.10' gem 'rails-i18n', rails_upgrade? ? '~> 6.0.0' : '~> 5.1.0' gem 'gettext_i18n_rails', '~> 1.8.1' - gem 'fast_gettext', '< 2.0.3' -gem 'gettext', '< 3.3.0' + gem 'fast_gettext', '~> 2.0.3' +gem 'gettext', '~> 3.3.8' gem 'globalize', rails_upgrade? ? '~> 5.3.0' : '~> 5.2.0' gem 'locale', '~> 2.1.3' gem 'routing-filter', '~> 0.6.2' diff --git a/Gemfile.lock b/Gemfile.lock index 88dfe455a0..9a4676993b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,6 +126,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) + csv (3.2.0) daemons (1.4.0) dalli (2.7.11) dante (0.2.0) @@ -145,7 +146,7 @@ GEM railties (>= 4.2.0) fancybox-rails (0.3.1) railties (>= 3.1.0) - fast_gettext (2.0.2) + fast_gettext (2.0.3) ffi (1.15.0) fivemat (1.3.7) flipper (0.17.2) @@ -153,8 +154,9 @@ GEM activerecord (>= 4.2, < 7) flipper (~> 0.17.2) gender_detector (2.0.0) - gettext (3.2.9) + gettext (3.3.8) locale (>= 2.0.5) + red-datasets text (>= 1.3.0) gettext_i18n_rails (1.8.1) fast_gettext (>= 0.9.0) @@ -282,6 +284,10 @@ GEM ffi (~> 1.0) recaptcha (5.6.0) json + red-datasets (0.1.4) + csv (>= 3.0.5) + rexml + rubyzip regexp_parser (1.7.1) request_store (1.4.1) rack (>= 1.4) @@ -409,10 +415,10 @@ DEPENDENCIES exception_notification (~> 4.4.3) factory_bot_rails (~> 5.2.0) fancybox-rails (~> 0.3.0) - fast_gettext (< 2.0.3) + fast_gettext (~> 2.0.3) fivemat (~> 1.3.7) gender_detector (~> 2.0.0) - gettext (< 3.3.0) + gettext (~> 3.3.8) gettext_i18n_rails (~> 1.8.1) globalize (~> 5.2.0) gnuplot (~> 2.6.0) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index b002a6b3b5..22e9350fae 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -139,6 +139,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) + csv (3.2.0) daemons (1.4.0) dalli (2.7.11) dante (0.2.0) @@ -158,7 +159,7 @@ GEM railties (>= 4.2.0) fancybox-rails (0.3.1) railties (>= 3.1.0) - fast_gettext (2.0.2) + fast_gettext (2.0.3) ffi (1.15.0) fivemat (1.3.7) flipper (0.21.0) @@ -166,8 +167,9 @@ GEM activerecord (>= 5.0, < 7) flipper (~> 0.21.0) gender_detector (2.0.0) - gettext (3.2.9) + gettext (3.3.8) locale (>= 2.0.5) + red-datasets text (>= 1.3.0) gettext_i18n_rails (1.8.1) fast_gettext (>= 0.9.0) @@ -297,6 +299,10 @@ GEM ffi (~> 1.0) recaptcha (5.6.0) json + red-datasets (0.1.4) + csv (>= 3.0.5) + rexml + rubyzip regexp_parser (1.7.1) request_store (1.5.0) rack (>= 1.4) @@ -425,10 +431,10 @@ DEPENDENCIES exception_notification (~> 4.4.3) factory_bot_rails (~> 5.2.0) fancybox-rails (~> 0.3.0) - fast_gettext (< 2.0.3) + fast_gettext (~> 2.0.3) fivemat (~> 1.3.7) gender_detector (~> 2.0.0) - gettext (< 3.3.0) + gettext (~> 3.3.8) gettext_i18n_rails (~> 1.8.1) globalize (~> 5.3.0) gnuplot (~> 2.6.0) From 2f21fd72d334334353d3eb9b0afec0cb2ccd4b06 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Jul 2021 12:45:52 +0100 Subject: [PATCH 2/3] Fix Kernel deprecated for Ruby 2.7 Missed other occurrences of Kernel#open and requires for open-uri. See: https://github.com/mysociety/alaveteli/commit/d796a63 --- app/controllers/application_controller.rb | 2 -- app/controllers/general_controller.rb | 2 -- app/controllers/request_controller.rb | 1 - app/controllers/services_controller.rb | 2 -- lib/tasks/geoip.rake | 5 +---- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 90fb0c0a72..d5a997fe20 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,8 +6,6 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ -require 'open-uri' - class ApplicationController < ActionController::Base class PermissionDenied < StandardError end diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 91cd3fa56c..de5ffa1ebc 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -5,8 +5,6 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ -require 'open-uri' - class GeneralController < ApplicationController MAX_RESULTS = 500 diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 3efba7e304..2113113c0d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -5,7 +5,6 @@ # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ require 'zip' -require 'open-uri' class RequestController < ApplicationController before_action :check_read_only, only: [:new, :upload_response] diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 14b396b87b..ab1d18d7c3 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -1,7 +1,5 @@ # controllers/services_controller.rb: -require 'open-uri' - class ServicesController < ApplicationController def other_country_message diff --git a/lib/tasks/geoip.rake b/lib/tasks/geoip.rake index 60604b688d..08dd7fe688 100644 --- a/lib/tasks/geoip.rake +++ b/lib/tasks/geoip.rake @@ -1,6 +1,4 @@ namespace :geoip do - require 'open-uri' - def log(text) puts(text) unless Rake.application.options.silent end @@ -41,8 +39,7 @@ namespace :geoip do File.open(downloaded_location, "wb") do |saved_file| begin - # the following "open" is provided by open-uri - open(link, "rb") do |read_file| + URI.open(link, "rb") do |read_file| saved_file.write(read_file.read) end From ea4591459e3b3f45ffeab385e67c76675c5628b2 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Jul 2021 12:43:02 +0100 Subject: [PATCH 3/3] Bump Alaveteli to 0.39.1.1 --- config/initializers/alaveteli.rb | 2 +- doc/CHANGES.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 77dfa118df..2e9ac36156 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -10,7 +10,7 @@ load "util.rb" # Application version -ALAVETELI_VERSION = '0.39.1.0' +ALAVETELI_VERSION = '0.39.1.1' # Add new inflection rules using the following format # (all these examples are active by default): diff --git a/doc/CHANGES.md b/doc/CHANGES.md index e4b9a6458a..9db01cd09b 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,3 +1,10 @@ +# 0.39.1.1 + +## Highlighted Features + +* Remove deprecation warnings (Graeme Porteous) +* Dependencies upgrades (Graeme Porteous) + # 0.39.1.0 ## Highlighted Features