safubot 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardoc/checksums +7 -7
 - data/.yardoc/objects/root.dat +0 -0
 - data/README.md +9 -4
 - data/doc/Safubot.html +103 -1
 - data/doc/Safubot/Bot.html +511 -224
 - data/doc/Safubot/Evented.html +2 -3
 - data/doc/Safubot/KnownUser.html +5 -5
 - data/doc/Safubot/Log.html +37 -10
 - data/doc/Safubot/Query.html +34 -7
 - data/doc/Safubot/Request.html +3 -82
 - data/doc/Safubot/Response.html +1 -1
 - data/doc/Safubot/Test.html +76 -13
 - data/doc/Safubot/Twitter.html +14 -2
 - data/doc/Safubot/Twitter/Bot.html +441 -105
 - data/doc/Safubot/Twitter/DirectMessage.html +16 -16
 - data/doc/Safubot/Twitter/Tweet.html +31 -31
 - data/doc/Safubot/XMPP.html +14 -2
 - data/doc/Safubot/XMPP/Bot.html +324 -61
 - data/doc/Safubot/XMPP/Message.html +13 -13
 - data/doc/_index.html +1 -1
 - data/doc/file.README.html +43 -5
 - data/doc/index.html +43 -5
 - data/doc/method_list.html +155 -83
 - data/doc/top-level-namespace.html +1 -1
 - data/lib/safubot/bot.rb +35 -16
 - data/lib/safubot/evented.rb +1 -1
 - data/lib/safubot/log.rb +2 -0
 - data/lib/safubot/test_helper.rb +8 -1
 - data/lib/safubot/twitter.rb +52 -21
 - data/lib/safubot/version.rb +1 -1
 - data/lib/safubot/xmpp.rb +34 -15
 - data/safubot.gemspec +3 -3
 - metadata +29 -29
 
    
        data/.yardoc/checksums
    CHANGED
    
    | 
         @@ -1,9 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            lib/safubot.rb da2c6f1fa7e7a17064469e0a5409f5dc2a6ec7ab
         
     | 
| 
       2 
     | 
    
         
            -
            lib/safubot/bot.rb  
     | 
| 
       3 
     | 
    
         
            -
            lib/safubot/log.rb  
     | 
| 
       4 
     | 
    
         
            -
            lib/safubot/xmpp.rb  
     | 
| 
       5 
     | 
    
         
            -
            lib/safubot/evented.rb  
     | 
| 
      
 2 
     | 
    
         
            +
            lib/safubot/bot.rb 91a9512ec77a70a4a3bf3d1235d81f546cae7765
         
     | 
| 
      
 3 
     | 
    
         
            +
            lib/safubot/log.rb c341c5e6a54a908ee8431b5aac2aa7c3472eaeed
         
     | 
| 
      
 4 
     | 
    
         
            +
            lib/safubot/xmpp.rb 253c1ef4b93f85f4cfd55d8fb561984eb1bcf151
         
     | 
| 
      
 5 
     | 
    
         
            +
            lib/safubot/evented.rb 8e90ab5b812eb12113095a8bdde7a96ba0e62d1f
         
     | 
| 
       6 
6 
     | 
    
         
             
            lib/safubot/version.rb 67c555f319499e0bcc596a73152df9f0797da190
         
     | 
| 
       7 
     | 
    
         
            -
            lib/safubot/twitter.rb  
     | 
| 
       8 
     | 
    
         
            -
            lib/safubot/known_user.rb  
     | 
| 
       9 
     | 
    
         
            -
            lib/safubot/test_helper.rb  
     | 
| 
      
 7 
     | 
    
         
            +
            lib/safubot/twitter.rb 414b3cabef1611923f18d779d279ce0b6f3128b8
         
     | 
| 
      
 8 
     | 
    
         
            +
            lib/safubot/known_user.rb 8e2ce383a220c28d8729540be7fc0dfeca3f48fc
         
     | 
| 
      
 9 
     | 
    
         
            +
            lib/safubot/test_helper.rb 892633f1707378964059f7209da7771669fdb993
         
     | 
    
        data/.yardoc/objects/root.dat
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # safubot - an  
     | 
| 
      
 1 
     | 
    
         
            +
            # safubot - an event-driven chatbot framework for Ruby
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ## <a name="overview">Overview</a>
         
     | 
| 
       4 
4 
     | 
    
         
             
            Safubot is a chatbot framework for Twitter and XMPP which aims to abstract away the idiosyncracies of the underlying APIs, allowing you to focus on writing request-processing logic. Of course, if you want to use  service-specific features (such as responding to timeline tweets) it lets you do that too!
         
     | 
