]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
New IRC Framework: warn, don't raise, on case mismatch
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 21 Nov 2007 22:19:26 +0000 (22:19 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 21 Nov 2007 22:19:26 +0000 (22:19 +0000)
lib/rbot/irc.rb

index 86ca0fab198444fe5ebb268ebabd7220aee03415..9ce5781659f00f60a12f609b3afd30a92fb12100 100644 (file)
@@ -109,12 +109,16 @@ module Irc
       return self.upper == other.upper && self.lower == other.lower\r
     end\r
 \r
-    # Raise an error if _arg_ and self are not the same Casemap\r
+    # Give a warning if _arg_ and self are not the same Casemap\r
     #\r
     def must_be(arg)\r
       other = arg.to_irc_casemap\r
-      raise "Casemap mismatch (#{self.inspect} != #{other.inspect})" unless self == other\r
-      return true\r
+      if self == other\r
+        return true\r
+      else\r
+        warn "Casemap mismatch (#{self.inspect} != #{other.inspect})"\r
+        return false\r
+      end\r
     end\r
 \r
   end\r