Skip to content

Commit

Permalink
Remove legacy code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 23, 2024
1 parent 5e923c3 commit 4156465
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions lib/async/dns/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,9 @@ def self.default(**options)
# Servers are specified in the same manor as options[:listen], e.g.
# [:tcp/:udp, address, port]
# In the case of multiple servers, they will be checked in sequence.
def initialize(endpoint, timeout: nil, ndots: 1, search: nil, origin: nil, cache: Cache.new, **options)
def initialize(endpoint, ndots: 1, search: nil, origin: nil, cache: Cache.new, **options)
@endpoint = endpoint

# Legacy support for multiple endpoints:
if @endpoint.is_a?(Array)
warn "Using Array specifications for endpoint is deprecated. Please use IO::Endpoint::CompositeEndpoint instead.", uplevel: 1

endpoints = @endpoint.map do |specification|
::IO::Endpoint.public_send(specification[0], *specification[1..-1])
end

@endpoint = ::IO::Endpoint.composite(*endpoints)
end

if timeout
@endpoint = @endpoint.with(timeout: timeout)
end

@ndots = ndots
if search
@search = search
Expand All @@ -65,8 +50,6 @@ def initialize(endpoint, timeout: nil, ndots: 1, search: nil, origin: nil, cache

@cache = cache
@options = options

@count = 0
end

# The search domains, which are used to generate fully qualified names if required.
Expand Down

0 comments on commit 4156465

Please sign in to comment.