diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-04 00:19:51 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-04 00:19:51 +0000 |
commit | 5aa914133c6482c500cf439d65584282212beb6b (patch) | |
tree | 0f41aad864af62ceeebb76578ba65020de896b7f /lib/rbot/plugins.rb | |
parent | 6c470685174bdee375beb2d968059172d5689575 (diff) |
Fix stupid bug introduced with the new debugging messages. switch to kind_of? instead of .class<=
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r-- | lib/rbot/plugins.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 43793e99..42ff2aaa 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -266,7 +266,7 @@ module Plugins # Registers botmodule _botmodule_ with command _cmd_ and command path _auth_path_ def register(botmodule, cmd, auth_path) - raise TypeError, "First argument #{botmodule.inspect} is not of class BotModule" unless botmodule.class <= BotModule + raise TypeError, "First argument #{botmodule.inspect} is not of class BotModule" unless botmodule.kind_of?(BotModule) kl = botmodule.botmodule_class @commandmappers[kl.to_sym][cmd.to_sym] = {:botmodule => botmodule, :auth => auth_path} h = @commandmappers[kl.to_sym][cmd.to_sym] @@ -274,7 +274,7 @@ module Plugins end def add_botmodule(botmodule) - raise TypeError, "Argument #{botmodule.inspect} is not of class BotModule" unless botmodule.class <= BotModule + raise TypeError, "Argument #{botmodule.inspect} is not of class BotModule" unless botmodule.kind_of?(BotModule) kl = botmodule.botmodule_class raise "#{kl.to_s} #{botmodule.name} already registered!" if @botmodules[kl.to_sym].include?(botmodule) @botmodules[kl.to_sym] << botmodule @@ -542,9 +542,9 @@ module Plugins # debug "#{p.botmodule_class} #{p.name} responds" p.send method, *args rescue Exception => err - raise if err.class <= SystemExit + raise if err.kind_of?(SystemExit) error report_error("#{p.botmodule_class} #{p.name} #{method}() failed:", err) - raise if err.class <= BDB::Fatal + raise if err.kind_of?(BDB::Fatal) end end } @@ -579,9 +579,9 @@ module Plugins # debug "#{p.botmodule_class} #{p.name} responds" p.privmsg(m) rescue Exception => err - raise if err.class <= SystemExit + raise if err.kind_of?(SystemExit) error report_error("#{p.botmodule_class} #{p.name} privmsg() failed:", err) - raise if err.class <= BDB::Fatal + raise if err.kind_of?(BDB::Fatal) end # debug "Successfully delegated #{m.message}" return true |