Sha256: d30dfa65639cf3414253b920e34b27296f57394d1dacfe4336ef5a63d366623b

Contents?: true

Size: 1.17 KB

Versions: 33

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env ruby
# Executable to add a new site into the tracking data repository
# This is useful as a self-correction mechanism to flag out unique website in a constant way
require "wmap"

def print_usage
	puts "Program to add an entry into the local data repository. Usage: wadd <site> [data_dir]"
end

puts Wmap.banner
print_usage
if ARGV.length == 1
	# Log the command entry
	Log_dir = File.dirname(__FILE__) + '/../logs/'
elsif ARGV.length == 2
	# Log to the instance running directory
	Log_dir = File.dirname(__FILE__) + '/../logs/' + ARGV[1]
else
	Log_dir = File.dirname(__FILE__) + '/../logs/'
end
Dir.mkdir(Log_dir) unless Dir.exist?(Log_dir)
Wmap.wlog("Execute the command: wadd #{ARGV[0]}","wadd",Log_dir+"wmap.log")

if ARGV.length == 1
	puts puts "Invoke the SiteTracker."
	st=Wmap::SiteTracker.instance
	st.verbose=false
elsif ARGV.length == 2
	puts puts "Invoke the SiteTracker."
	st=Wmap::SiteTracker.instance
	st.verbose=false
	st.data_dir=ARGV[1]
else
	aborts "Error firing up SiteTracker instance!"
end

# Evaluate the argument and update the data store accordingly
if st.is_site?(ARGV[0])
	st.add(ARGV[0])
	st.save!
	st=nil
else
	abort "Unknown argument format: #{ARGV[0]}"
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
wmap-2.8.6 bin/wadd
wmap-2.8.5 bin/wadd
wmap-2.8.4 bin/wadd
wmap-2.8.3 bin/wadd
wmap-2.8.2 bin/wadd
wmap-2.8.1 bin/wadd
wmap-2.7.9 bin/wadd
wmap-2.7.7 bin/wadd
wmap-2.7.6 bin/wadd
wmap-2.7.2 bin/wadd
wmap-2.7.1 bin/wadd
wmap-2.7.0 bin/wadd
wmap-2.6.9 bin/wadd
wmap-2.6.8 bin/wadd
wmap-2.6.7 bin/wadd
wmap-2.6.6 bin/wadd
wmap-2.6.5 bin/wadd
wmap-2.6.4 bin/wadd
wmap-2.6.3 bin/wadd
wmap-2.6.2 bin/wadd