]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
remote: bring up to date with changes in MessageMapper
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Nov 2009 11:45:56 +0000 (12:45 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Nov 2009 11:45:56 +0000 (12:45 +0100)
lib/rbot/core/remote.rb

index 52de3f3fe34644631789b97279b8264db355b6af..bd037ccacaf55dd76ef0fa97b278a4f0c636bcf0 100644 (file)
@@ -160,13 +160,13 @@ class Bot
         # Skip this element if it was unmapped
         next unless tmpl
         botmodule = @parent.plugins[tmpl.botmodule]
-        options, failure = tmpl.recognize(m)
-        if options.nil?
-          failures << [tmpl, failure]
+        options = tmpl.recognize(m)
+        if options.kind_of? Failure
+          failures << options
         else
           action = tmpl.options[:action]
           unless botmodule.respond_to?(action)
-            failures << [tmpl, "#{botmodule} does not respond to action #{action}"]
+            failures << NoActionFailure.new(tmpl, m)
             next
           end
           auth = tmpl.options[:full_auth_path]
@@ -182,8 +182,8 @@ class Bot
           return false
         end
       end
-      failures.each {|f, r|
-        debug "#{f.inspect} => #{r}"
+      failures.each {|r|
+        debug "#{r.template.inspect} => #{r}"
       }
       debug "no handler found"
       return false