Module: What::Modules
- Defined in:
- lib/what/modules.rb
Defined Under Namespace
Classes: Base, Disk, Existence, Memory, Process, Unicorn, What
Class Method Summary collapse
- .config_module_full_paths ⇒ Object
-
.load_all ⇒ Object
Load all modules from any paths specified in the config file.
- .require_dir(path) ⇒ Object
Class Method Details
.config_module_full_paths ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/what/modules.rb', line 12 def self.config_module_full_paths paths = Config["module_paths"] || [] paths.map do |path| path.include?("/") ? path : File.join(Config["base"], path) end end |
.load_all ⇒ Object
Load all modules from any paths specified in the config file.
6 7 8 9 10 |
# File 'lib/what/modules.rb', line 6 def self.load_all config_module_full_paths.each do |path| require_dir(path) end end |
.require_dir(path) ⇒ Object
20 21 22 23 24 |
# File 'lib/what/modules.rb', line 20 def self.require_dir(path) Dir[File.join(path, '*.rb')].each do |fn| require fn end end |