lib/wmap/domain_tracker/sub_domain.rb in wmap-2.8.3 vs lib/wmap/domain_tracker/sub_domain.rb in wmap-2.8.4
- old
+ new
@@ -25,10 +25,10 @@
@data_dir=params.fetch(:data_dir, File.dirname(__FILE__)+'/../../../data/')
Dir.mkdir(@data_dir) unless Dir.exist?(@data_dir)
@max_parallel=params.fetch(:max_parallel, 40)
# Hash table to hold the trusted domains
@sub_domains_file=params.fetch(:sub_domains_file, @data_dir + 'sub_domains')
- File.write(@sub_domains_file, "") unless File.exist?(@sub_domains_file)
+ File.new(@sub_domains_file, "w") unless File.exist?(@sub_domains_file)
@known_internet_sub_domains=load_domains_from_file(@sub_domains_file) #unless @known_internet_sub_domains.size>0
end
# 'setter' to add sub-domain entry to the cache one at a time
def add(sub)