ruby / resolv

A thread-aware DNS resolver library written in Ruby
Other
36 stars 28 forks source link

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

Open jeremyevans opened 7 months ago

jeremyevans commented 7 months ago

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 commented 4 months ago

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?

sorah commented 4 months ago

sounds good for me

jeremyevans commented 4 months ago

@sorah OK, I made that change.