]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - lib/rbot/config-compat.rb
userdata: extend userdata hash with DottedIndex access
[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 # Copyright:: Copyright (c) 2006 Giuseppe Bilotta
11 # License:: GPLv2
12
13 module Irc
14   Config = Bot::Config
15   module BotConfig
16     def BotConfig.register(*args)
17       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"
18       Bot::Config.register(*args)
19     end
20   end
21
22   Bot::Config.constants.each { |c|
23     Irc.module_eval("BotConfig#{c} = Bot::Config::#{c}")
24   }
25 end