lib/msf/core/module_manager.rb
#
# Adds a path to be searched for new modules.
#
Adds a path to be searched for new modules.
Adds a path to be searched for new modules .
def add_module_path(path)
		npaths = []
		if path =~ /\.fastlib$/
			unless ::File.exist?(path)
				raise RuntimeError, "The path supplied does not exist", caller
			end
			npaths << ::File.expand_path(path)
		else
			path.sub!(/#{File::SEPARATOR}$/, '')
			path = Pathname.new(File.expand_path(path))
			unless path.directory?
				raise RuntimeError, "The path supplied is not a valid directory.", caller
			end
			path    = ::File.expand_path(path)
			npaths << path
			Dir["#{path}/**/*.fastlib"].each do |fp|
				npaths << fp
			end
		end
		self.module_paths = (module_paths + npaths).flatten.uniq
		counts = nil
		npaths.each { |d|
			counts = load_modules(d, false)
		}
		return counts
	end
def add_module_path ( path ) npaths = [ ] if path =~ / \. fastlib$ / unless :: File . exist? ( path ) raise RuntimeError , "The path supplied does not exist" , caller end npaths << :: File . expand_path ( path ) else path . sub! ( / #{ File :: SEPARATOR } $ / , '' ) path = Pathname . new ( File . expand_path ( path ) ) unless path . directory? raise RuntimeError , "The path supplied is not a valid directory." , caller end path = :: File . expand_path ( path ) npaths << path Dir [ "#{path}/**/*.fastlib" ] . each do | fp | npaths << fp end end self . module_paths = ( module_paths + npaths ) . flatten . uniq counts = nil npaths . each { | d | counts = load_modules ( d , false ) } return counts end
Adds a path to be searched for new modules.
Adds a path to be searched for new modules .
# Make the path completely canonical # Make sure the path is a valid directory # Now that we've confirmed it exists, get the full, cononical path # Identify any fastlib archives inside of this path # Update the module paths appropriately # Load all of the modules from the new paths
path
<not_specific>