lib/wmap/domain_tracker/sub_domain.rb
# Save the current domain hash table into a file
Save the current domain hash table into a file
Save the current domain hash table into a file
def save_sub_domains_to_file!(file_domains=@file_sub_domains, domains=@known_internet_sub_domains)
		puts "Saving the current domains cache table from memory to file: #{file_domains} ..." if @verbose
		timestamp=Time.now
		f=File.open(file_domains, 'w')
		f.write "# Local domains file created by class #{self.class} method #{__method__} at: #{timestamp}\n"
		f.write "# domain name, free zone transfer detected?\n"
		domains.keys.sort.map do |key|
			if domains[key]
				f.write "#{key}, yes\n"
			else
				f.write "#{key}, no\n"
			end
		end
		f.close
		puts "Domain cache table is successfully saved: #{file_domains}"
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def save_sub_domains_to_file! ( file_domains = @file_sub_domains , domains = @known_internet_sub_domains ) puts "Saving the current domains cache table from memory to file: #{file_domains} ..." if @verbose timestamp = Time . now f = File . open ( file_domains , 'w' ) f . write "# Local domains file created by class #{self.class} method #{__method__} at: #{timestamp}\n" f . write "# domain name, free zone transfer detected?\n" domains . keys . sort . map do | key | if domains [ key ] f . write "#{key}, yes\n" else f . write "#{key}, no\n" end end f . close puts "Domain cache table is successfully saved: #{file_domains}" rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
Save the current domain hash table into a file
Save the current domain hash table into a file
file_domains
<not_specific>
domains
<not_specific>