Add a "module registry" API that allows Classes to register themselves into a parent Module. It must allow requiring a Class from within a sub-directory (ex: exploits/). The loaded Class would then register itself into the parent Module with a given name. The parent Module would then allow accessing these classes via arbitrary String name.
Pseudo Code
module Ronin
module Exploits
include Ronin::Core::Registry.new(dir: `exploits`)
end
class Exploit
def self.register(name)
Exploits.register(name,self)
end
end
end
class SomeExploit < Ronin::Exploits::Exploit
register 'some_exploit'
# ...
end
Add a "module registry" API that allows Classes to register themselves into a parent Module. It must allow requiring a Class from within a sub-directory (ex:
exploits/
). The loaded Class would then register itself into the parent Module with a given name. The parent Module would then allow accessing these classes via arbitrary String name.Pseudo Code
See Also
See Bundler::Audit::CLI::Formats for an example of the Module Registry pattern.