| 
         @@ -62,10 +62,15 @@ Safubot uses [MongoDB](http://www.mongodb.org) for storage. It's [easy to instal 
     | 
|
| 
       62 
62 
     | 
    
         
             
            	  end
         
     | 
| 
       63 
63 
     | 
    
         
             
            	end
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
       65 
     | 
    
         
            -
            	#  
     | 
| 
       66 
     | 
    
         
            -
            	#  
     | 
| 
      
 65 
     | 
    
         
            +
            	# This will fork the Twitter/XMPP streaming processes as needed
         
     | 
| 
      
 66 
     | 
    
         
            +
            	# and then wait for them. You can call run_nowait if you want
         
     | 
| 
      
 67 
     | 
    
         
            +
            	# a non-blocking form.
         
     | 
| 
       67 
68 
     | 
    
         
             
            	NiftyBot.new.run
         
     | 
| 
       68 
69 
     | 
    
         | 
| 
      
 70 
     | 
    
         
            +
            ## <a name="logging">Logging</a>
         
     | 
| 
      
 71 
     | 
    
         
            +
            Safubot::Log behaves as a Logger instance and will write to stdout by default. You can also tell it to write to a file:
         
     | 
| 
      
 72 
     | 
    
         
            +
            	Safubot::Log.path = "/some/cool/logfile"
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
       69 
74 
     | 
    
         
             
            ## <a name="example">Specific Examples</a>
         
     | 
| 
       70 
75 
     | 
    
         | 
| 
       71 
76 
     | 
    
         
             
            ### Find the last processed request from a user
         
     | 
| 
         @@ -86,7 +91,7 @@ Safubot uses [MongoDB](http://www.mongodb.org) for storage. It's [easy to instal 
     | 
|
| 
       86 
91 
     | 
    
         
             
            	  end
         
     | 
| 
       87 
92 
     | 
    
         
             
            	end
         
     | 
| 
       88 
93 
     | 
    
         | 
| 
       89 
     | 
    
         
            -
            ### Start an unprompted conversation with an XMPP user 
     | 
| 
      
 94 
     | 
    
         
            +
            ### Start an unprompted conversation with an XMPP user
         
     | 
| 
       90 
95 
     | 
    
         | 
| 
       91 
96 
     | 
    
         
             
            	@xmpp.on(:ready) do
         
     | 
| 
       92 
97 
     | 
    
         
             
            	  @xmpp.tell('^_^@jabber.org', "You'd best be maintaining safubot!")
         
     | 
    
        data/doc/Safubot.html
    CHANGED
    
    | 
         @@ -140,6 +140,41 @@ Returns the value of attribute mode. 
     | 
|
| 
       140 
140 
     | 
    
         | 
| 
       141 
141 
     | 
    
         | 
| 
       142 
142 
     | 
    
         | 
| 
      
 143 
     | 
    
         
            +
              
         
     | 
| 
      
 144 
     | 
    
         
            +
                <h2>
         
     | 
| 
      
 145 
     | 
    
         
            +
                  Instance Method Summary
         
     | 
| 
      
 146 
     | 
    
         
            +
                  <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
         
     | 
| 
      
 147 
     | 
    
         
            +
                </h2>
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
                <ul class="summary">
         
     | 
| 
      
 150 
     | 
    
         
            +
                  
         
     | 
| 
      
 151 
     | 
    
         
            +
                    <li class="public ">
         
     | 
| 
      
 152 
     | 
    
         
            +
              <span class="summary_signature">
         
     | 
| 
      
 153 
     | 
    
         
            +
                
         
     | 
| 
      
 154 
     | 
    
         
            +
                  <a href="#error_report-instance_method" title="#error_report (instance method)">- (Object) <strong>error_report</strong>(e) </a>
         
     | 
| 
      
 155 
     | 
    
         
            +
                
         
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
                
         
     | 
| 
      
 158 
     | 
    
         
            +
              </span>
         
     | 
| 
      
 159 
     | 
    
         
            +
              
         
     | 
| 
      
 160 
     | 
    
         
            +
              
         
     | 
| 
      
 161 
     | 
    
         
            +
              
         
     | 
| 
      
 162 
     | 
    
         
            +
              
         
     | 
| 
      
 163 
     | 
    
         
            +
              
         
     | 
| 
      
 164 
     | 
    
         
            +
              
         
     | 
| 
      
 165 
     | 
    
         
            +
             
     | 
| 
      
 166 
     | 
    
         
            +
              
         
     | 
| 
      
 167 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 168 
     | 
    
         
            +
            Pretty-printing of Exceptions and their backtraces.
         
     | 
| 
      
 169 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 170 
     | 
    
         
            +
            </div></span>
         
     | 
| 
      
 171 
     | 
    
         
            +
              
         
     | 
| 
      
 172 
     | 
    
         
            +
            </li>
         
     | 
| 
      
 173 
     | 
    
         
            +
             
     | 
| 
      
 174 
     | 
    
         
            +
                  
         
     | 
| 
      
 175 
     | 
    
         
            +
                </ul>
         
     | 
| 
      
 176 
     | 
    
         
            +
              
         
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
       143 
178 
     | 
    
         | 
| 
       144 
179 
     | 
    
         
             
              <div id="class_attr_details" class="attr_details">
         
     | 
| 
       145 
180 
     | 
    
         
             
                <h2>Class Attribute Details</h2>
         
     | 
| 
         @@ -190,10 +225,77 @@ Returns the value of attribute mode 
     | 
|
| 
       190 
225 
     | 
    
         
             
              </div>
         
     | 
| 
       191 
226 
     | 
    
         | 
| 
       192 
227 
     | 
    
         | 
| 
      
 228 
     | 
    
         
            +
              <div id="instance_method_details" class="method_details_list">
         
     | 
| 
      
 229 
     | 
    
         
            +
                <h2>Instance Method Details</h2>
         
     | 
| 
      
 230 
     | 
    
         
            +
                
         
     | 
| 
      
 231 
     | 
    
         
            +
                
         
     | 
| 
      
 232 
     | 
    
         
            +
                  <div class="method_details first">
         
     | 
| 
      
 233 
     | 
    
         
            +
              <p class="signature first" id="error_report-instance_method">
         
     | 
| 
      
 234 
     | 
    
         
            +
              
         
     | 
| 
      
 235 
     | 
    
         
            +
                - (<tt>Object</tt>) <strong>error_report</strong>(e) 
         
     | 
| 
      
 236 
     | 
    
         
            +
              
         
     | 
| 
      
 237 
     | 
    
         
            +
             
     | 
| 
      
 238 
     | 
    
         
            +
              
         
     | 
| 
      
 239 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 240 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 241 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 242 
     | 
    
         
            +
            Pretty-printing of Exceptions and their backtraces.
         
     | 
| 
      
 243 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 244 
     | 
    
         
            +
             
     | 
| 
      
 245 
     | 
    
         
            +
             
     | 
| 
      
 246 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 247 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 248 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 249 
     | 
    
         
            +
              <h3>Parameters:</h3>
         
     | 
| 
      
 250 
     | 
    
         
            +
            <ul class="param">
         
     | 
| 
      
 251 
     | 
    
         
            +
              
         
     | 
| 
      
 252 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 253 
     | 
    
         
            +
                  
         
     | 
| 
      
 254 
     | 
    
         
            +
                    <span class='name'>e</span>
         
     | 
| 
      
 255 
     | 
    
         
            +
                  
         
     | 
| 
      
 256 
     | 
    
         
            +
                  
         
     | 
| 
      
 257 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 258 
     | 
    
         
            +
                  
         
     | 
| 
      
 259 
     | 
    
         
            +
                  
         
     | 
| 
      
 260 
     | 
    
         
            +
                  
         
     | 
| 
      
 261 
     | 
    
         
            +
                    —
         
     | 
| 
      
 262 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 263 
     | 
    
         
            +
            An Exception to print.
         
     | 
| 
      
 264 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 265 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 266 
     | 
    
         
            +
                  
         
     | 
| 
      
 267 
     | 
    
         
            +
                </li>
         
     | 
| 
      
 268 
     | 
    
         
            +
              
         
     | 
| 
      
 269 
     | 
    
         
            +
            </ul>
         
     | 
| 
      
 270 
     | 
    
         
            +
             
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
      
 272 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
      
 273 
     | 
    
         
            +
              <tr>
         
     | 
| 
      
 274 
     | 
    
         
            +
                <td>
         
     | 
| 
      
 275 
     | 
    
         
            +
                  <pre class="lines">
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
             
     | 
| 
      
 278 
     | 
    
         
            +
            7
         
     | 
| 
      
 279 
     | 
    
         
            +
            8
         
     | 
| 
      
 280 
     | 
    
         
            +
            9</pre>
         
     | 
| 
      
 281 
     | 
    
         
            +
                </td>
         
     | 
| 
      
 282 
     | 
    
         
            +
                <td>
         
     | 
| 
      
 283 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 7</span>
         
     | 
| 
      
 284 
     | 
    
         
            +
             
     | 
| 
      
 285 
     | 
    
         
            +
            <span class='kw'>def</span> <span class='id error_report'>error_report</span><span class='lparen'>(</span><span class='id e'>e</span><span class='rparen'>)</span>
         
     | 
| 
      
 286 
     | 
    
         
            +
            	<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='period'>.</span><span class='id inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='period'>.</span><span class='id backtrace'>backtrace</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n\t</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
         
     | 
| 
      
 287 
     | 
    
         
            +
            <span class='kw'>end</span></pre>
         
     | 
| 
      
 288 
     | 
    
         
            +
                </td>
         
     | 
| 
      
 289 
     | 
    
         
            +
              </tr>
         
     | 
| 
      
 290 
     | 
    
         
            +
            </table>
         
     | 
| 
      
 291 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 292 
     | 
    
         
            +
                
         
     | 
| 
      
 293 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 294 
     | 
    
         
            +
             
     | 
| 
       193 
295 
     | 
    
         
             
            </div>
         
     | 
| 
       194 
296 
     | 
    
         | 
| 
       195 
297 
     | 
    
         
             
                <div id="footer">
         
     | 
| 
       196 
     | 
    
         
            -
              Generated on  
     | 
| 
      
 298 
     | 
    
         
            +
              Generated on Tue Nov 29 11:44:04 2011 by 
         
     | 
| 
       197 
299 
     | 
    
         
             
              <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
         
     | 
| 
       198 
300 
     | 
    
         
             
              0.7.3 (ruby-1.9.2).
         
     | 
| 
       199 
301 
     | 
    
         
             
            </div>
         
     | 
    
        data/doc/Safubot/Bot.html
    CHANGED
    
    | 
         @@ -98,7 +98,20 @@ 
     | 
|
| 
       98 
98 
     | 
    
         
             
            </dl>
         
     | 
| 
       99 
99 
     | 
    
         
             
            <div class="clear"></div>
         
     | 
| 
       100 
100 
     | 
    
         | 
| 
      
 101 
     | 
    
         
            +
            <h2>Overview</h2><div class="docstring">
         
     | 
| 
      
 102 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 103 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 104 
     | 
    
         
            +
            The main event-processing class. You are encouraged to inherit from this
         
     | 
| 
      
 105 
     | 
    
         
            +
            class when building your own bot, but delegation is also entirely feasible.
         
     | 
| 
      
 106 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 110 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 111 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 112 
     | 
    
         
            +
              
         
     | 
| 
       101 
113 
     | 
    
         | 
| 
      
 114 
     | 
    
         
            +
            </div>
         
     | 
| 
       102 
115 
     | 
    
         | 
| 
       103 
116 
     | 
    
         | 
| 
       104 
117 
     | 
    
         | 
| 
         @@ -245,7 +258,7 @@ A generic “respond immediately” interface. 
     | 
|
| 
       245 
258 
     | 
    
         | 
| 
       246 
259 
     | 
    
         | 
| 
       247 
260 
     | 
    
         
             
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
       248 
     | 
    
         
            -
            Wraps  
     | 
| 
      
 261 
     | 
    
         
            +
            Wraps Thread.new with error handling and response pushing for the given
         
     | 
| 
       249 
262 
     | 
    
         
             
            request.
         
     | 
| 
       250 
263 
     | 
    
         
             
            </p>
         
     | 
| 
       251 
264 
     | 
    
         
             
            </div></span>
         
     | 
| 
         @@ -256,7 +269,7 @@ request. 
     | 
|
| 
       256 
269 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       257 
270 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       258 
271 
     | 
    
         | 
| 
       259 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 272 
     | 
    
         
            +
                  <a href="#dispatch-instance_method" title="#dispatch (instance method)">- (Object) <strong>dispatch</strong>(resp) </a>
         
     | 
| 
       260 
273 
     | 
    
         | 
| 
       261 
274 
     | 
    
         | 
| 
       262 
275 
     | 
    
         | 
| 
         @@ -269,7 +282,10 @@ request. 
     | 
|
| 
       269 
282 
     | 
    
         | 
| 
       270 
283 
     | 
    
         | 
| 
       271 
284 
     | 
    
         | 
| 
       272 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 285 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 286 
     | 
    
         
            +
            Performs appropriate dispatch operation for response type.
         
     | 
| 
      
 287 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 288 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       273 
289 
     | 
    
         | 
| 
       274 
290 
     | 
    
         
             
            </li>
         
     | 
| 
       275 
291 
     | 
    
         | 
| 
         @@ -277,7 +293,7 @@ request. 
     | 
|
| 
       277 
293 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       278 
294 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       279 
295 
     | 
    
         | 
| 
       280 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 296 
     | 
    
         
            +
                  <a href="#enable_twitter-instance_method" title="#enable_twitter (instance method)">- (Object) <strong>enable_twitter</strong>(opts = {}) </a>
         
     | 
| 
       281 
297 
     | 
    
         | 
| 
       282 
298 
     | 
    
         | 
| 
       283 
299 
     | 
    
         | 
| 
         @@ -290,7 +306,10 @@ request. 
     | 
|
| 
       290 
306 
     | 
    
         | 
| 
       291 
307 
     | 
    
         | 
| 
       292 
308 
     | 
    
         | 
| 
       293 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 309 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 310 
     | 
    
         
            +
            Initialises Twitter-related functionality.
         
     | 
| 
      
 311 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 312 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       294 
313 
     | 
    
         | 
| 
       295 
314 
     | 
    
         
             
            </li>
         
     | 
| 
       296 
315 
     | 
    
         | 
| 
         @@ -298,7 +317,7 @@ request. 
     | 
|
| 
       298 
317 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       299 
318 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       300 
319 
     | 
    
         | 
| 
       301 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 320 
     | 
    
         
            +
                  <a href="#enable_xmpp-instance_method" title="#enable_xmpp (instance method)">- (Object) <strong>enable_xmpp</strong>(options = {}) </a>
         
     | 
| 
       302 
321 
     | 
    
         | 
| 
       303 
322 
     | 
    
         | 
| 
       304 
323 
     | 
    
         | 
| 
         @@ -311,7 +330,10 @@ request. 
     | 
|
| 
       311 
330 
     | 
    
         | 
| 
       312 
331 
     | 
    
         | 
| 
       313 
332 
     | 
    
         | 
| 
       314 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 333 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 334 
     | 
    
         
            +
            Initialises XMPP-related functionality.
         
     | 
| 
      
 335 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 336 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       315 
337 
     | 
    
         | 
| 
       316 
338 
     | 
    
         
             
            </li>
         
     | 
| 
       317 
339 
     | 
    
         | 
| 
         @@ -319,12 +341,14 @@ request. 
     | 
|
| 
       319 
341 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       320 
342 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       321 
343 
     | 
    
         | 
| 
       322 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 344 
     | 
    
         
            +
                  <a href="#initialize-instance_method" title="#initialize (instance method)">- (Bot) <strong>initialize</strong>(options = {}) </a>
         
     | 
| 
       323 
345 
     | 
    
         | 
| 
       324 
346 
     | 
    
         | 
| 
       325 
347 
     | 
    
         | 
| 
       326 
348 
     | 
    
         
             
              </span>
         
     | 
| 
       327 
349 
     | 
    
         | 
| 
      
 350 
     | 
    
         
            +
                <span class="note title constructor">constructor</span>
         
     | 
| 
      
 351 
     | 
    
         
            +
              
         
     | 
| 
       328 
352 
     | 
    
         | 
| 
       329 
353 
     | 
    
         | 
| 
       330 
354 
     | 
    
         | 
| 
         @@ -332,7 +356,10 @@ request. 
     | 
|
| 
       332 
356 
     | 
    
         | 
| 
       333 
357 
     | 
    
         | 
| 
       334 
358 
     | 
    
         | 
| 
       335 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 359 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 360 
     | 
    
         
            +
            A new instance of Bot.
         
     | 
| 
      
 361 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 362 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       336 
363 
     | 
    
         | 
| 
       337 
364 
     | 
    
         
             
            </li>
         
     | 
| 
       338 
365 
     | 
    
         | 
| 
         @@ -340,14 +367,12 @@ request. 
     | 
|
| 
       340 
367 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       341 
368 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       342 
369 
     | 
    
         | 
| 
       343 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 370 
     | 
    
         
            +
                  <a href="#process-instance_method" title="#process (instance method)">- (Object) <strong>process</strong> </a>
         
     | 
| 
       344 
371 
     | 
    
         | 
| 
       345 
372 
     | 
    
         | 
| 
       346 
373 
     | 
    
         | 
| 
       347 
374 
     | 
    
         
             
              </span>
         
     | 
| 
       348 
375 
     | 
    
         | 
| 
       349 
     | 
    
         
            -
                <span class="note title constructor">constructor</span>
         
     | 
| 
       350 
     | 
    
         
            -
              
         
     | 
| 
       351 
376 
     | 
    
         | 
| 
       352 
377 
     | 
    
         | 
| 
       353 
378 
     | 
    
         | 
| 
         @@ -356,7 +381,7 @@ request. 
     | 
|
| 
       356 
381 
     | 
    
         | 
| 
       357 
382 
     | 
    
         | 
| 
       358 
383 
     | 
    
         
             
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
       359 
     | 
    
         
            -
             
     | 
| 
      
 384 
     | 
    
         
            +
            Goes through each unprocessed Request and submits it for processing.
         
     | 
| 
       360 
385 
     | 
    
         
             
            </p>
         
     | 
| 
       361 
386 
     | 
    
         
             
            </div></span>
         
     | 
| 
       362 
387 
     | 
    
         | 
| 
         @@ -366,7 +391,7 @@ A new instance of Bot. 
     | 
|
| 
       366 
391 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       367 
392 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       368 
393 
     | 
    
         | 
| 
       369 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 394 
     | 
    
         
            +
                  <a href="#process_request-instance_method" title="#process_request (instance method)">- (Object) <strong>process_request</strong>(req) </a>
         
     | 
| 
       370 
395 
     | 
    
         | 
| 
       371 
396 
     | 
    
         | 
| 
       372 
397 
     | 
    
         | 
| 
         @@ -379,7 +404,10 @@ A new instance of Bot. 
     | 
|
| 
       379 
404 
     | 
    
         | 
| 
       380 
405 
     | 
    
         | 
| 
       381 
406 
     | 
    
         | 
| 
       382 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 407 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 408 
     | 
    
         
            +
            Processes an individual request (synchronously).
         
     | 
| 
      
 409 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 410 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       383 
411 
     | 
    
         | 
| 
       384 
412 
     | 
    
         
             
            </li>
         
     | 
| 
       385 
413 
     | 
    
         | 
| 
         @@ -387,7 +415,7 @@ A new instance of Bot. 
     | 
|
| 
       387 
415 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       388 
416 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       389 
417 
     | 
    
         | 
| 
       390 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 418 
     | 
    
         
            +
                  <a href="#pull-instance_method" title="#pull (instance method)">- (Object) <strong>pull</strong> </a>
         
     | 
| 
       391 
419 
     | 
    
         | 
| 
       392 
420 
     | 
    
         | 
| 
       393 
421 
     | 
    
         | 
| 
         @@ -400,7 +428,11 @@ A new instance of Bot. 
     | 
|
| 
       400 
428 
     | 
    
         | 
| 
       401 
429 
     | 
    
         | 
| 
       402 
430 
     | 
    
         | 
| 
       403 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 431 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 432 
     | 
    
         
            +
            This pulls requests from passive non-streaming sources (currently, the
         
     | 
| 
      
 433 
     | 
    
         
            +
            Twitter AJAX API).
         
     | 
| 
      
 434 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 435 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       404 
436 
     | 
    
         | 
| 
       405 
437 
     | 
    
         
             
            </li>
         
     | 
| 
       406 
438 
     | 
    
         | 
| 
         @@ -408,7 +440,7 @@ A new instance of Bot. 
     | 
|
| 
       408 
440 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       409 
441 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       410 
442 
     | 
    
         | 
| 
       411 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 443 
     | 
    
         
            +
                  <a href="#push-instance_method" title="#push (instance method)">- (Object) <strong>push</strong> </a>
         
     | 
| 
       412 
444 
     | 
    
         | 
| 
       413 
445 
     | 
    
         | 
| 
       414 
446 
     | 
    
         | 
| 
         @@ -421,7 +453,10 @@ A new instance of Bot. 
     | 
|
| 
       421 
453 
     | 
    
         | 
| 
       422 
454 
     | 
    
         | 
| 
       423 
455 
     | 
    
         | 
| 
       424 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 456 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 457 
     | 
    
         
            +
            Dispatches all undispatched Responses.
         
     | 
| 
      
 458 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 459 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       425 
460 
     | 
    
         | 
| 
       426 
461 
     | 
    
         
             
            </li>
         
     | 
| 
       427 
462 
     | 
    
         | 
| 
         @@ -429,7 +464,7 @@ A new instance of Bot. 
     | 
|
| 
       429 
464 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       430 
465 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       431 
466 
     | 
    
         | 
| 
       432 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 467 
     | 
    
         
            +
                  <a href="#request_error-instance_method" title="#request_error (instance method)">- (Object) <strong>request_error</strong>(req, e) </a>
         
     | 
| 
       433 
468 
     | 
    
         | 
| 
       434 
469 
     | 
    
         | 
| 
       435 
470 
     | 
    
         | 
| 
         @@ -442,7 +477,10 @@ A new instance of Bot. 
     | 
|
| 
       442 
477 
     | 
    
         | 
| 
       443 
478 
     | 
    
         | 
| 
       444 
479 
     | 
    
         | 
| 
       445 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 480 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 481 
     | 
    
         
            +
            Records an error and emits a corresponding :request_error event.
         
     | 
| 
      
 482 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 483 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       446 
484 
     | 
    
         | 
| 
       447 
485 
     | 
    
         
             
            </li>
         
     | 
| 
       448 
486 
     | 
    
         | 
| 
         @@ -450,7 +488,7 @@ A new instance of Bot. 
     | 
|
| 
       450 
488 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       451 
489 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       452 
490 
     | 
    
         | 
| 
       453 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 491 
     | 
    
         
            +
                  <a href="#respond-instance_method" title="#respond (instance method)">- (Object) <strong>respond</strong>(req, text) </a>
         
     | 
| 
       454 
492 
     | 
    
         | 
| 
       455 
493 
     | 
    
         | 
| 
       456 
494 
     | 
    
         | 
| 
         @@ -463,7 +501,10 @@ A new instance of Bot. 
     | 
|
| 
       463 
501 
     | 
    
         | 
| 
       464 
502 
     | 
    
         | 
| 
       465 
503 
     | 
    
         | 
| 
       466 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 504 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 505 
     | 
    
         
            +
            Adds a response to the queue.
         
     | 
| 
      
 506 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 507 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       467 
508 
     | 
    
         | 
| 
       468 
509 
     | 
    
         
             
            </li>
         
     | 
| 
       469 
510 
     | 
    
         | 
| 
         @@ -471,7 +512,7 @@ A new instance of Bot. 
     | 
|
| 
       471 
512 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       472 
513 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       473 
514 
     | 
    
         | 
| 
       474 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 515 
     | 
    
         
            +
                  <a href="#respond_now-instance_method" title="#respond_now (instance method)">- (Object) <strong>respond_now</strong>(req, text) </a>
         
     | 
| 
       475 
516 
     | 
    
         | 
| 
       476 
517 
     | 
    
         | 
| 
       477 
518 
     | 
    
         | 
| 
         @@ -485,7 +526,7 @@ A new instance of Bot. 
     | 
|
| 
       485 
526 
     | 
    
         | 
| 
       486 
527 
     | 
    
         | 
| 
       487 
528 
     | 
    
         
             
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
       488 
     | 
    
         
            -
             
     | 
| 
      
 529 
     | 
    
         
            +
            Respond + push.
         
     | 
| 
       489 
530 
     | 
    
         
             
            </p>
         
     | 
| 
       490 
531 
     | 
    
         
             
            </div></span>
         
     | 
| 
       491 
532 
     | 
    
         | 
| 
         @@ -495,7 +536,7 @@ Adds a response to the queue. 
     | 
|
| 
       495 
536 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       496 
537 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       497 
538 
     | 
    
         | 
| 
       498 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 539 
     | 
    
         
            +
                  <a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
         
     | 
| 
       499 
540 
     | 
    
         | 
| 
       500 
541 
     | 
    
         | 
| 
       501 
542 
     | 
    
         | 
| 
         @@ -509,7 +550,7 @@ Adds a response to the queue. 
     | 
|
| 
       509 
550 
     | 
    
         | 
| 
       510 
551 
     | 
    
         | 
| 
       511 
552 
     | 
    
         
             
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
       512 
     | 
    
         
            -
             
     | 
| 
      
 553 
     | 
    
         
            +
            Calls run_nowait and then waits for all child processes.
         
     | 
| 
       513 
554 
     | 
    
         
             
            </p>
         
     | 
| 
       514 
555 
     | 
    
         
             
            </div></span>
         
     | 
| 
       515 
556 
     | 
    
         | 
| 
         @@ -519,7 +560,7 @@ Respond + push. 
     | 
|
| 
       519 
560 
     | 
    
         
             
                    <li class="public ">
         
     | 
| 
       520 
561 
     | 
    
         
             
              <span class="summary_signature">
         
     | 
| 
       521 
562 
     | 
    
         | 
| 
       522 
     | 
    
         
            -
                  <a href="# 
     | 
| 
      
 563 
     | 
    
         
            +
                  <a href="#run_nowait-instance_method" title="#run_nowait (instance method)">- (Object) <strong>run_nowait</strong> </a>
         
     | 
| 
       523 
564 
     | 
    
         | 
| 
       524 
565 
     | 
    
         | 
| 
       525 
566 
     | 
    
         | 
| 
         @@ -532,7 +573,11 @@ Respond + push. 
     | 
|
| 
       532 
573 
     | 
    
         | 
| 
       533 
574 
     | 
    
         | 
| 
       534 
575 
     | 
    
         | 
| 
       535 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 576 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 577 
     | 
    
         
            +
            Runs an initial request-processing loop and then forks the streaming
         
     | 
| 
      
 578 
     | 
    
         
            +
            processes.
         
     | 
| 
      
 579 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 580 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       536 
581 
     | 
    
         | 
| 
       537 
582 
     | 
    
         
             
            </li>
         
     | 
| 
       538 
583 
     | 
    
         | 
| 
         @@ -553,7 +598,10 @@ Respond + push. 
     | 
|
| 
       553 
598 
     | 
    
         | 
| 
       554 
599 
     | 
    
         | 
| 
       555 
600 
     | 
    
         | 
| 
       556 
     | 
    
         
            -
                <span class="summary_desc"><div class='inline' 
     | 
| 
      
 601 
     | 
    
         
            +
                <span class="summary_desc"><div class='inline'><p>
         
     | 
| 
      
 602 
     | 
    
         
            +
            Shuts down the streaming processes.
         
     | 
| 
      
 603 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 604 
     | 
    
         
            +
            </div></span>
         
     | 
| 
       557 
605 
     | 
    
         | 
| 
       558 
606 
     | 
    
         
             
            </li>
         
     | 
| 
       559 
607 
     | 
    
         | 
| 
         @@ -599,16 +647,16 @@ A new instance of Bot 
     | 
|
| 
       599 
647 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       600 
648 
     | 
    
         | 
| 
       601 
649 
     | 
    
         | 
| 
       602 
     | 
    
         
            -
             
     | 
| 
       603 
     | 
    
         
            -
             
     | 
| 
       604 
     | 
    
         
            -
             
     | 
| 
       605 
     | 
    
         
            -
             
     | 
| 
       606 
     | 
    
         
            -
             
     | 
| 
       607 
     | 
    
         
            -
             
     | 
| 
       608 
     | 
    
         
            -
             
     | 
| 
      
 650 
     | 
    
         
            +
            190
         
     | 
| 
      
 651 
     | 
    
         
            +
            191
         
     | 
| 
      
 652 
     | 
    
         
            +
            192
         
     | 
| 
      
 653 
     | 
    
         
            +
            193
         
     | 
| 
      
 654 
     | 
    
         
            +
            194
         
     | 
| 
      
 655 
     | 
    
         
            +
            195
         
     | 
| 
      
 656 
     | 
    
         
            +
            196</pre>
         
     | 
| 
       609 
657 
     | 
    
         
             
                </td>
         
     | 
| 
       610 
658 
     | 
    
         
             
                <td>
         
     | 
| 
       611 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 659 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 190</span>
         
     | 
| 
       612 
660 
     | 
    
         | 
| 
       613 
661 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
         
     | 
| 
       614 
662 
     | 
    
         
             
              <span class='id defaults'>defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:database</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>safubot</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
         
     | 
| 
         @@ -655,12 +703,12 @@ Returns the value of attribute opts 
     | 
|
| 
       655 
703 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       656 
704 
     | 
    
         | 
| 
       657 
705 
     | 
    
         | 
| 
       658 
     | 
    
         
            -
             
     | 
| 
       659 
     | 
    
         
            -
             
     | 
| 
       660 
     | 
    
         
            -
             
     | 
| 
      
 706 
     | 
    
         
            +
            47
         
     | 
| 
      
 707 
     | 
    
         
            +
            48
         
     | 
| 
      
 708 
     | 
    
         
            +
            49</pre>
         
     | 
| 
       661 
709 
     | 
    
         
             
                </td>
         
     | 
| 
       662 
710 
     | 
    
         
             
                <td>
         
     | 
| 
       663 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 711 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 47</span>
         
     | 
| 
       664 
712 
     | 
    
         | 
| 
       665 
713 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id opts'>opts</span>
         
     | 
| 
       666 
714 
     | 
    
         
             
              <span class='ivar'>@opts</span>
         
     | 
| 
         @@ -698,12 +746,12 @@ Returns the value of attribute twitter 
     | 
|
| 
       698 
746 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       699 
747 
     | 
    
         | 
| 
       700 
748 
     | 
    
         | 
| 
       701 
     | 
    
         
            -
             
     | 
| 
       702 
     | 
    
         
            -
             
     | 
| 
       703 
     | 
    
         
            -
             
     | 
| 
      
 749 
     | 
    
         
            +
            47
         
     | 
| 
      
 750 
     | 
    
         
            +
            48
         
     | 
| 
      
 751 
     | 
    
         
            +
            49</pre>
         
     | 
| 
       704 
752 
     | 
    
         
             
                </td>
         
     | 
| 
       705 
753 
     | 
    
         
             
                <td>
         
     | 
| 
       706 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 754 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 47</span>
         
     | 
| 
       707 
755 
     | 
    
         | 
| 
       708 
756 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id twitter'>twitter</span>
         
     | 
| 
       709 
757 
     | 
    
         
             
              <span class='ivar'>@twitter</span>
         
     | 
| 
         @@ -741,12 +789,12 @@ Returns the value of attribute xmpp 
     | 
|
| 
       741 
789 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       742 
790 
     | 
    
         | 
| 
       743 
791 
     | 
    
         | 
| 
       744 
     | 
    
         
            -
             
     | 
| 
       745 
     | 
    
         
            -
             
     | 
| 
       746 
     | 
    
         
            -
             
     | 
| 
      
 792 
     | 
    
         
            +
            47
         
     | 
| 
      
 793 
     | 
    
         
            +
            48
         
     | 
| 
      
 794 
     | 
    
         
            +
            49</pre>
         
     | 
| 
       747 
795 
     | 
    
         
             
                </td>
         
     | 
| 
       748 
796 
     | 
    
         
             
                <td>
         
     | 
| 
       749 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 797 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 47</span>
         
     | 
| 
       750 
798 
     | 
    
         | 
| 
       751 
799 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id xmpp'>xmpp</span>
         
     | 
| 
       752 
800 
     | 
    
         
             
              <span class='ivar'>@xmpp</span>
         
     | 
| 
         @@ -780,7 +828,48 @@ A generic “respond immediately” interface. 
     | 
|
| 
       780 
828 
     | 
    
         
             
              </div>
         
     | 
| 
       781 
829 
     | 
    
         
             
            </div>
         
     | 
| 
       782 
830 
     | 
    
         
             
            <div class="tags">
         
     | 
| 
      
 831 
     | 
    
         
            +
              <h3>Parameters:</h3>
         
     | 
| 
      
 832 
     | 
    
         
            +
            <ul class="param">
         
     | 
| 
      
 833 
     | 
    
         
            +
              
         
     | 
| 
      
 834 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 835 
     | 
    
         
            +
                  
         
     | 
| 
      
 836 
     | 
    
         
            +
                    <span class='name'>text</span>
         
     | 
| 
      
 837 
     | 
    
         
            +
                  
         
     | 
| 
      
 838 
     | 
    
         
            +
                  
         
     | 
| 
      
 839 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 840 
     | 
    
         
            +
                  
         
     | 
| 
      
 841 
     | 
    
         
            +
                  
         
     | 
| 
      
 842 
     | 
    
         
            +
                  
         
     | 
| 
      
 843 
     | 
    
         
            +
                    —
         
     | 
| 
      
 844 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 845 
     | 
    
         
            +
            The body of a Request to process.
         
     | 
| 
      
 846 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 847 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 848 
     | 
    
         
            +
                  
         
     | 
| 
      
 849 
     | 
    
         
            +
                </li>
         
     | 
| 
      
 850 
     | 
    
         
            +
              
         
     | 
| 
      
 851 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 852 
     | 
    
         
            +
                  
         
     | 
| 
      
 853 
     | 
    
         
            +
                    <span class='name'>user</span>
         
     | 
| 
      
 854 
     | 
    
         
            +
                  
         
     | 
| 
      
 855 
     | 
    
         
            +
                  
         
     | 
| 
      
 856 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 857 
     | 
    
         
            +
                  
         
     | 
| 
      
 858 
     | 
    
         
            +
                  
         
     | 
| 
      
 859 
     | 
    
         
            +
                    <em class="default">(defaults to: <tt>nil</tt>)</em>
         
     | 
| 
      
 860 
     | 
    
         
            +
                  
         
     | 
| 
      
 861 
     | 
    
         
            +
                  
         
     | 
| 
      
 862 
     | 
    
         
            +
                    —
         
     | 
| 
      
 863 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 864 
     | 
    
         
            +
            The user sending the request. Defaults to
         
     | 
| 
      
 865 
     | 
    
         
            +
            KnownUser.by_name(‘testing’)
         
     | 
| 
      
 866 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 867 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 868 
     | 
    
         
            +
                  
         
     | 
| 
      
 869 
     | 
    
         
            +
                </li>
         
     | 
| 
       783 
870 
     | 
    
         | 
| 
      
 871 
     | 
    
         
            +
            </ul>
         
     | 
| 
      
 872 
     | 
    
         
            +
             
     | 
| 
       784 
873 
     | 
    
         | 
| 
       785 
874 
     | 
    
         
             
            </div><table class="source_code">
         
     | 
| 
       786 
875 
     | 
    
         
             
              <tr>
         
     | 
| 
         @@ -788,16 +877,16 @@ A generic “respond immediately” interface. 
     | 
|
| 
       788 
877 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       789 
878 
     | 
    
         | 
| 
       790 
879 
     | 
    
         | 
| 
       791 
     | 
    
         
            -
             
     | 
| 
       792 
     | 
    
         
            -
             
     | 
| 
       793 
     | 
    
         
            -
             
     | 
| 
       794 
     | 
    
         
            -
             
     | 
| 
       795 
     | 
    
         
            -
             
     | 
| 
       796 
     | 
    
         
            -
             
     | 
| 
       797 
     | 
    
         
            -
             
     | 
| 
      
 880 
     | 
    
         
            +
            61
         
     | 
| 
      
 881 
     | 
    
         
            +
            62
         
     | 
| 
      
 882 
     | 
    
         
            +
            63
         
     | 
| 
      
 883 
     | 
    
         
            +
            64
         
     | 
| 
      
 884 
     | 
    
         
            +
            65
         
     | 
| 
      
 885 
     | 
    
         
            +
            66
         
     | 
| 
      
 886 
     | 
    
         
            +
            67</pre>
         
     | 
| 
       798 
887 
     | 
    
         
             
                </td>
         
     | 
| 
       799 
888 
     | 
    
         
             
                <td>
         
     | 
| 
       800 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/test_helper.rb', line  
     | 
| 
      
 889 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/test_helper.rb', line 61</span>
         
     | 
| 
       801 
890 
     | 
    
         | 
| 
       802 
891 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id answer'>answer</span><span class='lparen'>(</span><span class='id text'>text</span><span class='comma'>,</span> <span class='id user'>user</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
         
     | 
| 
       803 
892 
     | 
    
         
             
              <span class='id user'>user</span> <span class='op'>||=</span> <span class='const'>KnownUser</span><span class='period'>.</span><span class='id by_name'>by_name</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>testing</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
         
     | 
| 
         @@ -821,7 +910,7 @@ A generic “respond immediately” interface. 
     | 
|
| 
       821 
910 
     | 
    
         
             
            </p><div class="docstring">
         
     | 
| 
       822 
911 
     | 
    
         
             
              <div class="discussion">
         
     | 
| 
       823 
912 
     | 
    
         
             
                <p>
         
     | 
| 
       824 
     | 
    
         
            -
            Wraps  
     | 
| 
      
 913 
     | 
    
         
            +
            Wraps Thread.new with error handling and response pushing for the given
         
     | 
| 
       825 
914 
     | 
    
         
             
            request.
         
     | 
| 
       826 
915 
     | 
    
         
             
            </p>
         
     | 
| 
       827 
916 
     | 
    
         | 
| 
         @@ -875,23 +964,23 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       875 
964 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       876 
965 
     | 
    
         | 
| 
       877 
966 
     | 
    
         | 
| 
       878 
     | 
    
         
            -
             
     | 
| 
       879 
     | 
    
         
            -
             
     | 
| 
       880 
     | 
    
         
            -
             
     | 
| 
       881 
     | 
    
         
            -
             
     | 
| 
       882 
     | 
    
         
            -
             
     | 
| 
       883 
     | 
    
         
            -
             
     | 
| 
       884 
     | 
    
         
            -
             
     | 
| 
       885 
     | 
    
         
            -
             
     | 
| 
       886 
     | 
    
         
            -
             
     | 
| 
       887 
     | 
    
         
            -
             
     | 
| 
       888 
     | 
    
         
            -
             
     | 
| 
      
 967 
     | 
    
         
            +
            138
         
     | 
| 
      
 968 
     | 
    
         
            +
            139
         
     | 
| 
      
 969 
     | 
    
         
            +
            140
         
     | 
| 
      
 970 
     | 
    
         
            +
            141
         
     | 
| 
      
 971 
     | 
    
         
            +
            142
         
     | 
| 
      
 972 
     | 
    
         
            +
            143
         
     | 
| 
      
 973 
     | 
    
         
            +
            144
         
     | 
| 
      
 974 
     | 
    
         
            +
            145
         
     | 
| 
      
 975 
     | 
    
         
            +
            146
         
     | 
| 
      
 976 
     | 
    
         
            +
            147
         
     | 
| 
      
 977 
     | 
    
         
            +
            148</pre>
         
     | 
| 
       889 
978 
     | 
    
         
             
                </td>
         
     | 
| 
       890 
979 
     | 
    
         
             
                <td>
         
     | 
| 
       891 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 980 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 138</span>
         
     | 
| 
       892 
981 
     | 
    
         | 
| 
       893 
982 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id concurrently'>concurrently</span><span class='lparen'>(</span><span class='id req'>req</span><span class='comma'>,</span> <span class='op'>&</span><span class='id blk'>blk</span><span class='rparen'>)</span>
         
     | 
| 
       894 
     | 
    
         
            -
              <span class='const'> 
     | 
| 
      
 983 
     | 
    
         
            +
              <span class='const'>Thread</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
         
     | 
| 
       895 
984 
     | 
    
         
             
            	<span class='kw'>begin</span>
         
     | 
| 
       896 
985 
     | 
    
         
             
            	  <span class='id blk'>blk</span><span class='period'>.</span><span class='id call'>call</span>
         
     | 
| 
       897 
986 
     | 
    
         
             
            	<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=></span> <span class='id e'>e</span>
         
     | 
| 
         @@ -907,78 +996,81 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       907 
996 
     | 
    
         
             
            </div>
         
     | 
| 
       908 
997 
     | 
    
         | 
| 
       909 
998 
     | 
    
         
             
                  <div class="method_details ">
         
     | 
| 
       910 
     | 
    
         
            -
              <p class="signature " id=" 
     | 
| 
      
 999 
     | 
    
         
            +
              <p class="signature " id="dispatch-instance_method">
         
     | 
| 
       911 
1000 
     | 
    
         | 
| 
       912 
     | 
    
         
            -
                - (<tt>Object</tt>) <strong> 
     | 
| 
      
 1001 
     | 
    
         
            +
                - (<tt>Object</tt>) <strong>dispatch</strong>(resp) 
         
     | 
| 
       913 
1002 
     | 
    
         | 
| 
       914 
1003 
     | 
    
         | 
| 
       915 
1004 
     | 
    
         | 
| 
       916 
     | 
    
         
            -
            </p>< 
     | 
| 
       917 
     | 
    
         
            -
              < 
     | 
| 
       918 
     | 
    
         
            -
                < 
     | 
| 
       919 
     | 
    
         
            -
             
     | 
| 
       920 
     | 
    
         
            -
             
     | 
| 
      
 1005 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1006 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1007 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1008 
     | 
    
         
            +
            Performs appropriate dispatch operation for response type.
         
     | 
| 
      
 1009 
     | 
    
         
            +
            </p>
         
     | 
| 
       921 
1010 
     | 
    
         | 
| 
       922 
     | 
    
         
            -
            112
         
     | 
| 
       923 
     | 
    
         
            -
            113
         
     | 
| 
       924 
     | 
    
         
            -
            114</pre>
         
     | 
| 
       925 
     | 
    
         
            -
                </td>
         
     | 
| 
       926 
     | 
    
         
            -
                <td>
         
     | 
| 
       927 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 112</span>
         
     | 
| 
       928 
1011 
     | 
    
         | 
| 
       929 
     | 
    
         
            -
             
     | 
| 
       930 
     | 
    
         
            -
              <span class='id pull'>pull</span><span class='semicolon'>;</span> <span class='id process'>process</span><span class='semicolon'>;</span> <span class='id push'>push</span>
         
     | 
| 
       931 
     | 
    
         
            -
            <span class='kw'>end</span></pre>
         
     | 
| 
       932 
     | 
    
         
            -
                </td>
         
     | 
| 
       933 
     | 
    
         
            -
              </tr>
         
     | 
| 
       934 
     | 
    
         
            -
            </table>
         
     | 
| 
      
 1012 
     | 
    
         
            +
              </div>
         
     | 
| 
       935 
1013 
     | 
    
         
             
            </div>
         
     | 
| 
       936 
     | 
    
         
            -
             
     | 
| 
       937 
     | 
    
         
            -
             
     | 
| 
       938 
     | 
    
         
            -
             
     | 
| 
      
 1014 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1015 
     | 
    
         
            +
              <h3>Parameters:</h3>
         
     | 
| 
      
 1016 
     | 
    
         
            +
            <ul class="param">
         
     | 
| 
       939 
1017 
     | 
    
         | 
| 
       940 
     | 
    
         
            -
                 
     | 
| 
      
 1018 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 1019 
     | 
    
         
            +
                  
         
     | 
| 
      
 1020 
     | 
    
         
            +
                    <span class='name'>resp</span>
         
     | 
| 
      
 1021 
     | 
    
         
            +
                  
         
     | 
| 
      
 1022 
     | 
    
         
            +
                  
         
     | 
| 
      
 1023 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 1024 
     | 
    
         
            +
                  
         
     | 
| 
      
 1025 
     | 
    
         
            +
                  
         
     | 
| 
      
 1026 
     | 
    
         
            +
                  
         
     | 
| 
      
 1027 
     | 
    
         
            +
                    —
         
     | 
| 
      
 1028 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 1029 
     | 
    
         
            +
            An undispatched Response.
         
     | 
| 
      
 1030 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1031 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1032 
     | 
    
         
            +
                  
         
     | 
| 
      
 1033 
     | 
    
         
            +
                </li>
         
     | 
| 
       941 
1034 
     | 
    
         | 
| 
      
 1035 
     | 
    
         
            +
            </ul>
         
     | 
| 
       942 
1036 
     | 
    
         | 
| 
       943 
     | 
    
         
            -
             
     | 
| 
       944 
     | 
    
         
            -
            </ 
     | 
| 
      
 1037 
     | 
    
         
            +
             
     | 
| 
      
 1038 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       945 
1039 
     | 
    
         
             
              <tr>
         
     | 
| 
       946 
1040 
     | 
    
         
             
                <td>
         
     | 
| 
       947 
1041 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       948 
1042 
     | 
    
         | 
| 
       949 
1043 
     | 
    
         | 
| 
       950 
     | 
    
         
            -
            58
         
     | 
| 
       951 
     | 
    
         
            -
            59
         
     | 
| 
       952 
     | 
    
         
            -
            60
         
     | 
| 
       953 
     | 
    
         
            -
            61
         
     | 
| 
       954 
     | 
    
         
            -
            62
         
     | 
| 
       955 
     | 
    
         
            -
            63
         
     | 
| 
       956 
     | 
    
         
            -
            64
         
     | 
| 
       957 
     | 
    
         
            -
            65
         
     | 
| 
       958 
     | 
    
         
            -
            66
         
     | 
| 
       959 
     | 
    
         
            -
            67
         
     | 
| 
       960 
     | 
    
         
            -
            68
         
     | 
| 
       961 
     | 
    
         
            -
            69
         
     | 
| 
       962 
     | 
    
         
            -
            70
         
     | 
| 
       963 
     | 
    
         
            -
            71
         
     | 
| 
       964 
     | 
    
         
            -
            72
         
     | 
| 
       965 
     | 
    
         
            -
            73
         
     | 
| 
       966 
     | 
    
         
            -
            74
         
     | 
| 
       967 
     | 
    
         
            -
            75
         
     | 
| 
       968 
     | 
    
         
            -
            76
         
     | 
| 
       969 
1044 
     | 
    
         
             
            77
         
     | 
| 
       970 
1045 
     | 
    
         
             
            78
         
     | 
| 
       971 
1046 
     | 
    
         
             
            79
         
     | 
| 
       972 
1047 
     | 
    
         
             
            80
         
     | 
| 
       973 
1048 
     | 
    
         
             
            81
         
     | 
| 
       974 
     | 
    
         
            -
            82 
     | 
| 
      
 1049 
     | 
    
         
            +
            82
         
     | 
| 
      
 1050 
     | 
    
         
            +
            83
         
     | 
| 
      
 1051 
     | 
    
         
            +
            84
         
     | 
| 
      
 1052 
     | 
    
         
            +
            85
         
     | 
| 
      
 1053 
     | 
    
         
            +
            86
         
     | 
| 
      
 1054 
     | 
    
         
            +
            87
         
     | 
| 
      
 1055 
     | 
    
         
            +
            88
         
     | 
| 
      
 1056 
     | 
    
         
            +
            89
         
     | 
| 
      
 1057 
     | 
    
         
            +
            90
         
     | 
| 
      
 1058 
     | 
    
         
            +
            91
         
     | 
| 
      
 1059 
     | 
    
         
            +
            92
         
     | 
| 
      
 1060 
     | 
    
         
            +
            93
         
     | 
| 
      
 1061 
     | 
    
         
            +
            94
         
     | 
| 
      
 1062 
     | 
    
         
            +
            95
         
     | 
| 
      
 1063 
     | 
    
         
            +
            96
         
     | 
| 
      
 1064 
     | 
    
         
            +
            97
         
     | 
| 
      
 1065 
     | 
    
         
            +
            98
         
     | 
| 
      
 1066 
     | 
    
         
            +
            99
         
     | 
| 
      
 1067 
     | 
    
         
            +
            100</pre>
         
     | 
| 
       975 
1068 
     | 
    
         
             
                </td>
         
     | 
| 
       976 
1069 
     | 
    
         
             
                <td>
         
     | 
| 
       977 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1070 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 77</span>
         
     | 
| 
       978 
1071 
     | 
    
         | 
| 
       979 
1072 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id dispatch'>dispatch</span><span class='lparen'>(</span><span class='id resp'>resp</span><span class='rparen'>)</span>
         
     | 
| 
       980 
     | 
    
         
            -
              <span class=' 
     | 
| 
       981 
     | 
    
         
            -
            </span>  <span class='kw'>begin</span>
         
     | 
| 
      
 1073 
     | 
    
         
            +
              <span class='kw'>begin</span>
         
     | 
| 
       982 
1074 
     | 
    
         
             
            	<span class='id source'>source</span> <span class='op'>=</span> <span class='id resp'>resp</span><span class='period'>.</span><span class='id request'>request</span><span class='period'>.</span><span class='id source'>source</span>
         
     | 
| 
       983 
1075 
     | 
    
         
             
            	<span class='kw'>if</span> <span class='const'>Safubot</span><span class='op'>::</span><span class='id mode'>mode</span> <span class='op'>!=</span> <span class='symbol'>:production</span>
         
     | 
| 
       984 
1076 
     | 
    
         
             
            	  <span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id source'>source</span><span class='period'>.</span><span class='id class'>class</span><span class='rbrace'>}</span><span class='tstring_content'> Response to </span><span class='embexpr_beg'>#{</span><span class='id source'>source</span><span class='period'>.</span><span class='id username'>username</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id resp'>resp</span><span class='period'>.</span><span class='id text'>text</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
         
     | 
| 
         @@ -1013,21 +1105,33 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1013 
1105 
     | 
    
         | 
| 
       1014 
1106 
     | 
    
         | 
| 
       1015 
1107 
     | 
    
         | 
| 
       1016 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1108 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1109 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1110 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1111 
     | 
    
         
            +
            Initialises Twitter-related functionality.
         
     | 
| 
      
 1112 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1113 
     | 
    
         
            +
             
     | 
| 
      
 1114 
     | 
    
         
            +
             
     | 
| 
      
 1115 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1116 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1117 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1118 
     | 
    
         
            +
              
         
     | 
| 
      
 1119 
     | 
    
         
            +
             
     | 
| 
      
 1120 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1017 
1121 
     | 
    
         
             
              <tr>
         
     | 
| 
       1018 
1122 
     | 
    
         
             
                <td>
         
     | 
| 
       1019 
1123 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1020 
1124 
     | 
    
         | 
| 
       1021 
1125 
     | 
    
         | 
| 
       1022 
     | 
    
         
            -
             
     | 
| 
       1023 
     | 
    
         
            -
             
     | 
| 
       1024 
     | 
    
         
            -
             
     | 
| 
       1025 
     | 
    
         
            -
             
     | 
| 
       1026 
     | 
    
         
            -
             
     | 
| 
       1027 
     | 
    
         
            -
             
     | 
| 
      
 1126 
     | 
    
         
            +
            174
         
     | 
| 
      
 1127 
     | 
    
         
            +
            175
         
     | 
| 
      
 1128 
     | 
    
         
            +
            176
         
     | 
| 
      
 1129 
     | 
    
         
            +
            177
         
     | 
| 
      
 1130 
     | 
    
         
            +
            178
         
     | 
| 
      
 1131 
     | 
    
         
            +
            179</pre>
         
     | 
| 
       1028 
1132 
     | 
    
         
             
                </td>
         
     | 
| 
       1029 
1133 
     | 
    
         
             
                <td>
         
     | 
| 
       1030 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1134 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 174</span>
         
     | 
| 
       1031 
1135 
     | 
    
         | 
| 
       1032 
1136 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id enable_twitter'>enable_twitter</span><span class='lparen'>(</span><span class='id opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
         
     | 
| 
       1033 
1137 
     | 
    
         
             
              <span class='ivar'>@twitter</span> <span class='op'>=</span> <span class='const'>Twitter</span><span class='op'>::</span><span class='const'>Bot</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id opts'>opts</span><span class='rparen'>)</span>
         
     | 
| 
         @@ -1047,22 +1151,34 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1047 
1151 
     | 
    
         | 
| 
       1048 
1152 
     | 
    
         | 
| 
       1049 
1153 
     | 
    
         | 
| 
       1050 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1154 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1155 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1156 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1157 
     | 
    
         
            +
            Initialises XMPP-related functionality.
         
     | 
| 
      
 1158 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1159 
     | 
    
         
            +
             
     | 
| 
      
 1160 
     | 
    
         
            +
             
     | 
| 
      
 1161 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1162 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1163 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1164 
     | 
    
         
            +
              
         
     | 
| 
      
 1165 
     | 
    
         
            +
             
     | 
| 
      
 1166 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1051 
1167 
     | 
    
         
             
              <tr>
         
     | 
| 
       1052 
1168 
     | 
    
         
             
                <td>
         
     | 
| 
       1053 
1169 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1054 
1170 
     | 
    
         | 
| 
       1055 
1171 
     | 
    
         | 
| 
       1056 
     | 
    
         
            -
             
     | 
| 
       1057 
     | 
    
         
            -
             
     | 
| 
       1058 
     | 
    
         
            -
             
     | 
| 
       1059 
     | 
    
         
            -
             
     | 
| 
       1060 
     | 
    
         
            -
             
     | 
| 
       1061 
     | 
    
         
            -
             
     | 
| 
       1062 
     | 
    
         
            -
             
     | 
| 
      
 1172 
     | 
    
         
            +
            182
         
     | 
| 
      
 1173 
     | 
    
         
            +
            183
         
     | 
| 
      
 1174 
     | 
    
         
            +
            184
         
     | 
| 
      
 1175 
     | 
    
         
            +
            185
         
     | 
| 
      
 1176 
     | 
    
         
            +
            186
         
     | 
| 
      
 1177 
     | 
    
         
            +
            187
         
     | 
| 
      
 1178 
     | 
    
         
            +
            188</pre>
         
     | 
| 
       1063 
1179 
     | 
    
         
             
                </td>
         
     | 
| 
       1064 
1180 
     | 
    
         
             
                <td>
         
     | 
| 
       1065 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1181 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 182</span>
         
     | 
| 
       1066 
1182 
     | 
    
         | 
| 
       1067 
1183 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id enable_xmpp'>enable_xmpp</span><span class='lparen'>(</span><span class='id options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
         
     | 
| 
       1068 
1184 
     | 
    
         
             
              <span class='id defaults'>defaults</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:jid</span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:password</span> <span class='op'>=></span> <span class='kw'>nil</span> <span class='rbrace'>}</span>
         
     | 
| 
         @@ -1083,20 +1199,32 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1083 
1199 
     | 
    
         | 
| 
       1084 
1200 
     | 
    
         | 
| 
       1085 
1201 
     | 
    
         | 
| 
       1086 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1202 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1203 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1204 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1205 
     | 
    
         
            +
            Goes through each unprocessed Request and submits it for processing.
         
     | 
| 
      
 1206 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1207 
     | 
    
         
            +
             
     | 
| 
      
 1208 
     | 
    
         
            +
             
     | 
| 
      
 1209 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1210 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1211 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1212 
     | 
    
         
            +
              
         
     | 
| 
      
 1213 
     | 
    
         
            +
             
     | 
| 
      
 1214 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1087 
1215 
     | 
    
         
             
              <tr>
         
     | 
| 
       1088 
1216 
     | 
    
         
             
                <td>
         
     | 
| 
       1089 
1217 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1090 
1218 
     | 
    
         | 
| 
       1091 
1219 
     | 
    
         | 
| 
       1092 
     | 
    
         
            -
             
     | 
| 
       1093 
     | 
    
         
            -
             
     | 
| 
       1094 
     | 
    
         
            -
             
     | 
| 
       1095 
     | 
    
         
            -
             
     | 
| 
       1096 
     | 
    
         
            -
             
     | 
| 
      
 1220 
     | 
    
         
            +
            108
         
     | 
| 
      
 1221 
     | 
    
         
            +
            109
         
     | 
| 
      
 1222 
     | 
    
         
            +
            110
         
     | 
| 
      
 1223 
     | 
    
         
            +
            111
         
     | 
| 
      
 1224 
     | 
    
         
            +
            112</pre>
         
     | 
| 
       1097 
1225 
     | 
    
         
             
                </td>
         
     | 
| 
       1098 
1226 
     | 
    
         
             
                <td>
         
     | 
| 
       1099 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1227 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 108</span>
         
     | 
| 
       1100 
1228 
     | 
    
         | 
| 
       1101 
1229 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id process'>process</span>
         
     | 
| 
       1102 
1230 
     | 
    
         
             
              <span class='const'>Request</span><span class='period'>.</span><span class='id where'>where</span><span class='lparen'>(</span><span class='symbol'>:processed</span> <span class='op'>=></span> <span class='kw'>false</span><span class='rparen'>)</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id req'>req</span><span class='op'>|</span>
         
     | 
| 
         @@ -1115,25 +1243,58 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1115 
1243 
     | 
    
         | 
| 
       1116 
1244 
     | 
    
         | 
| 
       1117 
1245 
     | 
    
         | 
| 
       1118 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1246 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1247 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1248 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1249 
     | 
    
         
            +
            Processes an individual request (synchronously).
         
     | 
| 
      
 1250 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1251 
     | 
    
         
            +
             
     | 
| 
      
 1252 
     | 
    
         
            +
             
     | 
| 
      
 1253 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1254 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1255 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1256 
     | 
    
         
            +
              <h3>Parameters:</h3>
         
     | 
| 
      
 1257 
     | 
    
         
            +
            <ul class="param">
         
     | 
| 
      
 1258 
     | 
    
         
            +
              
         
     | 
| 
      
 1259 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 1260 
     | 
    
         
            +
                  
         
     | 
| 
      
 1261 
     | 
    
         
            +
                    <span class='name'>req</span>
         
     | 
| 
      
 1262 
     | 
    
         
            +
                  
         
     | 
| 
      
 1263 
     | 
    
         
            +
                  
         
     | 
| 
      
 1264 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 1265 
     | 
    
         
            +
                  
         
     | 
| 
      
 1266 
     | 
    
         
            +
                  
         
     | 
| 
      
 1267 
     | 
    
         
            +
                  
         
     | 
| 
      
 1268 
     | 
    
         
            +
                    —
         
     | 
| 
      
 1269 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 1270 
     | 
    
         
            +
            An unprocessed Request.
         
     | 
| 
      
 1271 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1272 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1273 
     | 
    
         
            +
                  
         
     | 
| 
      
 1274 
     | 
    
         
            +
                </li>
         
     | 
| 
      
 1275 
     | 
    
         
            +
              
         
     | 
| 
      
 1276 
     | 
    
         
            +
            </ul>
         
     | 
| 
      
 1277 
     | 
    
         
            +
             
     | 
| 
      
 1278 
     | 
    
         
            +
             
     | 
| 
      
 1279 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1119 
1280 
     | 
    
         
             
              <tr>
         
     | 
| 
       1120 
1281 
     | 
    
         
             
                <td>
         
     | 
| 
       1121 
1282 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1122 
1283 
     | 
    
         | 
| 
       1123 
1284 
     | 
    
         | 
| 
       1124 
     | 
    
         
            -
             
     | 
| 
       1125 
     | 
    
         
            -
             
     | 
| 
       1126 
     | 
    
         
            -
             
     | 
| 
       1127 
     | 
    
         
            -
             
     | 
| 
       1128 
     | 
    
         
            -
             
     | 
| 
       1129 
     | 
    
         
            -
             
     | 
| 
       1130 
     | 
    
         
            -
             
     | 
| 
       1131 
     | 
    
         
            -
             
     | 
| 
       1132 
     | 
    
         
            -
             
     | 
| 
       1133 
     | 
    
         
            -
             
     | 
| 
      
 1285 
     | 
    
         
            +
            63
         
     | 
| 
      
 1286 
     | 
    
         
            +
            64
         
     | 
| 
      
 1287 
     | 
    
         
            +
            65
         
     | 
| 
      
 1288 
     | 
    
         
            +
            66
         
     | 
| 
      
 1289 
     | 
    
         
            +
            67
         
     | 
| 
      
 1290 
     | 
    
         
            +
            68
         
     | 
| 
      
 1291 
     | 
    
         
            +
            69
         
     | 
| 
      
 1292 
     | 
    
         
            +
            70
         
     | 
| 
      
 1293 
     | 
    
         
            +
            71
         
     | 
| 
      
 1294 
     | 
    
         
            +
            72</pre>
         
     | 
| 
       1134 
1295 
     | 
    
         
             
                </td>
         
     | 
| 
       1135 
1296 
     | 
    
         
             
                <td>
         
     | 
| 
       1136 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1297 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 63</span>
         
     | 
| 
       1137 
1298 
     | 
    
         | 
| 
       1138 
1299 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id process_request'>process_request</span><span class='lparen'>(</span><span class='id req'>req</span><span class='rparen'>)</span>
         
     | 
| 
       1139 
1300 
     | 
    
         
             
              <span class='kw'>begin</span>
         
     | 
| 
         @@ -1157,18 +1318,31 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1157 
1318 
     | 
    
         | 
| 
       1158 
1319 
     | 
    
         | 
| 
       1159 
1320 
     | 
    
         | 
| 
       1160 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1321 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1322 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1323 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1324 
     | 
    
         
            +
            This pulls requests from passive non-streaming sources (currently, the
         
     | 
| 
      
 1325 
     | 
    
         
            +
            Twitter AJAX API).
         
     | 
| 
      
 1326 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1327 
     | 
    
         
            +
             
     | 
| 
      
 1328 
     | 
    
         
            +
             
     | 
| 
      
 1329 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1330 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1331 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1332 
     | 
    
         
            +
              
         
     | 
| 
      
 1333 
     | 
    
         
            +
             
     | 
| 
      
 1334 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1161 
1335 
     | 
    
         
             
              <tr>
         
     | 
| 
       1162 
1336 
     | 
    
         
             
                <td>
         
     | 
| 
       1163 
1337 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1164 
1338 
     | 
    
         | 
| 
       1165 
1339 
     | 
    
         | 
| 
       1166 
     | 
    
         
            -
             
     | 
| 
       1167 
     | 
    
         
            -
             
     | 
| 
       1168 
     | 
    
         
            -
             
     | 
| 
      
 1340 
     | 
    
         
            +
            103
         
     | 
| 
      
 1341 
     | 
    
         
            +
            104
         
     | 
| 
      
 1342 
     | 
    
         
            +
            105</pre>
         
     | 
| 
       1169 
1343 
     | 
    
         
             
                </td>
         
     | 
| 
       1170 
1344 
     | 
    
         
             
                <td>
         
     | 
| 
       1171 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1345 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 103</span>
         
     | 
| 
       1172 
1346 
     | 
    
         | 
| 
       1173 
1347 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id pull'>pull</span>
         
     | 
| 
       1174 
1348 
     | 
    
         
             
              <span class='ivar'>@twitter</span><span class='period'>.</span><span class='id pull'>pull</span>
         
     | 
| 
         @@ -1185,18 +1359,30 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1185 
1359 
     | 
    
         | 
| 
       1186 
1360 
     | 
    
         | 
| 
       1187 
1361 
     | 
    
         | 
| 
       1188 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1362 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1363 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1364 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1365 
     | 
    
         
            +
            Dispatches all undispatched Responses.
         
     | 
| 
      
 1366 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1367 
     | 
    
         
            +
             
     | 
| 
      
 1368 
     | 
    
         
            +
             
     | 
| 
      
 1369 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1370 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1371 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1372 
     | 
    
         
            +
              
         
     | 
| 
      
 1373 
     | 
    
         
            +
             
     | 
| 
      
 1374 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1189 
1375 
     | 
    
         
             
              <tr>
         
     | 
| 
       1190 
1376 
     | 
    
         
             
                <td>
         
     | 
| 
       1191 
1377 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1192 
1378 
     | 
    
         | 
| 
       1193 
1379 
     | 
    
         | 
| 
       1194 
     | 
    
         
            -
             
     | 
| 
       1195 
     | 
    
         
            -
             
     | 
| 
       1196 
     | 
    
         
            -
             
     | 
| 
      
 1380 
     | 
    
         
            +
            130
         
     | 
| 
      
 1381 
     | 
    
         
            +
            131
         
     | 
| 
      
 1382 
     | 
    
         
            +
            132</pre>
         
     | 
| 
       1197 
1383 
     | 
    
         
             
                </td>
         
     | 
| 
       1198 
1384 
     | 
    
         
             
                <td>
         
     | 
| 
       1199 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1385 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 130</span>
         
     | 
| 
       1200 
1386 
     | 
    
         | 
| 
       1201 
1387 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id push'>push</span>
         
     | 
| 
       1202 
1388 
     | 
    
         
             
              <span class='const'>Response</span><span class='period'>.</span><span class='id where'>where</span><span class='lparen'>(</span><span class='symbol'>:dispatched</span> <span class='op'>=></span> <span class='kw'>false</span><span class='rparen'>)</span><span class='period'>.</span><span class='id each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id method'>method</span><span class='lparen'>(</span><span class='symbol'>:dispatch</span><span class='rparen'>)</span><span class='rparen'>)</span>
         
     | 
