]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
New configuration option plugins.blacklist holding an array of plugins to be blacklis...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 22 Jul 2006 14:58:16 +0000 (14:58 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 22 Jul 2006 14:58:16 +0000 (14:58 +0000)
lib/rbot/plugins.rb

index bc522300e7395a7cf1b89bd96dd558670e128398..8ac3341d909c1034e1ebcce80c3c7d50e87d3120 100644 (file)
@@ -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