From: Giuseppe Bilotta Date: Sat, 22 Jul 2006 14:58:16 +0000 (+0000) Subject: New configuration option plugins.blacklist holding an array of plugins to be blacklis... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=711bc431ab503909d4dbfa7b6cd775a764990eeb;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git New configuration option plugins.blacklist holding an array of plugins to be blacklisted; entries are plugin filenames without the final {{{.rb}}} --- 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