| 
         @@ -1213,21 +1399,71 @@ The operation to be performed in a separate thread. 
     | 
|
| 
       1213 
1399 
     | 
    
         | 
| 
       1214 
1400 
     | 
    
         | 
| 
       1215 
1401 
     | 
    
         | 
| 
       1216 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1402 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1403 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1404 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1405 
     | 
    
         
            +
            Records an error and emits a corresponding :request_error event.
         
     | 
| 
      
 1406 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1407 
     | 
    
         
            +
             
     | 
| 
      
 1408 
     | 
    
         
            +
             
     | 
| 
      
 1409 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1410 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1411 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1412 
     | 
    
         
            +
              <h3>Parameters:</h3>
         
     | 
| 
      
 1413 
     | 
    
         
            +
            <ul class="param">
         
     | 
| 
      
 1414 
     | 
    
         
            +
              
         
     | 
| 
      
 1415 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 1416 
     | 
    
         
            +
                  
         
     | 
| 
      
 1417 
     | 
    
         
            +
                    <span class='name'>req</span>
         
     | 
| 
      
 1418 
     | 
    
         
            +
                  
         
     | 
| 
      
 1419 
     | 
    
         
            +
                  
         
     | 
| 
      
 1420 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 1421 
     | 
    
         
            +
                  
         
     | 
