summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins.rb
diff options
context:
space:
mode:
authorRaine Virta <rane@kapsi.fi>2009-02-26 19:30:06 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-02-28 01:43:45 +0100
commit978ea255291ea27fef7d5d685a49eb0d52d4e9c9 (patch)
tree5d2010c60e8374be441f64c439af9850e47e5c56 /lib/rbot/plugins.rb
parent8db7c8ac71ecec319683b7ffc1980d6e22b692e9 (diff)
Separate @dirs containing all botmodules (plugins and core modules)
into @core_module_dirs and @plugin_dirs
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r--lib/rbot/plugins.rb28
1 files changed, 17 insertions, 11 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index e099e18e..5c5cdddc 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -424,7 +424,8 @@ module Plugins
h[k] = Array.new
}
- @dirs = []
+ @core_module_dirs = []
+ @plugin_dirs = []
@failed = Array.new
@ignored = Array.new
@@ -580,18 +581,23 @@ module Plugins
private :load_botmodule_file
# add one or more directories to the list of directories to
- # load botmodules from
- #
- # TODO find a way to specify necessary plugins which _must_ be loaded
- #
- def add_botmodule_dir(*dirlist)
- @dirs += dirlist
- debug "Botmodule loading path: #{@dirs.join(', ')}"
+ # load core modules from
+ def add_core_module_dir(*dirlist)
+ @core_module_dirs += dirlist
+ debug "Core module loading paths: #{@core_module_dirs.join(', ')}"
+ end
+
+ # add one or more directories to the list of directories to
+ # load plugins from
+ def add_plugin_dir(*dirlist)
+ @plugin_dirs += dirlist
+ debug "Plugin loading paths: #{@plugin_dirs.join(', ')}"
end
def clear_botmodule_dirs
- @dirs.clear
- debug "Botmodule loading path cleared"
+ @core_module_dirs.clear
+ @plugin_dirs.clear
+ debug "Core module and plugin loading paths cleared"
end
# load plugins from pre-assigned list of directories
@@ -607,7 +613,7 @@ module Plugins
processed[pn.intern] = :blacklisted
}
- dirs = @dirs
+ dirs = @core_module_dirs + @plugin_dirs
dirs.each {|dir|
if(FileTest.directory?(dir))
d = Dir.new(dir)