Feature #36205

Ruby 3.1 support

Added by Pavel Rosický 13 days ago. Updated 4 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Ruby support
Target version:5.0.0
Resolution:

Description

net/* libraries were gemified, see https://bugs.ruby-lang.org/issues/5481

diff --git a/Gemfile b/Gemfile
index 949fe86d2..624d40216 100644
--- a/Gemfile
+++ b/Gemfile
@@ -26,6 +26,12 @@ gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]
 gem 'rotp'
 gem 'rqrcode'

+unless Gem.ruby_version < Gem::Version.new('3.1.0')
+  gem 'net-smtp', '~> 0.3.0'
+  gem 'net-imap', '~> 0.2.2'
+  gem 'net-pop', '~> 0.1.1'
+end
+
 # Optional gem for LDAP authentication
 group :ldap do
   gem 'net-ldap', '~> 0.17.0'

36205-v2.patch Magnifier (1.75 KB) Go MAEDA, 2021-11-20 10:00


Related issues

Related to Redmine - Defect #36226: Psych 4: Psych::DisallowedClass exception when unseriali... Closed
Related to Redmine - Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias ex... Closed
Blocked by Redmine - Patch #35025: Update capybara to 3.36 Closed

Associated revisions

Revision 21296
Added by Go MAEDA 4 days ago

Ruby 3.1: net-smtp, net-imap, and net-pop are now bundled gems (#36205).

Contributed by Pavel Rosický.

History

#1 Updated by Go MAEDA 11 days ago

Pavel Rosický wrote:

net/* libraries were gemified, see https://bugs.ruby-lang.org/issues/5481

Thank you for submitting the patch. I added some additional changes as attached to pass tests.

#2 Updated by Go MAEDA 10 days ago

  • Target version set to 5.0.0

Setting the target version 5.0.0.

#3 Updated by Go MAEDA 8 days ago

#4 Updated by Go MAEDA 8 days ago

  • Related to Defect #36226: Psych 4: Psych::DisallowedClass exception when unserializing a setting value added

#5 Updated by Go MAEDA 8 days ago

  • Related to Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias exception added

#6 Updated by Go MAEDA 5 days ago

net-smtp, net-imap, and net-pop can be described in Gemfile even if the version of Ruby is older than 3.1.

I think using the same version of gems for all Ruby versions will make it easier to maintain Redmine.

Index: Gemfile
===================================================================
--- Gemfile    (revision 21293)
+++ Gemfile    (working copy)
@@ -18,6 +18,9 @@
 gem "rbpdf", "~> 1.20.0" 
 gem 'addressable'
 gem 'rubyzip', '~> 2.3.0'
+gem 'net-smtp', '~> 0.3.0'
+gem 'net-imap', '~> 0.2.2'
+gem 'net-pop', '~> 0.1.1'

 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
 gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]

#7 Updated by Pavel Rosický 5 days ago

It seems that Ruby 2.5 is the minimum supported version for these gems and their dependencies. So I think it's ok

#8 Updated by Go MAEDA 4 days ago

I have committed r21293, r21294, and r21296 and the trunk now passes all tests with Ruby 3.1.

I will commit the following patch after Rails officially supports Ruby 3.1.

diff --git a/Gemfile b/Gemfile
index 73ac9707d..b3f153d22 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
 source 'https://rubygems.org'

-ruby '>= 2.5.0', '< 3.1.0'
+ruby '>= 2.5.0', '< 3.2.0'
 gem 'bundler', '>= 1.12.0'

 gem 'rails', '6.1.4.1'
diff --git a/doc/INSTALL b/doc/INSTALL
index c0d823b3e..958e54118 100644
--- a/doc/INSTALL
+++ b/doc/INSTALL
@@ -7,7 +7,7 @@ http://www.redmine.org/

 == Requirements

-* Ruby 2.5, 2.6, 2.7, 3.0
+* Ruby 2.5, 2.6, 2.7, 3.0, 3.1
 * Bundler >= 1.12.0

 * A database:

Also available in: Atom PDF