| 
      
 1422 
     | 
    
         
            +
                  
         
     | 
| 
      
 1423 
     | 
    
         
            +
                  
         
     | 
| 
      
 1424 
     | 
    
         
            +
                    —
         
     | 
| 
      
 1425 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 1426 
     | 
    
         
            +
            The Request for which the error was encountered.
         
     | 
| 
      
 1427 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1428 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1429 
     | 
    
         
            +
                  
         
     | 
| 
      
 1430 
     | 
    
         
            +
                </li>
         
     | 
| 
      
 1431 
     | 
    
         
            +
              
         
     | 
| 
      
 1432 
     | 
    
         
            +
                <li>
         
     | 
| 
      
 1433 
     | 
    
         
            +
                  
         
     | 
| 
      
 1434 
     | 
    
         
            +
                    <span class='name'>e</span>
         
     | 
| 
      
 1435 
     | 
    
         
            +
                  
         
     | 
| 
      
 1436 
     | 
    
         
            +
                  
         
     | 
| 
      
 1437 
     | 
    
         
            +
                    <span class='type'></span>
         
     | 
| 
      
 1438 
     | 
    
         
            +
                  
         
     | 
| 
      
 1439 
     | 
    
         
            +
                  
         
     | 
| 
      
 1440 
     | 
    
         
            +
                  
         
     | 
