lib/reversed.rb in reversed-0.4.2 vs lib/reversed.rb in reversed-0.5.0

- old
+ new

@@ -3,11 +3,11 @@ # stdlib require "ipaddr" # modules -require "reversed/version" +require_relative "reversed/version" module Reversed def self.lookup(ip, timeout: 5, nameservers: nil, fallback: true) ip = ip.to_s unless ip.empty? @@ -40,13 +40,5 @@ retry end end end end - -# not ideal, but fixes error on timeout with Ruby 3.1+ -# (which removed TimeoutError) -# need to define rather than rescue NameError -# to allow for multiple nameservers to be checked -# define here rather than for duration of search method for thread-safety -# apply to all Ruby versions to fix deprecation warnings -Net::DNS::Resolver::TimeoutError = Timeout::Error