lib/wmap/site_tracker/wp_tracker.rb
# Save the current hash table into a file
Save the current hash table into a file
Save the current hash table into a file
def save_to_file!(file_wps=@sites_wp, wps=@known_wp_sites)
		puts "Saving the current wordpress site table from memory to file: #{file_wps} ..." if @verbose
		timestamp=Time.now
		f=File.open(file_wps, 'w')
		f.write "# Local wps file created by class #{self.class} method #{__method__} at: #{timestamp}\n"
		f.write "# WP Site URL, WP Version, Redirection \n"
		(wps.keys - [nil,'']).sort.map do |key|
			f.write "#{key}, #{wps[key]['version']}, #{wps[key]['redirection']}\n"
		end
		f.close
		puts "WordPress site cache table is successfully saved: #{file_wps}"
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def save_to_file! ( file_wps = @sites_wp , wps = @known_wp_sites ) puts "Saving the current wordpress site table from memory to file: #{file_wps} ..." if @verbose timestamp = Time . now f = File . open ( file_wps , 'w' ) f . write "# Local wps file created by class #{self.class} method #{__method__} at: #{timestamp}\n" f . write "# WP Site URL, WP Version, Redirection \n" ( wps . keys - [ nil , '' ] ) . sort . map do | key | f . write "#{key}, #{wps[key]['version']}, #{wps[key]['redirection']}\n" end f . close puts "WordPress site cache table is successfully saved: #{file_wps}" rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
Save the current hash table into a file
Save the current hash table into a file
file_wps
<not_specific>
wps
<not_specific>