| 
      
 1441 
     | 
    
         
            +
                    —
         
     | 
| 
      
 1442 
     | 
    
         
            +
                    <div class='inline'><p>
         
     | 
| 
      
 1443 
     | 
    
         
            +
            The caught Exception.
         
     | 
| 
      
 1444 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1445 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1446 
     | 
    
         
            +
                  
         
     | 
| 
      
 1447 
     | 
    
         
            +
                </li>
         
     | 
| 
      
 1448 
     | 
    
         
            +
              
         
     | 
| 
      
 1449 
     | 
    
         
            +
            </ul>
         
     | 
| 
      
 1450 
     | 
    
         
            +
             
     | 
| 
      
 1451 
     | 
    
         
            +
             
     | 
| 
      
 1452 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1217 
1453 
     | 
    
         
             
              <tr>
         
     | 
| 
       1218 
1454 
     | 
    
         
             
                <td>
         
     | 
| 
       1219 
1455 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1220 
1456 
     | 
    
         | 
| 
       1221 
1457 
     | 
    
         | 
| 
       1222 
     | 
    
         
            -
             
     | 
| 
       1223 
     | 
    
         
            -
             
     | 
| 
       1224 
     | 
    
         
            -
             
     | 
| 
       1225 
     | 
    
         
            -
             
     | 
