Module: What::Modules
- Defined in:
- lib/what/modules.rb
Defined Under Namespace
Class Method Summary collapse
-
.load_all ⇒ Object
load all modules defined in what/modules, in addition to any paths specified in the config file.
Class Method Details
.load_all ⇒ Object
load all modules defined in what/modules, in addition to any paths specified in the config file.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/what/modules.rb', line 4 def self.load_all require 'what/modules/base' globs = ['what/modules/*.rb'] if What::Config['module_paths'] What::Config['module_paths'].each do |module_path| globs << File.join(What::Config['base'], module_path, '*.rb') end end globs.each do |glob| Dir[glob].each do |fn| require fn end end end |