=begin
TIG (c) 2015  

All rights reserved.
=end
module TIG
	module Mirror
		### tidy up
		data=File.join(DATA, "Data.txt")
		if File.exist?(data)
			begin
				File.delete(data)
			rescue
			end
		end
		###
		def self.loadRBS(path)
			return if path =~ /rbe$/ && Sketchup.version.to_i<=15
			pos=nil
			$".each_with_index{|p, i| (pos = i; break) if p == path || p =~ /(#{path})\.(rb|rbs|rbe)\z/i }
			$".delete_at(pos) if pos
			Sketchup::require(path)
		end
		Dir.entries(DATA).select{|e|
			File.extname(e).downcase =~ /\.(rb|rbs|rbe)\z/i
		}.each{|f|
			self.loadRBS(File.join(DATA, f))
		}
	end
end
