From 711bc431ab503909d4dbfa7b6cd775a764990eeb Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 22 Jul 2006 14:58:16 +0000 Subject: New configuration option plugins.blacklist holding an array of plugins to be blacklisted; entries are plugin filenames without the final {{{.rb}}} --- lib/rbot/plugins.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/rbot') 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 -- cgit v1.2.3