resolv icon indicating copy to clipboard operation
resolv copied to clipboard

Allow setting default Resolv::DNS config in Resolv.new

Open jeremyevans opened this issue 2 years ago • 3 comments

Instead of just passing the use_ipv6 option, pass all options given. By using a singular hash argument instead of keywords, this avoids the issue when a user does:

Resolv.new([Resolv::DNS.new], use_ipv6: false)

Which would have resulted in the use_ipv6 option being ignored.

This is backwards compatible, because there has not yet been a release with the use_ipv6 keyword supported.

Prompted by https://github.com/ruby/resolv/pull/14#issuecomment-1825944745

jeremyevans avatar Nov 25 '23 02:11 jeremyevans

My recommendation would be to warn for the :use_ipv6 option in Ruby 3.4, since it was just introduced in Ruby 3.3, and remove it in Ruby 3.5. Would you be OK with that?

jeremyevans avatar Feb 29 '24 21:02 jeremyevans

sounds good for me

sorah avatar Mar 05 '24 14:03 sorah

@sorah OK, I made that change.

jeremyevans avatar Mar 05 '24 17:03 jeremyevans

@sorah Do you think we can merge this so this change makes it into Ruby 3.4?

jeremyevans avatar Nov 09 '24 04:11 jeremyevans

@sorah @hsbt @mame I'd like this to make Ruby 3.4, since it missed Ruby 3.3. Is it possible for one of you to review and merge?

jeremyevans avatar Dec 07 '24 19:12 jeremyevans