summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-22 14:58:16 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-22 14:58:16 +0000
commit711bc431ab503909d4dbfa7b6cd775a764990eeb (patch)
treea7eea30972b139ae6deac0d3b7c7f638d043fb81 /lib/rbot
parent597bfec2266fc9c6c29f84a0d811fe264932500b (diff)
New configuration option plugins.blacklist holding an array of plugins to be blacklisted; entries are plugin filenames without the final {{{.rb}}}
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/plugins.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index bc522300..8ac3341d 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -1,4 +1,7 @@
module Irc
+ BotConfig.register BotConfigArrayValue.new('plugins.blacklist',
+ :default => [], :wizard => false, :requires_restart => true,
+ :desc => "Plugins that should not be loaded")
module Plugins
require 'rbot/messagemapper'
@@ -168,6 +171,10 @@ module Plugins
def initialize(bot, dirlist)
@@bot = bot
@dirs = dirlist
+ @blacklist = Array.new
+ @@bot.config['plugins.blacklist'].each { |p|
+ @blacklist << p+".rb"
+ }
scan
end
@@ -183,7 +190,7 @@ module Plugins
# load plugins from pre-assigned list of directories
def scan
- processed = Array.new
+ processed = @blacklist
dirs = Array.new
dirs << Config::datadir + "/plugins"
dirs += @dirs