]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/math.rb
quiz plugin: more UTF-8 workarounds while we wait for Ruby 2.0
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / math.rb
index 4a207389b02bc8dad44f6d8f22c42f732ba0a709..afa4737cd9eff71bf10292245ea04e67c8a8b132 100644 (file)
@@ -22,6 +22,9 @@ class MathPlugin < Plugin
      "ten" => "10"
   };
 
+  def name
+    "math"
+  end
   def help(plugin, topic="")
     "math <expression>, evaluate mathematical expression"
   end
@@ -108,7 +111,7 @@ class MathPlugin < Plugin
          end
          m.reply answer
        rescue Exception => e
-         puts "couldn't evaluate expression \"#{m.params}\": #{e}"
+         error "couldn't evaluate expression \"#{m.params}\": #{e.inspect}"
          m.reply "illegal expression \"#{m.params}\""
          return
        end
@@ -120,3 +123,4 @@ class MathPlugin < Plugin
 end
 plugin = MathPlugin.new
 plugin.register("math")
+plugin.register("maths")