]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - lib/rbot/config-compat.rb
[registry] removed temp logging
[user/henk/code/ruby/rbot.git] / lib / rbot / config-compat.rb
1 #-- vim:sw=2:et
2 #++
3 # :title: Config namespace backwards compatibility
4 #
5 # The move of everything rbot-related to the Irc::Bot::* namespace from Irc::*
6 # would cause off-repo plugins to fail if they register any configuration key,
7 # so we have to handle this case.
8 #
9 # Author:: Giuseppe Bilotta (giuseppe.bilotta@gmail.com)
10
11 module Irc
12   Config = Bot::Config
13   module BotConfig
14     def BotConfig.register(*args)
15       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"
16       Bot::Config.register(*args)
17     end
18   end
19
20   Bot::Config.constants.each { |c|
21     Irc.module_eval("BotConfig#{c} = Bot::Config::#{c}")
22   }
23 end