lib/wmap/domain_tracker.rb
# 'setter' to add domain entry to the cache one at a time
'setter' to add domain entry to the cache one at a time
' setter ' to add domain entry to the cache one at a time
def add(host)
		puts "Add entry to the local domains cache table: #{host}" if @verbose
		return nil if host.nil? or host.empty?
		host=host.strip.downcase
		if @known_internet_domains.key?(host)
			puts "Domain is already exist. Skipping: #{host}"
		else
			root=get_domain_root(host)
			sub=get_subdomain(host)
			record=Hash.new
			if host == root
				if zone_transferable?(root)
					record[root]=true
				else
					record[root]=false
				end
				puts "Entry loaded: #{record}"
				@known_internet_domains.merge!(record)
				return record
			elsif sub.nil?				
			elsif host != sub
				if zone_transferable?(sub)
					record[sub]=true
				else
					record[sub]=false
				end
				puts "Entry loaded: #{record}"
				@known_internet_domains.merge!(record)
				return record
			else
				puts "Problem add domain #{host}: unknown domain format - please use legal root domain or sub domain only."
			end
		end
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def add ( host ) puts "Add entry to the local domains cache table: #{host}" if @verbose return nil if host . nil? or host . empty? host = host . strip . downcase if @known_internet_domains . key? ( host ) puts "Domain is already exist. Skipping: #{host}" else root = get_domain_root ( host ) sub = get_subdomain ( host ) record = Hash . new if host == root if zone_transferable? ( root ) record [ root ] = true else record [ root ] = false end puts "Entry loaded: #{record}" @known_internet_domains . merge! ( record ) return record elsif sub . nil? elsif host != sub if zone_transferable? ( sub ) record [ sub ] = true else record [ sub ] = false end puts "Entry loaded: #{record}" @known_internet_domains . merge! ( record ) return record else puts "Problem add domain #{host}: unknown domain format - please use legal root domain or sub domain only." end end rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
'setter' to add domain entry to the cache one at a time
' setter ' to add domain entry to the cache one at a time
#@known_internet_domains[root]=true #@known_internet_domains[root]=false # 2/10/2014, additional logic to support sub-domains # do nothing #@known_internet_domains[sub]=true #@known_internet_domains[sub]=false
host
<not_specific>