| 
       1226 
     | 
    
         
            -
             
     | 
| 
       1227 
     | 
    
         
            -
             
     | 
| 
      
 1458 
     | 
    
         
            +
            53
         
     | 
| 
      
 1459 
     | 
    
         
            +
            54
         
     | 
| 
      
 1460 
     | 
    
         
            +
            55
         
     | 
| 
      
 1461 
     | 
    
         
            +
            56
         
     | 
| 
      
 1462 
     | 
    
         
            +
            57
         
     | 
| 
      
 1463 
     | 
    
         
            +
            58</pre>
         
     | 
| 
       1228 
1464 
     | 
    
         
             
                </td>
         
     | 
| 
       1229 
1465 
     | 
    
         
             
                <td>
         
     | 
| 
       1230 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1466 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 53</span>
         
     | 
| 
       1231 
1467 
     | 
    
         | 
| 
       1232 
1468 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id request_error'>request_error</span><span class='lparen'>(</span><span class='id req'>req</span><span class='comma'>,</span> <span class='id e'>e</span><span class='rparen'>)</span>
         
     | 
| 
       1233 
1469 
     | 
    
         
             
              <span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Error processing </span><span class='embexpr_beg'>#{</span><span class='id req'>req</span><span class='period'>.</span><span class='id source'>source</span><span class='period'>.</span><span class='id class'>class</span><span class='rbrace'>}</span><span class='tstring_content'> '</span><span class='embexpr_beg'>#{</span><span class='id req'>req</span><span class='period'>.</span><span class='id text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>': </span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='period'>.</span><span class='id backtrace'>backtrace</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n\t</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
         
     | 
