Skip to content

Commit

Permalink
🔀 Merge pull request #305 from ruby/config/update-for-0.5
Browse files Browse the repository at this point in the history
🔧 Update config for v0.5
  • Loading branch information
nevans authored Jun 23, 2024
2 parents 37e50b3 + 687ceb5 commit f398d66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
21 changes: 12 additions & 9 deletions lib/net/imap/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,30 +306,33 @@ 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

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

Expand Down
6 changes: 3 additions & 3 deletions test/net/imap/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f398d66

Please sign in to comment.