lib/wmap/host_tracker.rb
#	Refresh all the entries in the local hosts by querying the Internet
Refresh all the entries in the local hosts by querying the Internet
Refresh all the entries in the local hosts by querying the Internet
def refresh_all
		puts "Refresh all the entries in the local host repository in one shot."
		changes=Hash.new
		hosts=@known_hosts.keys
		@known_hosts=Hash.new
		changes=bulk_add(hosts)
		@known_hosts.merge!(changes)
		puts "\n#{changes.size} Entries Refreshed:" if changes.size>0
		puts "Done refreshing the local hosts."
		return changes
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}"
	end
def refresh_all puts "Refresh all the entries in the local host repository in one shot." changes = Hash . new hosts = @known_hosts . keys @known_hosts = Hash . new changes = bulk_add ( hosts ) @known_hosts . merge! ( changes ) puts "\n#{changes.size} Entries Refreshed:" if changes . size > 0 puts "Done refreshing the local hosts." return changes rescue => ee puts "Exception on method #{__method__}: #{ee}" end
Refresh all the entries in the local hosts by querying the Internet
Refresh all the entries in the local hosts by querying the Internet
#@known_hosts.keys.map do |key| #	unless is_ip?(key) #		host=refresh(key) #		changes.push(host) unless host.nil? #	end #end #changes.map { |x| puts x }