summaryrefslogtreecommitdiff
path: root/lib/rbot/config-compat.rb
blob: ee2cb613d83f1e37a9ecb82fe901ac6649e482f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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