Skip to content

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jun 21, 2024


This is inspired by Rails::Application::Configuration#load_defaults in rails.

Config#load_defaults resets the current config to behave like the versioned default configuration for the requested version. (See #302.)

For example, #load_defaults can be used to globally behave more like a specific version of net-imap:

client = Net::IMAP.new(hostname)
client.config.sasl_ir              # => true
Net::IMAP.config.load_defaults 0.3
client.config.sasl_ir              # => false

@nevans nevans force-pushed the config-load_defaults branch 2 times, most recently from e2b341a to cad8200 Compare June 22, 2024 01:25
@nevans nevans linked an issue Jun 22, 2024 that may be closed by this pull request
@nevans nevans force-pushed the config-load_defaults branch 3 times, most recently from 200b51d to 6a4fd2c Compare June 22, 2024 14:55
This is inspired by Rails::Application::Configuration#load_defaults in
rails.

`#load_defaults` resets the current config to behave like the versioned
default configuration for that version.  `#parent` will not be changed.

Some config attributes default to inheriting from their `#parent` (which
is usually Config.global) and are left unchanged, for example: `#debug`.
@nevans nevans force-pushed the config-load_defaults branch from 6a4fd2c to d8ce1cb Compare June 22, 2024 15:10
@nevans nevans merged commit 958e872 into ruby:master Jun 22, 2024
@nevans nevans deleted the config-load_defaults branch June 22, 2024 16:06
@nevans nevans added the enhancement New feature or request label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Net::IMAP::Config class for global and client-scoped config

1 participant