aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/mauve_resolv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/mauve_resolv.rb')
-rw-r--r--lib/mauve/mauve_resolv.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mauve/mauve_resolv.rb b/lib/mauve/mauve_resolv.rb
index a9c7526..8ce8969 100644
--- a/lib/mauve/mauve_resolv.rb
+++ b/lib/mauve/mauve_resolv.rb
@@ -15,12 +15,10 @@ module Mauve
# @return [Array] Array of IP addresses, as Strings.
#
def get_ips_for(host)
- pp host
ips = []
- @count ||= 0
Resolv::DNS.open do |dns|
%w(A AAAA).each do |type|
- @count += 1
+ self.count += 1 if $debug
begin
ips += dns.getresources(host, Resolv::DNS::Resource::IN.const_get(type)).collect{|a| a.address.to_s}
rescue Resolv::ResolvError, Resolv::ResolvTimeout => e
@@ -35,6 +33,10 @@ module Mauve
@count ||= 0
end
+ def count=(c)
+ @count = c
+ end
+
# @return [Log4r::Logger]
def logger
@logger ||= Log4r::Logger.new(self.to_s)