.yardoc/objects/root.dat in safubot-0.0.3 vs .yardoc/objects/root.dat in safubot-0.0.4
- old
+ new
@@ -1,6 +1,6 @@
-{l: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:$YARD::CodeObjects::ModuleObject;IC;[o:$YARD::CodeObjects::MethodObject:@scope:
+{q: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:$YARD::CodeObjects::ModuleObject;IC;[o:$YARD::CodeObjects::MethodObject:@scope:
class:@visibility:public:
@pathI"Safubot.mode:EF:@parameters[ :@files[[I"lib/safubot.rb;Ti:@current_file_has_commentsF:
@name: mode:@source_type: ruby:
@tags[ :@docstringIC:YARD::Docstring"(Returns the value of attribute mode;F:@object@
:
@summary0:@hash_flagF:@ref_tags[ ;[ : @allI"(Returns the value of attribute mode;F:@namespace@:@sourceI"def mode
@@ -22,254 +22,315 @@
Pretty-printing of Exceptions and their backtraces.
@param e An Exception to print.;F:@line_rangeo:
Range: exclF:
begini :endi; @;!I"Idef error_report(e)
"#{e.inspect}\n#{e.backtrace.join("\n\t")}"
-end;F;"I"def error_report(e);F;#0;$T:@explicitTo:#YARD::CodeObjects::ClassObject;IC;[ :@owner@=:@class_mixinsIC;[ ;3@=:@instance_mixinsIC;[o:YARD::CodeObjects::Proxy:
@imethod0:@origname"MongoMapper::Document:@orignamespace@=;:
Document; o;6;70;80;90;:MongoMapper; @=: @obj0;<0;3@=:@attributesIC:SymbolHash{;IC;>{ :@symbolize_valueT;*IC;>{ ;?T;?T:
@aliases{ :@groups[ ;[[@0i[I"lib/safubot/xmpp.rb;Ti[I"lib/safubot/twitter.rb;Ti*;T;:Request;;;
;;[ ;IC;"wDefines elements of the input queue, agnostic of the transfer medium.
-May be extended by service-specific modules.
;F;@=;0;T;[ ;[ ;I"x
+end;F;"I"def error_report(e);F;#0;$T:@explicitTo:#YARD::CodeObjects::ClassObject;IC;[ :@owner@=:@class_mixinsIC;[ ;3@=:@instance_mixinsIC;[o:YARD::CodeObjects::Proxy:
@imethod0:@origname""MongoMapper::EmbeddedDocument:@orignamespace@=;:EmbeddedDocument; o;6;70;80;90;:MongoMapper; @=: @obj0;<0;3@=:@attributesIC:SymbolHash{;IC;>{ :@symbolize_valueT;*IC;>{ ;?T;?T:
@aliases{ :@groups[ ;[[@0i;T;:Problem;;;
;;[ ;IC;"@An EmbeddedDocument for storing processing/dispatch errors.
;F;@=;0;F;[ ;[ ;I"A
+An EmbeddedDocument for storing processing/dispatch errors.;F;,o;-;.F;/i;0i; @;I"Safubot::Problem;F:@superclasso;6;70;80;90;:Object; @;<0;#0;$To; ;IC;[o;
+;;*;
;;I"%Safubot::Problematic#add_problem;F;[["e0;[[@0i ;T;:add_problem;;;[ ;IC;",Adds a timestamped Problem to the list.
;F;@U;0;T;[ ;[o;&
+;'I"
+param;F;(I"1Exception from which the Problem is derived.;F;I"e;F;)0;@U;I"c
+Adds a timestamped Problem to the list.
+@param e Exception from which the Problem is derived.;F;,o;-;.F;/i;0i; @S;!I"def add_problem(e)
+ problem = Problem.new(:error => e.to_s, :type => e.class.to_s,
+ :when => Time.now, :backtrace => e.backtrace)
+ self.problems.push(problem)
+end;F;"I"def add_problem(e);F;#0;$T;1To;
+;;*;
;;I"&Safubot::Problematic#last_problem;F;[ ;[[@0i(;T;:last_problem;;;[ ;IC;"%Fetches the most recent Problem.
;F;@h;0;T;[ ;[ ;I"&
+Fetches the most recent Problem.;F;,o;-;.F;/i&;0i'; @S;!I"Odef last_problem
+ self.problems.sort { |x,y| x.when <=> y.when }.last
+end;F;"I"def last_problem( );F;#0;$T;1T;3@S;4IC;[ ;3@S;5IC;[ ;3@S;=IC;>{;IC;>{ ;?T;*IC;>{ ;?T;?T;@{ ;A[ ;[[@0i;T;:Problematic;;;
;;[ ;IC;"%A mixin adding Problem handling.
;F;@S;0;T;[ ;[ ;I"&
+A mixin adding Problem handling.;F;,o;-;.F;/i;0i; @;I"Safubot::Problematic;F;#0;$To;2;IC;[ ;3@;4IC;[ ;3@;5IC;[o;6;70;80;90;;G; @;<@So;6;70;8"MongoMapper::Document;9@;:
Document; o;6;70;80;90;;;; @;<0;<0;3@;=IC;>{;IC;>{ ;?T;*IC;>{ ;?T;?T;@{ ;A[ ;[[@0i1[I"lib/safubot/xmpp.rb;Ti[I"lib/safubot/twitter.rb;Ti*;T;:Request;;;
;;[ ;IC;"wDefines elements of the input queue, agnostic of the transfer medium.
+May be extended by service-specific modules.
;F;@;0;T;[ ;[ ;I"x
Defines elements of the input queue, agnostic of the transfer medium.
-May be extended by service-specific modules.;F;,o;-;.F;/i;0i; @;I"Safubot::Request;F:@superclasso;6;70;80;90;:Object; @;<0;#0;$To;2;IC;[ ;3@W;4IC;[ ;3@W;5IC;[o;6;70;8"MongoMapper::Document;9@W;;:; o;6;70;80;90;;;; @W;<0;<0;3@W;=IC;>{;IC;>{ ;?T;*IC;>{ ;?T;?T;@{ ;A[ ;[[@0i#;T;:
Response;;;
;;[ ;IC;"xDefines elements of the output queue, agnostic of the transfer medium.
-May be extended by service-specific modules.
;F;@W;0;T;[ ;[ ;I"y
+May be extended by service-specific modules.;F;,o;-;.F;/i.;0i0; @;I"Safubot::Request;F;Co;6;70;80;90;;D; @;<0;#0;$To;2;IC;[ ;3@;4IC;[ ;3@;5IC;[o;6;70;80;90;;G; @;<@So;6;70;8"MongoMapper::Document;9@;;H; o;6;70;80;90;;;; @;<0;<0;3@;=IC;>{;IC;>{ ;?T;*IC;>{ ;?T;?T;@{ ;A[ ;[[@0iC;T;:
Response;;;
;;[ ;IC;"xDefines elements of the output queue, agnostic of the transfer medium.
+May be extended by service-specific modules.
;F;@;0;T;[ ;[ ;I"y
Defines elements of the output queue, agnostic of the transfer medium.
-May be extended by service-specific modules.;F;,o;-;.F;/i ;0i"; @;I"Safubot::Response;F;Co;6;70;80;90;;D; @;<0;#0;$To;2;IC;[o;
-;;*;
;;I"Safubot::Bot#opts;F;[ ;[[@0i4;F;: opts;;;[ ;IC;"(Returns the value of attribute opts;F;@o;0;F;[ ;[ ;I"(Returns the value of attribute opts;F; @m;!I"def opts
+May be extended by service-specific modules.;F;,o;-;.F;/i@;0iB; @;I"Safubot::Response;F;Co;6;70;80;90;;D; @;<0;#0;$To;2;IC;[o;
+;;*;
;;I"Safubot::Bot#opts;F;[ ;[[@0iV;F;: opts;;;[ ;IC;"(Returns the value of attribute opts;F;@;0;F;[ ;[ ;I"(Returns the value of attribute opts;F; @;!I"def opts
@opts
end;F;"I"
def opts;F;#0;$To;
-;;*;
;;I"Safubot::Bot#twitter;F;[ ;[[@0i4;F;:twitter;;;[ ;IC;"+Returns the value of attribute twitter;F;@{;0;F;[ ;[ ;I"+Returns the value of attribute twitter;F; @m;!I"def twitter
+;;*;
;;I"Safubot::Bot#twitter;F;[ ;[[@0iV;F;:twitter;;;[ ;IC;"+Returns the value of attribute twitter;F;@;0;F;[ ;[ ;I"+Returns the value of attribute twitter;F; @;!I"def twitter
@twitter
end;F;"I"def twitter;F;#0;$To;
-;;*;
;;I"Safubot::Bot#xmpp;F;[ ;[[@0i4;F;: xmpp;;;[ ;IC;"(Returns the value of attribute xmpp;F;@;0;F;[ ;[ ;I"(Returns the value of attribute xmpp;F; @m;!I"def xmpp
+;;*;
;;I"Safubot::Bot#xmpp;F;[ ;[[@0iV;F;: xmpp;;;[ ;IC;"(Returns the value of attribute xmpp;F;@;0;F;[ ;[ ;I"(Returns the value of attribute xmpp;F; @;!I"def xmpp
@xmpp
end;F;"I"
def xmpp;F;#0;$To;
-;;*;
;;I"Safubot::Bot#request_error;F;[["req0["e0;[[@0i:;T;:request_error;;;[ ;IC;"ERecords an error and emits a corresponding :request_error event.
;F;@;0;T;[ ;[o;&
+;;*;
;;I"Safubot::Bot#request_error;F;[["req0["e0;[[@0i\;T;:request_error;;;[ ;IC;"SRecords an error in processing and emits a corresponding :request_error event.
;F;@;0;T;[ ;[o;&
;'I"
-param;F;(I"5The Request for which the error was encountered.;F;I"req;F;)0;@o;&
+param;F;(I"5The Request for which the error was encountered.;F;I"req;F;)0;@o;&
;'I"
-param;F;(I"The caught Exception.;F;I"e;F;)0;@;I"
-Records an error and emits a corresponding :request_error event.
+param;F;(I"The caught Exception.;F;I"e;F;)0;@;I"
+Records an error in processing and emits a corresponding :request_error event.
@param req The Request for which the error was encountered.
-@param e The caught Exception.;F;,o;-;.F;/i6;0i9; @m;!I"def request_error(req, e)
- Log.error "Error processing #{req.source.class} '#{req.text}': #{e}\n#{e.backtrace.join("\n\t")}"
- req.errors[Time.now] = e
+@param e The caught Exception.;F;,o;-;.F;/iX;0i[; @;!I"def request_error(req, e)
+ Log.error "Error processing #{req.source.class} '#{req.text}': #{error_report(e)}"
+ req.add_problem(e)
req.save
emit(:request_error, req, e)
end;F;"I"def request_error(req, e);F;#0;$T;1To;
-;;*;
;;I"!Safubot::Bot#process_request;F;[["req0;[[@0iD;T;:process_request;;;[ ;IC;"5Processes an individual request (synchronously).
;F;@;0;T;[ ;[o;&
+;;*;
;;I" Safubot::Bot#dispatch_error;F;[[" resp0["e0;[[@0ig;T;:dispatch_error;;;[ ;IC;"RRecords an error in dispatch and emits a corresponding :dispatch_error event.
;F;@;0;T;[ ;[o;&
;'I"
-param;F;(I"An unprocessed Request.;F;I"req;F;)0;@;I"Y
+param;F;(I"6The Response for which the error was encountered.;F;I" resp;F;)0;@o;&
+;'I"
+param;F;(I"The caught Exception.;F;I"e;F;)0;@;I"
+Records an error in dispatch and emits a corresponding :dispatch_error event.
+@param resp The Response for which the error was encountered.
+@param e The caught Exception.;F;,o;-;.F;/ic;0if; @;!I"def dispatch_error(resp, e)
+ Log.error "Error dispatching #{resp.request.source.class} '#{resp.text}': #{error_report(e)}"
+ resp.add_problem(e)
+ resp.save
+ emit(:dispatch_error, resp, e)
+end;F;"I" def dispatch_error(resp, e);F;#0;$T;1To;
+;;*;
;;I"!Safubot::Bot#process_request;F;[["req0;[[@0iq;T;:process_request;;;[ ;IC;"5Processes an individual request (synchronously).
;F;@
+;0;T;[ ;[o;&
+;'I"
+param;F;(I"An unprocessed Request.;F;I"req;F;)0;@
+;I"Y
Processes an individual request (synchronously).
-@param req An unprocessed Request.;F;,o;-;.F;/iA;0iC; @m;!I"def process_request(req)
+@param req An unprocessed Request.;F;,o;-;.F;/in;0ip; @;!I"def process_request(req)
+ req.reload
+ if req.processed
+ Log.debug "Request '#{req.text}' has already been processed, ignoring."
+ return
+ elsif req.processing
+ Log.debug "Request '#{req.text}' is currently in processing, ignoring."
+ return
+ end
+
begin
+ req.processing = true
+ req.save
emit(:request, req)
rescue Exception => e
request_error(req, e)
+ else
+ req.success = true
ensure
- req.processed = true
- req.save
+ #if Safubot::mode == :production
+ req.processing = false
+ req.processed = true
+ req.save
+ #end
end
end;F;"I"def process_request(req);F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#dispatch;F;[[" resp0;[[@0iR;T;:
dispatch;;;[ ;IC;"?Performs appropriate dispatch operation for response type.
;F;@;0;T;[ ;[o;&
+;;*;
;;I"Safubot::Bot#dispatch;F;[[" resp0;[[@0i;T;:
dispatch;;;[ ;IC;"?Performs appropriate dispatch operation for response type.
;F;@;0;T;[ ;[o;&
;'I"
-param;F;(I"An undispatched Response.;F;I" resp;F;)0;@;I"f
+param;F;(I"An undispatched Response.;F;I" resp;F;)0;@;I"f
Performs appropriate dispatch operation for response type.
-@param resp An undispatched Response.;F;,o;-;.F;/iO;0iQ; @m;!I"def dispatch(resp)
+@param resp An undispatched Response.;F;,o;-;.F;/i;0i; @;!I"def dispatch(resp)
+ resp.reload
+ if resp.dispatched
+ Log.debug "Response '#{resp.text}' has already been dispatched, ignoring."
+ return
+ elsif resp.dispatching
+ Log.debug "Response '#{resp.text}' is already in dispatch, ignoring."
+ return
+ elsif resp.problems.length > 10
+ Log.debug "Response '#{resp.text}' encountered more than ten dispatch errors, ignoring."
+ return
+ elsif !resp.problems.empty? && (Time.now - resp.last_problem.when) < 1.minute
+ Log.debug "Response '#{resp.text}' encountered a dispatch error <1 minute ago, ignoring."
+ return
+ end
+
begin
source = resp.request.source
+ resp.dispatching = true
+ resp.save
+
if Safubot::mode != :production
Log.info "#{source.class} Response to #{source.username}: #{resp.text}"
else
if @twitter && [Twitter::Tweet, Twitter::DirectMessage].include?(source.class)
@twitter.send(resp)
elsif @xmpp && [XMPP::Message].include?(source.class)
@xmpp.send(resp)
else
raise NotImplementedError, "Don't know how to send response to a #{source.class}!"
end
- end
- resp.dispatched = true
- resp.save
+ resp.dispatched = true
+ resp.save
+ end
rescue Exception => e
- Log.error "Error dispatching #{source.class} '#{resp.text}': #{e}"
- resp.errors[Time.now] = e
+ dispatch_error(resp, e)
+ ensure
+ resp.dispatching = false
resp.save
- emit(:dispatch_error, resp, e)
end
end;F;"I"def dispatch(resp);F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#pull;F;[ ;[[@0il;T;: pull;;;[ ;IC;"^This pulls requests from passive non-streaming sources (currently, the Twitter AJAX API).
;F;@;0;F;[ ;[ ;I"^This pulls requests from passive non-streaming sources (currently, the Twitter AJAX API).;F;,o;-;.F;/ik;0ik; @m;!I"!def pull
+;;*;
;;I"Safubot::Bot#pull;F;[ ;[[@0i;T;: pull;;;[ ;IC;"^This pulls requests from passive non-streaming sources (currently, the Twitter AJAX API).
;F;@0;0;F;[ ;[ ;I"^This pulls requests from passive non-streaming sources (currently, the Twitter AJAX API).;F;,o;-;.F;/i;0i; @;!I"!def pull
@twitter.pull
end;F;"I"def pull( );F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#process;F;[ ;[[@0iq;T;:process;;;[ ;IC;"IGoes through each unprocessed Request and submits it for processing.
;F;@;0;F;[ ;[ ;I"IGoes through each unprocessed Request and submits it for processing.;F;,o;-;.F;/ip;0ip; @m;!I"ydef process
+;;*;
;;I"Safubot::Bot#process;F;[ ;[[@0i;T;:process;;;[ ;IC;"IGoes through each unprocessed Request and submits it for processing.
;F;@=;0;F;[ ;[ ;I"IGoes through each unprocessed Request and submits it for processing.;F;,o;-;.F;/i;0i; @;!I"ydef process
Request.where(:processed => false).each do |req|
concurrently(req) { process_request(req) }
end
end;F;"I"def process( );F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#respond;F;[["req0[" text0;[[@0i{;T;:respond;;;[ ;IC;""Adds a response to the queue.
;F;@;0;T;[ ;[o;&
+;;*;
;;I"Safubot::Bot#respond;F;[["req0[" text0;[[@0i;T;:respond;;;[ ;IC;"4Adds a response to the queue and dispatches it.
;F;@J;0;T;[ ;[o;&
;'I"
-param;F;(I"Request to respond to.;F;I"req;F;)0;@o;&
+param;F;(I"Request to respond to.;F;I"req;F;)0;@Jo;&
;'I"
-param;F;(I"Contents of the response.;F;I" text;F;)0;@;I"k
-Adds a response to the queue.
+param;F;(I"Contents of the response.;F;I" text;F;)0;@J;I"}
+Adds a response to the queue and dispatches it.
@param req Request to respond to.
-@param text Contents of the response.;F;,o;-;.F;/iw;0iz; @m;!I"def respond(req, text)
+@param text Contents of the response.;F;,o;-;.F;/i;0i; @;!I"def respond(req, text)
Log.info("#{req.user.name}: #{req.text}\nsafubot: #{text}")
- Response.create(:request => req, :text => text)
+ dispatch(Response.create(:request => req, :text => text))
end;F;"I"def respond(req, text);F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#respond_now;F;[["req0[" text0;[[@0i|;T;:respond_now;;;[ ;IC;"Respond + push
;F;@ ;0;F;[ ;[ ;I"Respond + push;F;,o;-;.F;/i{;0i{; @m;!I"?def respond_now(req, text)
- respond(req, text)
- push
-end;F;"I"def respond_now(req, text);F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#push;F;[ ;[[@0i;T;: push;;;[ ;IC;"+Dispatches all undispatched Responses.
;F;@;0;F;[ ;[ ;I"+Dispatches all undispatched Responses.;F;,o;-;.F;/i;0i; @m;!I"Qdef push
+;;*;
;;I"Safubot::Bot#push;F;[ ;[[@0i;T;: push;;;[ ;IC;"+Dispatches all undispatched Responses.
;F;@c;0;F;[ ;[ ;I"+Dispatches all undispatched Responses.;F;,o;-;.F;/i;0i; @;!I"Qdef push
Response.where(:dispatched => false).each(&method(:dispatch))
end;F;"I"def push( );F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#concurrently;F;[["req0[I" &blk;F0;[[@0i;T;:concurrently;;;[ ;IC;"UWraps Thread.new with error handling and response pushing for the given request.
;F;@;0;T;[ ;[o;&
+;;*;
;;I"Safubot::Bot#concurrently;F;[["req0[I" &blk;F0;[[@0i;T;:concurrently;;;[ ;IC;"UWraps Thread.new with error handling and response pushing for the given request.
;F;@p;0;T;[ ;[o;&
;'I"
-param;F;(I"!The Request being processed.;F;I"req;F;)0;@o;&
+param;F;(I"!The Request being processed.;F;I"req;F;)0;@po;&
;'I"
-param;F;(I"8The operation to be performed in a separate thread.;F;I"blk;F;)0;@;I"
+param;F;(I"8The operation to be performed in a separate thread.;F;I"blk;F;)0;@p;I"
Wraps Thread.new with error handling and response pushing for the given request.
@param req The Request being processed.
-@param blk The operation to be performed in a separate thread.;F;,o;-;.F;/i;0i; @m;!I"def concurrently(req, &blk)
+@param blk The operation to be performed in a separate thread.;F;,o;-;.F;/i;0i; @;!I"def concurrently(req, &blk)
Thread.new do
begin
blk.call
rescue Exception => e
request_error(req, e)
end
-
push
end
end;F;"I" def concurrently(req, &blk);F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#run_nowait;F;[ ;[[@0i;T;:run_nowait;;;[ ;IC;"TRuns an initial request-processing loop and then forks the streaming processes.
;F;@7;0;F;[ ;[ ;I"TRuns an initial request-processing loop and then forks the streaming processes.;F;,o;-;.F;/i;0i; @m;!I"]def run_nowait
+;;*;
;;I"Safubot::Bot#run_nowait;F;[ ;[[@0i;T;:run_nowait;;;[ ;IC;"TRuns an initial request-processing loop and then forks the streaming processes.
;F;@;0;F;[ ;[ ;I"TRuns an initial request-processing loop and then forks the streaming processes.;F;,o;-;.F;/i;0i; @;!I"]def run_nowait
pull; process; push
@twitter.run if @twitter
@xmpp.run if @xmpp
end;F;"I"def run_nowait( );F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#run;F;[ ;[[@0i;T;:run;;;[ ;IC;"=Calls run_nowait and then waits for all child processes.
;F;@D;0;F;[ ;[ ;I"=Calls run_nowait and then waits for all child processes.;F;,o;-;.F;/i;0i; @m;!I"Udef run
+;;*;
;;I"Safubot::Bot#run;F;[ ;[[@0i;T;:run;;;[ ;IC;"=Calls run_nowait and then waits for all child processes.
;F;@;0;F;[ ;[ ;I"=Calls run_nowait and then waits for all child processes.;F;,o;-;.F;/i;0i; @;!I"Udef run
run_nowait
begin
Process.waitall
rescue Interrupt
stop
end
end;F;"I"def run( );F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#stop;F;[ ;[[@0i;T;: stop;;;[ ;IC;"(Shuts down the streaming processes.
;F;@Q;0;F;[ ;[ ;I"(Shuts down the streaming processes.;F;,o;-;.F;/i;0i; @m;!I"Cdef stop
+;;*;
;;I"Safubot::Bot#stop;F;[ ;[[@0i;T;: stop;;;[ ;IC;"(Shuts down the streaming processes.
;F;@;0;F;[ ;[ ;I"(Shuts down the streaming processes.;F;,o;-;.F;/i;0i; @;!I"Cdef stop
@twitter.stop if @twitter
@xmpp.stop if @xmpp
end;F;"I"def stop( );F;#0;$T;1To;
-;;*;
;;I" Safubot::Bot#enable_twitter;F;[[" opts"{};[[@0i;T;:enable_twitter;;;[ ;IC;"/Initialises Twitter-related functionality.
;F;@^;0;F;[ ;[ ;I"/Initialises Twitter-related functionality.;F;,o;-;.F;/i;0i; @m;!I"~def enable_twitter(opts={})
+;;*;
;;I" Safubot::Bot#enable_twitter;F;[[" opts"{};[[@0i;T;:enable_twitter;;;[ ;IC;"/Initialises Twitter-related functionality.
;F;@;0;F;[ ;[ ;I"/Initialises Twitter-related functionality.;F;,o;-;.F;/i;0i; @;!I"def enable_twitter(opts={})
@twitter = Twitter::Bot.new(opts)
@twitter.on(:request) do |req|
- process; push
+ process_request(req)
+ req.responses.where(:dispatched => false).map(&:dispatch)
end
end;F;"I" def enable_twitter(opts={});F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#enable_xmpp;F;[["options"{};[[@0i;T;:enable_xmpp;;;[ ;IC;",Initialises XMPP-related functionality.
;F;@n;0;F;[ ;[ ;I",Initialises XMPP-related functionality.;F;,o;-;.F;/i;0i; @m;!I"def enable_xmpp(options={})
+;;*;
;;I"Safubot::Bot#enable_xmpp;F;[["options"{};[[@0i;T;:enable_xmpp;;;[ ;IC;",Initialises XMPP-related functionality.
;F;@;0;F;[ ;[ ;I",Initialises XMPP-related functionality.;F;,o;-;.F;/i;0i; @;!I"def enable_xmpp(options={})
defaults = { :jid => nil, :password => nil }
@xmpp = XMPP::Bot.new(defaults.merge(options))
@xmpp.on(:request) do |req|
- process; push
+ process_request(req)
+ req.responses.where(:dispatched => false).map(&:dispatch)
end
end;F;"I" def enable_xmpp(options={});F;#0;$T;1To;
-;;*;
;;I"Safubot::Bot#initialize;F;[["options"{};[[@0i;F;:initialize;;;[ ;IC;"