From d4a8c546b384f15200a8b98cdc080315d8919df6 Mon Sep 17 00:00:00 2001 From: nick evans Date: Tue, 11 Jun 2024 23:02:08 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=8A=20Warn=20by=20default=20on=20d?= =?UTF-8?q?eprecated=20responses=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can still be silenced via the config option. --- lib/net/imap/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/imap/config.rb b/lib/net/imap/config.rb index 0bef58b2..7b3e6b84 100644 --- a/lib/net/imap/config.rb +++ b/lib/net/imap/config.rb @@ -306,7 +306,7 @@ def defaults_hash open_timeout: 30, idle_response_timeout: 5, sasl_ir: true, - responses_without_block: :silence_deprecation_warning, + responses_without_block: :warn, ).freeze @global = default.new From 687ceb530ebc56d32f2f8c70cf62a40f81568608 Mon Sep 17 00:00:00 2001 From: nick evans Date: Sat, 22 Jun 2024 22:07:25 -0400 Subject: [PATCH 2/2] Update default config for v0.5. --- lib/net/imap/config.rb | 19 +++++++++++-------- test/net/imap/test_config.rb | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/net/imap/config.rb b/lib/net/imap/config.rb index 7b3e6b84..174e8204 100644 --- a/lib/net/imap/config.rb +++ b/lib/net/imap/config.rb @@ -311,25 +311,28 @@ def defaults_hash @global = default.new - version_defaults[0.4] = Config[default.send(:defaults_hash)] + version_defaults[:default] = Config[default.send(:defaults_hash)] + version_defaults[:current] = Config[:default] - version_defaults[0] = Config[0.4].dup.update( + version_defaults[0] = Config[:current].dup.update( sasl_ir: false, + responses_without_block: :silence_deprecation_warning, ).freeze version_defaults[0.0] = Config[0] version_defaults[0.1] = Config[0] version_defaults[0.2] = Config[0] version_defaults[0.3] = Config[0] - version_defaults[0.5] = Config[0.4].dup.update( - responses_without_block: :warn, + version_defaults[0.4] = Config[0.3].dup.update( + sasl_ir: true, ).freeze - version_defaults[:default] = Config[0.4] - version_defaults[:current] = Config[0.4] - version_defaults[:next] = Config[0.5] + version_defaults[0.5] = Config[:current] + + version_defaults[0.6] = Config[0.5] + version_defaults[:next] = Config[0.6] - version_defaults[:future] = Config[0.5].dup.update( + version_defaults[:future] = Config[0.6].dup.update( responses_without_block: :raise, ).freeze diff --git a/test/net/imap/test_config.rb b/test/net/imap/test_config.rb index a8afb4fb..6c709735 100644 --- a/test/net/imap/test_config.rb +++ b/test/net/imap/test_config.rb @@ -169,9 +169,9 @@ class ConfigTest < Test::Unit::TestCase end test ".[] with symbol names" do - assert_same Config[0.4], Config[:current] - assert_same Config[0.4], Config[:default] - assert_same Config[0.5], Config[:next] + assert_same Config[0.5], Config[:current] + assert_same Config[0.5], Config[:default] + assert_same Config[0.6], Config[:next] assert_kind_of Config, Config[:future] end