Module: Vex
- Defined in:
- lib/vex/boot.rb
Defined Under Namespace
Modules: Etest
Constant Summary collapse
Class Method Summary collapse
-
.load_directory(directory) ⇒ Object
load all modules from a specific directory.
- .load_plugin(directory) ⇒ Object
- .version ⇒ Object
Class Method Details
.load_directory(directory) ⇒ Object
load all modules from a specific directory. This loads first all files in or under that directory, sorted alphabetically. Hint: use files __init__.rb for stuff that must be loaded first.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vex/boot.rb', line 15 def self.load_directory(directory) # load plugins first plugin_dir = "#{ROOT}/#{directory}/plugins" Dir.glob("#{plugin_dir}/*").each do |file| load_plugin file if File.directory?(file) end (Dir.glob("#{ROOT}/#{directory}/**/*.rb") - [__FILE__]).sort.each do |file| next if file[0, plugin_dir.length] == plugin_dir load file end end |