| 
         @@ -1303,13 +1539,13 @@ Contents of the response. 
     | 
|
| 
       1303 
1539 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1304 
1540 
     | 
    
         | 
| 
       1305 
1541 
     | 
    
         | 
| 
       1306 
     | 
    
         
            -
             
     | 
| 
       1307 
     | 
    
         
            -
             
     | 
| 
       1308 
     | 
    
         
            -
             
     | 
| 
       1309 
     | 
    
         
            -
             
     | 
| 
      
 1542 
     | 
    
         
            +
            118
         
     | 
| 
      
 1543 
     | 
    
         
            +
            119
         
     | 
| 
      
 1544 
     | 
    
         
            +
            120
         
     | 
| 
      
 1545 
     | 
    
         
            +
            121</pre>
         
     | 
| 
       1310 
1546 
     | 
    
         
             
                </td>
         
     | 
| 
       1311 
1547 
     | 
    
         
             
                <td>
         
     | 
| 
       1312 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1548 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 118</span>
         
     | 
| 
       1313 
1549 
     | 
    
         | 
| 
       1314 
1550 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id respond'>respond</span><span class='lparen'>(</span><span class='id req'>req</span><span class='comma'>,</span> <span class='id text'>text</span><span class='rparen'>)</span>
         
     | 
| 
       1315 
1551 
     | 
    
         
             
              <span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id req'>req</span><span class='period'>.</span><span class='id user'>user</span><span class='period'>.</span><span class='id name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id req'>req</span><span class='period'>.</span><span class='id text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>\nsafubot: </span><span class='embexpr_beg'>#{</span><span class='id text'>text</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
         
     | 
| 
         @@ -1345,13 +1581,13 @@ Respond + push 
     | 
|
| 
       1345 
1581 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1346 
1582 
     | 
    
         | 
| 
       1347 
1583 
     | 
    
         | 
| 
       1348 
     | 
    
         
            -
             
     | 
| 
       1349 
     | 
    
         
            -
             
     | 
| 
       1350 
     | 
    
         
            -
             
     | 
| 
       1351 
     | 
    
         
            -
             
     | 
| 
      
 1584 
     | 
    
         
            +
            124
         
     | 
| 
      
 1585 
     | 
    
         
            +
            125
         
     | 
| 
      
 1586 
     | 
    
         
            +
            126
         
     | 
| 
      
 1587 
     | 
    
         
            +
            127</pre>
         
     | 
| 
       1352 
1588 
     | 
    
         
             
                </td>
         
     | 
| 
       1353 
1589 
     | 
    
         
             
                <td>
         
     | 
| 
       1354 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1590 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 124</span>
         
     | 
| 
       1355 
1591 
     | 
    
         | 
| 
       1356 
1592 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id respond_now'>respond_now</span><span class='lparen'>(</span><span class='id req'>req</span><span class='comma'>,</span> <span class='id text'>text</span><span class='rparen'>)</span>
         
     | 
| 
       1357 
1593 
     | 
    
         
             
              <span class='id respond'>respond</span><span class='lparen'>(</span><span class='id req'>req</span><span class='comma'>,</span> <span class='id text'>text</span><span class='rparen'>)</span>
         
     | 
| 
         @@ -1369,51 +1605,92 @@ Respond + push 
     | 
|
| 
       1369 
1605 
     | 
    
         | 
| 
       1370 
1606 
     | 
    
         | 
| 
       1371 
1607 
     | 
    
         | 
| 
       1372 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1608 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1609 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1610 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1611 
     | 
    
         
            +
            Calls run_nowait and then waits for all child processes.
         
     | 
| 
      
 1612 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1613 
     | 
    
         
            +
             
     | 
| 
      
 1614 
     | 
    
         
            +
             
     | 
| 
      
 1615 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1616 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1617 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1618 
     | 
    
         
            +
              
         
     | 
| 
      
 1619 
     | 
    
         
            +
             
     | 
| 
      
 1620 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1373 
1621 
     | 
    
         
             
              <tr>
         
     | 
| 
       1374 
1622 
     | 
    
         
             
                <td>
         
     | 
| 
       1375 
1623 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1376 
1624 
     | 
    
         | 
| 
       1377 
1625 
     | 
    
         | 
| 
       1378 
     | 
    
         
            -
             
     | 
| 
       1379 
     | 
    
         
            -
             
     | 
| 
       1380 
     | 
    
         
            -
             
     | 
| 
       1381 
     | 
    
         
            -
             
     | 
| 
       1382 
     | 
    
         
            -
             
     | 
| 
       1383 
     | 
    
         
            -
             
     | 
| 
       1384 
     | 
    
         
            -
             
     | 
| 
       1385 
     | 
    
         
            -
             
     | 
| 
       1386 
     | 
    
         
            -
            139
         
     | 
| 
       1387 
     | 
    
         
            -
            140
         
     | 
| 
       1388 
     | 
    
         
            -
            141
         
     | 
| 
       1389 
     | 
    
         
            -
            142
         
     | 
| 
       1390 
     | 
    
         
            -
            143
         
     | 
| 
       1391 
     | 
    
         
            -
            144
         
     | 
| 
       1392 
     | 
    
         
            -
            145
         
     | 
| 
       1393 
     | 
    
         
            -
            146</pre>
         
     | 
