aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/mauve_resolv.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-09-16 12:47:52 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-09-16 12:47:52 +0100
commit38e4d877abee3c8e40edd932057e2bf16ad01e13 (patch)
treed2201a1c18fbebec4e0594b81c27974057e886b2 /lib/mauve/mauve_resolv.rb
parentf63d7076e52a8844f1cfe43e57330687d88e83b6 (diff)
Big documentation update.
Diffstat (limited to 'lib/mauve/mauve_resolv.rb')
-rw-r--r--lib/mauve/mauve_resolv.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/mauve/mauve_resolv.rb b/lib/mauve/mauve_resolv.rb
index 6c97bef..c6460e3 100644
--- a/lib/mauve/mauve_resolv.rb
+++ b/lib/mauve/mauve_resolv.rb
@@ -1,12 +1,19 @@
require 'resolv-replace'
-#
-#
-#
-
module Mauve
+ #
+ # This is just a quick class to resolve a hostname to all its IPs, IPv6 and IPv4.
+ #
class MauveResolv
+
class << self
+
+ # Get all IPs for a host, both IPv6 and IPv4. ResolvError and
+ # ResolvTimeout are both rescued.
+ #
+ # @param [String] host The hostname
+ # @return [Array] Array of IP addresses, as Strings.
+ #
def get_ips_for(host)
record_types = %w(A AAAA)
ips = []
@@ -25,6 +32,7 @@ module Mauve
ips
end
+ # @return [Log4r::Logger]
def logger
@logger ||= Log4r::Logger.new(self.to_s)
end