class DNSCheck::Output
Public Class Methods
new()
click to toggle source
# File lib/dns-check/output.rb, line 6 def initialize; end
Public Instance Methods
insert(*msg) { || ... }
click to toggle source
# File lib/dns-check/output.rb, line 12 def insert(*msg) $stdout = StringIO.new yield unless $stdout.string.empty? STDOUT.print $stdout.string STDOUT.flush end ensure $stdout = STDOUT end
pretty_print(msg)
click to toggle source
# File lib/dns-check/output.rb, line 25 def pretty_print msg #FIXME redundant, catch nil instead of has_key if msg[3] && COUNTRY_CODES.has_key?(msg[3]) msg[0] = "/#{msg[0]}" if !msg[0].empty? #FIXME cheap workaround around frozen string msg[0] = msg[0].dup msg[0].prepend(msg[3].resolve_country_code) end print msg[0] + "#{DNSCheck.config[:sep]}" + msg[1] print "#{DNSCheck.config[:sep]}" + msg[2] if DNSCheck.config[:show_ns] print "\n" end
print_msg(msg)
click to toggle source
# File lib/dns-check/output.rb, line 8 def print_msg msg pretty_print msg end