| 
      
 1626 
     | 
    
         
            +
            158
         
     | 
| 
      
 1627 
     | 
    
         
            +
            159
         
     | 
| 
      
 1628 
     | 
    
         
            +
            160
         
     | 
| 
      
 1629 
     | 
    
         
            +
            161
         
     | 
| 
      
 1630 
     | 
    
         
            +
            162
         
     | 
| 
      
 1631 
     | 
    
         
            +
            163
         
     | 
| 
      
 1632 
     | 
    
         
            +
            164
         
     | 
| 
      
 1633 
     | 
    
         
            +
            165</pre>
         
     | 
| 
       1394 
1634 
     | 
    
         
             
                </td>
         
     | 
| 
       1395 
1635 
     | 
    
         
             
                <td>
         
     | 
| 
       1396 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1636 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 158</span>
         
     | 
| 
       1397 
1637 
     | 
    
         | 
| 
       1398 
1638 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id run'>run</span>
         
     | 
| 
       1399 
     | 
    
         
            -
              <span class=' 
     | 
| 
       1400 
     | 
    
         
            -
             
     | 
| 
       1401 
     | 
    
         
            -
             
     | 
| 
       1402 
     | 
    
         
            -
             
     | 
| 
       1403 
     | 
    
         
            -
             
     | 
| 
       1404 
     | 
    
         
            -
            	  <span class='kw'>else</span>
         
     | 
| 
       1405 
     | 
    
         
            -
            		<span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unhandled exception: </span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id e'>e</span><span class='period'>.</span><span class='id backtrace'>backtrace</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\t\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
         
     | 
| 
       1406 
     | 
    
         
            -
            	  <span class='kw'>end</span>
         
     | 
| 
       1407 
     | 
    
         
            -
            	<span class='kw'>end</span>
         
     | 
| 
       1408 
     | 
    
         
            -
             
     | 
| 
       1409 
     | 
    
         
            -
            	<span class='id cycle'>cycle</span>
         
     | 
| 
       1410 
     | 
    
         
            -
            	<span class='ivar'>@twitter</span><span class='period'>.</span><span class='id run'>run</span> <span class='kw'>if</span> <span class='ivar'>@twitter</span>
         
     | 
| 
       1411 
     | 
    
         
            -
            	<span class='ivar'>@xmpp</span><span class='period'>.</span><span class='id run'>run</span> <span class='kw'>if</span> <span class='ivar'>@xmpp</span>
         
     | 
| 
      
 1639 
     | 
    
         
            +
              <span class='id run_nowait'>run_nowait</span>
         
     | 
| 
      
 1640 
     | 
    
         
            +
              <span class='kw'>begin</span>
         
     | 
| 
      
 1641 
     | 
    
         
            +
            	<span class='const'>Process</span><span class='period'>.</span><span class='id waitall'>waitall</span>
         
     | 
| 
      
 1642 
     | 
    
         
            +
              <span class='kw'>rescue</span> <span class='const'>Interrupt</span>
         
     | 
| 
      
 1643 
     | 
    
         
            +
            	<span class='id stop'>stop</span>
         
     | 
| 
       1412 
1644 
     | 
    
         
             
              <span class='kw'>end</span>
         
     | 
| 
       1413 
1645 
     | 
    
         
             
            <span class='kw'>end</span></pre>
         
     | 
| 
       1414 
1646 
     | 
    
         
             
                </td>
         
     | 
| 
       1415 
1647 
     | 
    
         
             
              </tr>
         
     | 
| 
       1416 
1648 
     | 
    
         
             
            </table>
         
     | 
| 
      
 1649 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1650 
     | 
    
         
            +
                
         
     | 
| 
      
 1651 
     | 
    
         
            +
                  <div class="method_details ">
         
     | 
| 
      
 1652 
     | 
    
         
            +
              <p class="signature " id="run_nowait-instance_method">
         
     | 
| 
      
 1653 
     | 
    
         
            +
              
         
     | 
| 
      
 1654 
     | 
    
         
            +
                - (<tt>Object</tt>) <strong>run_nowait</strong> 
         
     | 
| 
      
 1655 
     | 
    
         
            +
              
         
     | 
| 
      
 1656 
     | 
    
         
            +
             
     | 
| 
      
 1657 
     | 
    
         
            +
              
         
     | 
| 
      
 1658 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1659 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1660 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1661 
     | 
    
         
            +
            Runs an initial request-processing loop and then forks the streaming
         
     | 
| 
      
 1662 
     | 
    
         
            +
            processes.
         
     | 
| 
      
 1663 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1664 
     | 
    
         
            +
             
     | 
| 
      
 1665 
     | 
    
         
            +
             
     | 
| 
      
 1666 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1667 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1668 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1669 
     | 
    
         
            +
              
         
     | 
| 
      
 1670 
     | 
    
         
            +
             
     | 
| 
      
 1671 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
      
 1672 
     | 
    
         
            +
              <tr>
         
     | 
| 
      
 1673 
     | 
    
         
            +
                <td>
         
     | 
| 
      
 1674 
     | 
    
         
            +
                  <pre class="lines">
         
     | 
| 
      
 1675 
     | 
    
         
            +
             
     | 
| 
      
 1676 
     | 
    
         
            +
             
     | 
| 
      
 1677 
     | 
    
         
            +
            151
         
     | 
| 
      
 1678 
     | 
    
         
            +
            152
         
     | 
| 
      
 1679 
     | 
    
         
            +
            153
         
     | 
| 
      
 1680 
     | 
    
         
            +
            154
         
     | 
| 
      
 1681 
     | 
    
         
            +
            155</pre>
         
     | 
| 
      
 1682 
     | 
    
         
            +
                </td>
         
     | 
| 
      
 1683 
     | 
    
         
            +
                <td>
         
     | 
| 
      
 1684 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 151</span>
         
     | 
| 
      
 1685 
     | 
    
         
            +
             
     | 
| 
      
 1686 
     | 
    
         
            +
            <span class='kw'>def</span> <span class='id run_nowait'>run_nowait</span>
         
     | 
| 
      
 1687 
     | 
    
         
            +
              <span class='id pull'>pull</span><span class='semicolon'>;</span> <span class='id process'>process</span><span class='semicolon'>;</span> <span class='id push'>push</span>
         
     | 
| 
      
 1688 
     | 
    
         
            +
              <span class='ivar'>@twitter</span><span class='period'>.</span><span class='id run'>run</span> <span class='kw'>if</span> <span class='ivar'>@twitter</span>
         
     | 
| 
      
 1689 
     | 
    
         
            +
              <span class='ivar'>@xmpp</span><span class='period'>.</span><span class='id run'>run</span> <span class='kw'>if</span> <span class='ivar'>@xmpp</span>
         
     | 
| 
      
 1690 
     | 
    
         
            +
            <span class='kw'>end</span></pre>
         
     | 
| 
      
 1691 
     | 
    
         
            +
                </td>
         
     | 
| 
      
 1692 
     | 
    
         
            +
              </tr>
         
     | 
| 
      
 1693 
     | 
    
         
            +
            </table>
         
     | 
| 
       1417 
1694 
     | 
    
         
             
            </div>
         
     | 
| 
       1418 
1695 
     | 
    
         | 
| 
       1419 
1696 
     | 
    
         
             
                  <div class="method_details ">
         
     | 
| 
         @@ -1423,25 +1700,35 @@ Respond + push 
     | 
|
| 
       1423 
1700 
     | 
    
         | 
| 
       1424 
1701 
     | 
    
         | 
| 
       1425 
1702 
     | 
    
         | 
| 
       1426 
     | 
    
         
            -
            </p>< 
     | 
| 
      
 1703 
     | 
    
         
            +
            </p><div class="docstring">
         
     | 
| 
      
 1704 
     | 
    
         
            +
              <div class="discussion">
         
     | 
| 
      
 1705 
     | 
    
         
            +
                <p>
         
     | 
| 
      
 1706 
     | 
    
         
            +
            Shuts down the streaming processes.
         
     | 
| 
      
 1707 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 1708 
     | 
    
         
            +
             
     | 
| 
      
 1709 
     | 
    
         
            +
             
     | 
| 
      
 1710 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 1711 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 1712 
     | 
    
         
            +
            <div class="tags">
         
     | 
| 
      
 1713 
     | 
    
         
            +
              
         
     | 
| 
      
 1714 
     | 
    
         
            +
             
     | 
| 
      
 1715 
     | 
    
         
            +
            </div><table class="source_code">
         
     | 
| 
       1427 
1716 
     | 
    
         
             
              <tr>
         
     | 
| 
       1428 
1717 
     | 
    
         
             
                <td>
         
     | 
| 
       1429 
1718 
     | 
    
         
             
                  <pre class="lines">
         
     | 
| 
       1430 
1719 
     | 
    
         | 
| 
       1431 
1720 
     | 
    
         | 
| 
       1432 
     | 
    
         
            -
             
     | 
| 
       1433 
     | 
    
         
            -
             
     | 
| 
       1434 
     | 
    
         
            -
             
     | 
| 
       1435 
     | 
    
         
            -
             
     | 
| 
       1436 
     | 
    
         
            -
            152</pre>
         
     | 
| 
      
 1721 
     | 
    
         
            +
            168
         
     | 
| 
      
 1722 
     | 
    
         
            +
            169
         
     | 
| 
      
 1723 
     | 
    
         
            +
            170
         
     | 
| 
      
 1724 
     | 
    
         
            +
            171</pre>
         
     | 
| 
       1437 
1725 
     | 
    
         
             
                </td>
         
     | 
| 
       1438 
1726 
     | 
    
         
             
                <td>
         
     | 
| 
       1439 
     | 
    
         
            -
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line  
     | 
| 
      
 1727 
     | 
    
         
            +
                  <pre class="code"><span class="info file"># File 'lib/safubot/bot.rb', line 168</span>
         
     | 
| 
       1440 
1728 
     | 
    
         | 
| 
       1441 
1729 
     | 
    
         
             
            <span class='kw'>def</span> <span class='id stop'>stop</span>
         
     | 
| 
       1442 
1730 
     | 
    
         
             
              <span class='ivar'>@twitter</span><span class='period'>.</span><span class='id stop'>stop</span> <span class='kw'>if</span> <span class='ivar'>@twitter</span>
         
     | 
| 
       1443 
1731 
     | 
    
         
             
              <span class='ivar'>@xmpp</span><span class='period'>.</span><span class='id stop'>stop</span> <span class='kw'>if</span> <span class='ivar'>@xmpp</span>
         
     | 
| 
       1444 
     | 
    
         
            -
              <span class='const'>EM</span><span class='op'>::</span><span class='id stop_event_loop'>stop_event_loop</span>
         
     | 
| 
       1445 
1732 
     | 
    
         
             
            <span class='kw'>end</span></pre>
         
     | 
| 
       1446 
1733 
     | 
    
         
             
                </td>
         
     | 
| 
       1447 
1734 
     | 
    
         
             
              </tr>
         
     | 
| 
         @@ -1453,7 +1740,7 @@ Respond + push 
     | 
|
| 
       1453 
1740 
     | 
    
         
             
            </div>
         
     | 
| 
       1454 
1741 
     | 
    
         | 
| 
       1455 
1742 
     | 
    
         
             
                <div id="footer">
         
     | 
| 
       1456 
     | 
    
         
            -
              Generated on  
     | 
| 
      
 1743 
     | 
    
         
            +
              Generated on Tue Nov 29 11:44:04 2011 by 
         
     | 
| 
       1457 
1744 
     | 
    
         
             
              <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
         
     | 
| 
       1458 
1745 
     | 
    
         
             
              0.7.3 (ruby-1.9.2).
         
     | 
| 
       1459 
1746 
     | 
    
         
             
            </div>
         
     |