summaryrefslogtreecommitdiff
path: root/lib/rbot/config-compat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot/config-compat.rb')
-rw-r--r--lib/rbot/config-compat.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/rbot/config-compat.rb b/lib/rbot/config-compat.rb
new file mode 100644
index 00000000..ee2cb613
--- /dev/null
+++ b/lib/rbot/config-compat.rb
@@ -0,0 +1,25 @@
+#-- vim:sw=2:et
+#++
+# :title: Config namespace backwards compatibility
+#
+# The move of everything rbot-related to the Irc::Bot::* namespace from Irc::*
+# would cause off-repo plugins to fail if they register any configuration key,
+# so we have to handle this case.
+#
+# Author:: Giuseppe Bilotta (giuseppe.bilotta@gmail.com)
+# Copyright:: Copyright (c) 2006 Giuseppe Bilotta
+# License:: GPLv2
+
+module Irc
+ Config = Bot::Config
+ module BotConfig
+ def BotConfig.register(*args)
+ warn "deprecated usage: please use Irc::Bot::Config instead of Irc::BotConfig (e.g. Config.register instead of BotConfig.register, Config::<type>Value instead of BotConfig<type>Value"
+ Bot::Config.register(*args)
+ end
+ end
+
+ Bot::Config.constants.each { |c|
+ Irc.module_eval("BotConfig#{c} = Bot::Config::#{c}")
+ }
+end