safubot 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/.yardoc/checksums +9 -0
  2. data/.yardoc/objects/root.dat +0 -0
  3. data/.yardoc/proxy_types +0 -0
  4. data/README.md +52 -1
  5. data/doc/Safubot/Bot.html +1287 -652
  6. data/doc/Safubot/Evented.html +409 -276
  7. data/doc/Safubot/KnownUser.html +476 -254
  8. data/doc/Safubot/Log.html +184 -192
  9. data/doc/Safubot/Query.html +131 -164
  10. data/doc/Safubot/Request.html +158 -147
  11. data/doc/Safubot/Response.html +92 -135
  12. data/doc/Safubot/Test.html +166 -187
  13. data/doc/Safubot/Twitter/Bot.html +1005 -455
  14. data/doc/Safubot/Twitter/DirectMessage.html +417 -238
  15. data/doc/Safubot/Twitter/Tweet.html +725 -398
  16. data/doc/Safubot/Twitter.html +69 -116
  17. data/doc/Safubot/XMPP/Bot.html +625 -303
  18. data/doc/Safubot/XMPP/Message.html +372 -217
  19. data/doc/Safubot/XMPP.html +69 -116
  20. data/doc/Safubot.html +155 -126
  21. data/doc/_index.html +294 -0
  22. data/doc/class_list.html +47 -0
  23. data/doc/css/common.css +1 -0
  24. data/doc/css/full_list.css +55 -0
  25. data/doc/css/style.css +322 -0
  26. data/doc/file.README.html +140 -0
  27. data/doc/file_list.html +49 -0
  28. data/doc/frames.html +13 -0
  29. data/doc/index.html +129 -101
  30. data/doc/js/app.js +205 -0
  31. data/doc/js/full_list.js +167 -0
  32. data/doc/js/jquery.js +3 -5
  33. data/doc/method_list.html +638 -0
  34. data/doc/top-level-namespace.html +103 -0
  35. data/lib/safubot/bot.rb +22 -20
  36. data/lib/safubot/known_user.rb +2 -0
  37. data/lib/safubot/twitter.rb +30 -26
  38. data/lib/safubot/version.rb +1 -1
  39. data/lib/safubot/xmpp.rb +20 -14
  40. data/safubot.gemspec +1 -0
  41. metadata +50 -71
  42. data/doc/Gemfile.html +0 -119
  43. data/doc/Object.html +0 -171
  44. data/doc/Rakefile.html +0 -117
  45. data/doc/created.rid +0 -14
  46. data/doc/foo_rb.html +0 -115
  47. data/doc/images/add.png +0 -0
  48. data/doc/images/brick.png +0 -0
  49. data/doc/images/brick_link.png +0 -0
  50. data/doc/images/bug.png +0 -0
  51. data/doc/images/bullet_black.png +0 -0
  52. data/doc/images/bullet_toggle_minus.png +0 -0
  53. data/doc/images/bullet_toggle_plus.png +0 -0
  54. data/doc/images/date.png +0 -0
  55. data/doc/images/delete.png +0 -0
  56. data/doc/images/find.png +0 -0
  57. data/doc/images/loadingAnimation.gif +0 -0
  58. data/doc/images/macFFBgHack.png +0 -0
  59. data/doc/images/package.png +0 -0
  60. data/doc/images/page_green.png +0 -0
  61. data/doc/images/page_white_text.png +0 -0
  62. data/doc/images/page_white_width.png +0 -0
  63. data/doc/images/plugin.png +0 -0
  64. data/doc/images/ruby.png +0 -0
  65. data/doc/images/tag_blue.png +0 -0
  66. data/doc/images/tag_green.png +0 -0
  67. data/doc/images/transparent.png +0 -0
  68. data/doc/images/wrench.png +0 -0
  69. data/doc/images/wrench_orange.png +0 -0
  70. data/doc/images/zoom.png +0 -0
  71. data/doc/js/darkfish.js +0 -153
  72. data/doc/js/navigation.js +0 -142
  73. data/doc/js/search.js +0 -94
  74. data/doc/js/search_index.js +0 -1
  75. data/doc/js/searcher.js +0 -228
  76. data/doc/lib/safubot/bot_rb.html +0 -115
  77. data/doc/lib/safubot/evented_rb.html +0 -115
  78. data/doc/lib/safubot/known_user_rb.html +0 -115
  79. data/doc/lib/safubot/log_rb.html +0 -115
  80. data/doc/lib/safubot/safubot_rb.html +0 -115
  81. data/doc/lib/safubot/spec/bot_spec_rb.html +0 -115
  82. data/doc/lib/safubot/spec/twitter_spec_rb.html +0 -137
  83. data/doc/lib/safubot/test_helper_rb.html +0 -115
  84. data/doc/lib/safubot/twitter_rb.html +0 -115
  85. data/doc/lib/safubot/version_rb.html +0 -115
  86. data/doc/lib/safubot/xmpp_rb.html +0 -115
  87. data/doc/lib/safubot_rb.html +0 -115
  88. data/doc/rdoc.css +0 -543
  89. data/doc/table_of_contents.html +0 -224
@@ -1,403 +1,725 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Safubot::XMPP::Bot
8
+
9
+ &mdash; Documentation by YARD 0.7.3
10
+
11
+ </title>
6
12
 
7
- <title>Class: Safubot::XMPP::Bot</title>
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
8
14
 
9
- <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
10
16
 
11
- <script type="text/javascript">
12
- var rdoc_rel_prefix = "../../";
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '../..';
19
+ if (relpath != '') relpath += '/';
13
20
  </script>
14
21
 
15
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
21
-
22
-
23
- <body id="top" class="class">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="../../index.html">Home</a>
28
- <a href="../../table_of_contents.html#classes">Classes</a>
29
- <a href="../../table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
33
-
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
35
- <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
38
- title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
44
-
45
-
46
- <div id="file-metadata">
47
- <nav id="file-list-section" class="section">
48
- <h3 class="section-header">Defined In</h3>
49
- <ul>
50
- <li>lib/safubot/xmpp.rb
51
- </ul>
52
- </nav>
22
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
53
23
 
54
-
55
- </div>
24
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
56
25
 
57
- <div id="class-metadata">
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
58
32
 
59
- <nav id="parent-class-section" class="section">
60
- <h3 class="section-header">Parent</h3>
33
+ <div id="header">
34
+ <div id="menu">
61
35
 
62
- <p class="link"><a href="../../Object.html">Object</a>
36
+ <a href="../../_index.html">Index (B)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../Safubot.html" title="Safubot (module)">Safubot</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../XMPP.html" title="Safubot::XMPP (module)">XMPP</a></span></span>
38
+ &raquo;
39
+ <span class="title">Bot</span>
63
40
 
64
- </nav>
65
-
66
- <!-- Included Modules -->
67
- <nav id="includes-section" class="section">
68
- <h3 class="section-header">Included Modules</h3>
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
69
44
 
70
- <ul class="link-list">
45
+ <div id="search">
71
46
 
47
+ <a id="class_list_link" href="#">Class List</a>
72
48
 
73
- <li><a class="include" href="../Evented.html">Safubot::Evented</a>
49
+ <a id="method_list_link" href="#">Method List</a>
74
50
 
51
+ <a id="file_list_link" href="#">File List</a>
75
52
 
76
- </ul>
77
- </nav>
78
-
79
- <!-- Method Quickref -->
80
- <nav id="method-list-section" class="section">
81
- <h3 class="section-header">Methods</h3>
82
-
83
- <ul class="link-list">
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
84
56
 
85
- <li><a href="#method-c-new">::new</a>
57
+ <iframe id="search_frame"></iframe>
86
58
 
87
- <li><a href="#method-i-run">#run</a>
59
+ <div id="content"><h1>Class: Safubot::XMPP::Bot
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">Safubot::XMPP::Bot</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
88
80
 
89
- <li><a href="#method-i-send">#send</a>
81
+
82
+
90
83
 
91
- <li><a href="#method-i-stop">#stop</a>
84
+
92
85
 
93
- </ul>
94
- </nav>
86
+ <dt class="r2">Includes:</dt>
87
+ <dd class="r2"><span class='object_link'><a href="../Evented.html" title="Safubot::Evented (module)">Evented</a></span></dd>
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r1 last">Defined in:</dt>
94
+ <dd class="r1 last">lib/safubot/xmpp.rb</dd>
95
+
96
+ </dl>
97
+ <div class="clear"></div>
95
98
 
96
- </div>
97
99
 
98
- <div id="project-metadata">
99
- <nav id="fileindex-section" class="section project-section">
100
- <h3 class="section-header">Pages</h3>
101
100
 
102
- <ul>
103
101
 
104
- <li class="file"><a href="../../Gemfile.html">Gemfile</a>
105
102
 
106
- <li class="file"><a href="../../Rakefile.html">Rakefile</a>
107
103
 
108
- </ul>
109
- </nav>
104
+
105
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
106
+ <ul class="summary">
107
+
108
+ <li class="public ">
109
+ <span class="summary_signature">
110
+
111
+ <a href="#client-instance_method" title="#client (instance method)">- (Object) <strong>client</strong> </a>
112
+
110
113
 
111
- <nav id="classindex-section" class="section project-section">
112
- <h3 class="section-header">Class and Module Index</h3>
114
+
115
+ </span>
116
+
117
+
118
+ <span class="note title readonly">readonly</span>
119
+
120
+
121
+
122
+
123
+
124
+
113
125
 
114
- <ul class="link-list">
115
126
 
116
- <li><a href="../../Safubot.html">Safubot</a>
127
+ <span class="summary_desc"><div class='inline'><p>
128
+ Returns the value of attribute client.
129
+ </p>
130
+ </div></span>
117
131
 
118
- <li><a href="../../Safubot/Bot.html">Safubot::Bot</a>
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#jid-instance_method" title="#jid (instance method)">- (Object) <strong>jid</strong> </a>
139
+
140
+
141
+
142
+ </span>
119
143
 
120
- <li><a href="../../Safubot/Evented.html">Safubot::Evented</a>
121
144
 
122
- <li><a href="../../Safubot/KnownUser.html">Safubot::KnownUser</a>
145
+ <span class="note title readonly">readonly</span>
146
+
123
147
 
124
- <li><a href="../../Safubot/Log.html">Safubot::Log</a>
125
148
 
126
- <li><a href="../../Safubot/Query.html">Safubot::Query</a>
127
149
 
128
- <li><a href="../../Safubot/Request.html">Safubot::Request</a>
129
150
 
130
- <li><a href="../../Safubot/Response.html">Safubot::Response</a>
131
151
 
132
- <li><a href="../../Safubot/Test.html">Safubot::Test</a>
152
+
133
153
 
134
- <li><a href="../../Safubot/Twitter.html">Safubot::Twitter</a>
154
+ <span class="summary_desc"><div class='inline'><p>
155
+ Returns the value of attribute jid.
156
+ </p>
157
+ </div></span>
135
158
 
136
- <li><a href="../../Safubot/Twitter/Bot.html">Safubot::Twitter::Bot</a>
159
+ </li>
160
+
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#state-instance_method" title="#state (instance method)">- (Object) <strong>state</strong> </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+ <span class="note title readonly">readonly</span>
173
+
137
174
 
138
- <li><a href="../../Safubot/Twitter/DirectMessage.html">Safubot::Twitter::DirectMessage</a>
139
175
 
140
- <li><a href="../../Safubot/Twitter/Tweet.html">Safubot::Twitter::Tweet</a>
141
176
 
142
- <li><a href="../../Safubot/XMPP.html">Safubot::XMPP</a>
143
177
 
144
- <li><a href="../../Safubot/XMPP/Bot.html">Safubot::XMPP::Bot</a>
145
178
 
146
- <li><a href="../../Safubot/XMPP/Message.html">Safubot::XMPP::Message</a>
179
+
147
180
 
148
- <li><a href="../../Object.html">Object</a>
181
+ <span class="summary_desc"><div class='inline'><p>
182
+ Returns the value of attribute state.
183
+ </p>
184
+ </div></span>
149
185
 
186
+ </li>
187
+
188
+
150
189
  </ul>
151
- </nav>
152
190
 
153
- </div>
154
- </nav>
155
191
 
156
- <div id="documentation">
157
- <h1 class="class">class Safubot::XMPP::Bot</h1>
158
192
 
159
- <div id="description" class="description">
193
+
194
+
195
+
196
+
197
+
198
+ <h2>
199
+ Instance Method Summary
200
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
201
+ </h2>
202
+
203
+ <ul class="summary">
204
+
205
+ <li class="public ">
206
+ <span class="summary_signature">
207
+
208
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Bot) <strong>initialize</strong>(opts) </a>
160
209
 
161
- </div><!-- description -->
162
210
 
211
+
212
+ </span>
163
213
 
214
+ <span class="note title constructor">constructor</span>
164
215
 
165
216
 
166
- <section id="5Buntitled-5D" class="documentation-section">
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <span class="summary_desc"><div class='inline'><p>
224
+ A new instance of Bot.
225
+ </p>
226
+ </div></span>
227
+
228
+ </li>
229
+
230
+
231
+ <li class="public ">
232
+ <span class="summary_signature">
233
+
234
+ <a href="#run-instance_method" title="#run (instance method)">- (Object) <strong>run</strong> </a>
167
235
 
168
236
 
169
237
 
238
+ </span>
239
+
240
+
241
+
242
+
243
+
244
+
170
245
 
246
+
247
+ <span class="summary_desc"><div class='inline'><p>
248
+ Sets our Blather::Client event processor running.
249
+ </p>
250
+ </div></span>
251
+
252
+ </li>
253
+
254
+
255
+ <li class="public ">
256
+ <span class="summary_signature">
257
+
258
+ <a href="#send-instance_method" title="#send (instance method)">- (Object) <strong>send</strong>(resp) </a>
171
259
 
172
260
 
173
261
 
174
- <!-- Attributes -->
175
- <section id="attribute-method-details" class="method-section section">
176
- <h3 class="section-header">Attributes</h3>
262
+ </span>
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <span class="summary_desc"><div class='inline'><p>
272
+ Dispatch a Response via XMPP.
273
+ </p>
274
+ </div></span>
275
+
276
+ </li>
177
277
 
178
278
 
179
- <div id="attribute-i-client" class="method-detail">
180
- <div class="method-heading attribute-method-heading">
181
- <span class="method-name">client</span><span
182
- class="attribute-access-type">[R]</span>
183
- </div>
184
-
185
- <div class="method-description">
186
-
187
-
188
-
189
- </div>
190
- </div>
191
-
192
- <div id="attribute-i-jid" class="method-detail">
193
- <div class="method-heading attribute-method-heading">
194
- <span class="method-name">jid</span><span
195
- class="attribute-access-type">[R]</span>
196
- </div>
197
-
198
- <div class="method-description">
199
-
200
-
201
-
202
- </div>
203
- </div>
204
-
205
- <div id="attribute-i-state" class="method-detail">
206
- <div class="method-heading attribute-method-heading">
207
- <span class="method-name">state</span><span
208
- class="attribute-access-type">[R]</span>
209
- </div>
210
-
211
- <div class="method-description">
212
-
213
-
214
-
215
- </div>
216
- </div>
217
-
218
- </section><!-- attribute-method-details -->
279
+ <li class="public ">
280
+ <span class="summary_signature">
219
281
 
220
-
221
- <!-- Methods -->
282
+ <a href="#stop-instance_method" title="#stop (instance method)">- (Object) <strong>stop</strong> </a>
222
283
 
223
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
224
- <h3 class="section-header">Public Class Methods</h3>
225
284
 
226
285
 
227
- <div id="method-c-new" class="method-detail ">
228
-
229
- <div class="method-heading">
230
- <span class="method-name">new</span><span
231
- class="method-args">(opts)</span>
232
- <span class="method-click-advice">click to toggle source</span>
233
- </div>
234
-
286
+ </span>
287
+
288
+
289
+
290
+
291
+
292
+
235
293
 
236
- <div class="method-description">
237
-
238
-
239
-
294
+
295
+ <span class="summary_desc"><div class='inline'><p>
296
+ Shuts down the Blather client.
297
+ </p>
298
+ </div></span>
299
+
300
+ </li>
240
301
 
241
-
242
- <div class="method-source-code" id="new-source">
243
- <pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 118</span>
244
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">opts</span>)
245
- <span class="ruby-ivar">@jid</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:jid</span>]
246
- <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:password</span>]
247
- <span class="ruby-ivar">@state</span> = <span class="ruby-value">:stopped</span>
248
- <span class="ruby-keyword">end</span></pre>
249
- </div><!-- new-source -->
250
-
251
- </div>
302
+
303
+ </ul>
304
+
252
305
 
253
-
254
306
 
255
-
256
- </div><!-- new-method -->
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Evented.html" title="Safubot::Evented (module)">Evented</a></span></h3>
315
+ <p class="inherited"><span class='object_link'><a href="../Evented.html#bind-instance_method" title="Safubot::Evented#bind (method)">#bind</a></span>, <span class='object_link'><a href="../Evented.html#emit-instance_method" title="Safubot::Evented#emit (method)">#emit</a></span>, <span class='object_link'><a href="../Evented.html#on-instance_method" title="Safubot::Evented#on (method)">#on</a></span>, <span class='object_link'><a href="../Evented.html#once-instance_method" title="Safubot::Evented#once (method)">#once</a></span>, <span class='object_link'><a href="../Evented.html#unbind-instance_method" title="Safubot::Evented#unbind (method)">#unbind</a></span></p>
316
+ <div id="constructor_details" class="method_details_list">
317
+ <h2>Constructor Details</h2>
318
+
319
+ <div class="method_details first">
320
+ <p class="signature first" id="initialize-instance_method">
321
+
322
+ - (<tt><span class='object_link'><a href="" title="Safubot::XMPP::Bot (class)">Bot</a></span></tt>) <strong>initialize</strong>(opts)
323
+
257
324
 
258
-
259
- </section><!-- public-class-method-details -->
260
325
 
261
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
262
- <h3 class="section-header">Public Instance Methods</h3>
326
+ </p><div class="docstring">
327
+ <div class="discussion">
328
+ <p>
329
+ A new instance of Bot
330
+ </p>
331
+
263
332
 
333
+ </div>
334
+ </div>
335
+ <div class="tags">
336
+
337
+
338
+ </div><table class="source_code">
339
+ <tr>
340
+ <td>
341
+ <pre class="lines">
342
+
343
+
344
+ 136
345
+ 137
346
+ 138
347
+ 139
348
+ 140</pre>
349
+ </td>
350
+ <td>
351
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 136</span>
352
+
353
+ <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id opts'>opts</span><span class='rparen'>)</span>
354
+ <span class='ivar'>@jid</span> <span class='op'>=</span> <span class='id opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:jid</span><span class='rbracket'>]</span>
355
+ <span class='ivar'>@password</span> <span class='op'>=</span> <span class='id opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:password</span><span class='rbracket'>]</span>
356
+ <span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:stopped</span>
357
+ <span class='kw'>end</span></pre>
358
+ </td>
359
+ </tr>
360
+ </table>
361
+ </div>
362
+
363
+ </div>
364
+
365
+ <div id="instance_attr_details" class="attr_details">
366
+ <h2>Instance Attribute Details</h2>
264
367
 
265
- <div id="method-i-run" class="method-detail ">
266
-
267
- <div class="method-heading">
268
- <span class="method-name">run</span><span
269
- class="method-args">()</span>
270
- <span class="method-click-advice">click to toggle source</span>
271
- </div>
272
-
368
+
369
+ <span id=""></span>
370
+ <span id="client-instance_method"></span>
371
+ <div class="method_details first">
372
+ <p class="signature first" id="client-instance_method">
373
+
374
+ - (<tt>Object</tt>) <strong>client</strong> <span class="extras">(readonly)</span>
375
+
273
376
 
274
- <div class="method-description">
275
-
276
- <p>Sets our Blather::Client event processor running.</p>
277
-
377
+
378
+ </p><div class="docstring">
379
+ <div class="discussion">
380
+ <p>
381
+ Returns the value of attribute client
382
+ </p>
278
383
 
279
-
280
- <div class="method-source-code" id="run-source">
281
- <pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 69</span>
282
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>
283
- <span class="ruby-ivar">@client</span> = <span class="ruby-constant">Blather</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-ivar">@jid</span>, <span class="ruby-ivar">@password</span>)
284
-
285
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:ready</span>) <span class="ruby-keyword">do</span>
286
- <span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;XMPP client is online at #{@client.jid.stripped} :D&quot;</span>
287
- <span class="ruby-identifier">emit</span>(<span class="ruby-value">:ready</span>)
288
- <span class="ruby-keyword">end</span>
384
+
385
+ </div>
386
+ </div>
387
+ <div class="tags">
388
+
389
+
390
+ </div><table class="source_code">
391
+ <tr>
392
+ <td>
393
+ <pre class="lines">
394
+
395
+
396
+ 74
397
+ 75
398
+ 76</pre>
399
+ </td>
400
+ <td>
401
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
402
+
403
+ <span class='kw'>def</span> <span class='id client'>client</span>
404
+ <span class='ivar'>@client</span>
405
+ <span class='kw'>end</span></pre>
406
+ </td>
407
+ </tr>
408
+ </table>
409
+ </div>
410
+
289
411
 
290
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:subscription</span>, <span class="ruby-value">:request?</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
291
- <span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;Approving subscription request from: #{s.from}&quot;</span>
292
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">approve!</span>
293
- <span class="ruby-keyword">end</span>
294
-
295
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:message</span>, <span class="ruby-value">:chat?</span>, <span class="ruby-value">:body</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">msg</span><span class="ruby-operator">|</span>
296
- <span class="ruby-keyword">unless</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^\?OTR:/</span>)
297
- <span class="ruby-identifier">emit</span>(<span class="ruby-value">:request</span>, <span class="ruby-constant">Message</span>.<span class="ruby-identifier">from</span>(<span class="ruby-identifier">msg</span>).<span class="ruby-identifier">make_request</span>)
298
- <span class="ruby-keyword">end</span>
299
- <span class="ruby-keyword">end</span>
300
-
301
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:disconnected</span>) <span class="ruby-keyword">do</span>
302
- <span class="ruby-keyword">if</span> <span class="ruby-ivar">@state</span> <span class="ruby-operator">==</span> <span class="ruby-value">:running</span>
303
- <span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span>(<span class="ruby-string">&quot;XMPP disconnected; attempting reconnection.&quot;</span>)
304
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">connect</span>
305
- <span class="ruby-keyword">end</span>
306
- <span class="ruby-keyword">end</span>
307
-
308
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">register_handler</span>(<span class="ruby-value">:error</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
309
- <span class="ruby-constant">Log</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;XMPP Error: #{e}&quot;</span>
310
- <span class="ruby-keyword">end</span>
311
-
312
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">run</span>
313
-
314
- <span class="ruby-ivar">@state</span> = <span class="ruby-value">:running</span>
315
- <span class="ruby-keyword">end</span></pre>
316
- </div><!-- run-source -->
317
-
318
- </div>
412
+ <span id=""></span>
413
+ <span id="jid-instance_method"></span>
414
+ <div class="method_details ">
415
+ <p class="signature " id="jid-instance_method">
416
+
417
+ - (<tt>Object</tt>) <strong>jid</strong> <span class="extras">(readonly)</span>
418
+
319
419
 
320
-
420
+
421
+ </p><div class="docstring">
422
+ <div class="discussion">
423
+ <p>
424
+ Returns the value of attribute jid
425
+ </p>
321
426
 
322
-
323
- </div><!-- run-method -->
324
427
 
428
+ </div>
429
+ </div>
430
+ <div class="tags">
431
+
432
+
433
+ </div><table class="source_code">
434
+ <tr>
435
+ <td>
436
+ <pre class="lines">
437
+
438
+
439
+ 74
440
+ 75
441
+ 76</pre>
442
+ </td>
443
+ <td>
444
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
445
+
446
+ <span class='kw'>def</span> <span class='id jid'>jid</span>
447
+ <span class='ivar'>@jid</span>
448
+ <span class='kw'>end</span></pre>
449
+ </td>
450
+ </tr>
451
+ </table>
452
+ </div>
325
453
 
326
- <div id="method-i-send" class="method-detail ">
327
-
328
- <div class="method-heading">
329
- <span class="method-name">send</span><span
330
- class="method-args">(resp)</span>
331
- <span class="method-click-advice">click to toggle source</span>
332
- </div>
333
-
454
+
455
+ <span id=""></span>
456
+ <span id="state-instance_method"></span>
457
+ <div class="method_details ">
458
+ <p class="signature " id="state-instance_method">
459
+
460
+ - (<tt>Object</tt>) <strong>state</strong> <span class="extras">(readonly)</span>
461
+
334
462
 
335
- <div class="method-description">
336
-
337
- <p>Dispatch a <a href="../Response.html">Response</a> via <a
338
- href="../XMPP.html">XMPP</a>.</p>
339
-
463
+
464
+ </p><div class="docstring">
465
+ <div class="discussion">
466
+ <p>
467
+ Returns the value of attribute state
468
+ </p>
340
469
 
341
-
342
- <div class="method-source-code" id="send-source">
343
- <pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 111</span>
344
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">resp</span>)
345
- <span class="ruby-identifier">msg</span> = <span class="ruby-constant">Blather</span><span class="ruby-operator">::</span><span class="ruby-constant">Stanza</span><span class="ruby-operator">::</span><span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>
346
- <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">to</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">from</span>
347
- <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">text</span>
348
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">msg</span>
349
- <span class="ruby-keyword">end</span></pre>
350
- </div><!-- send-source -->
351
-
352
- </div>
353
470
 
354
-
471
+ </div>
472
+ </div>
473
+ <div class="tags">
474
+
475
+
476
+ </div><table class="source_code">
477
+ <tr>
478
+ <td>
479
+ <pre class="lines">
480
+
481
+
482
+ 74
483
+ 75
484
+ 76</pre>
485
+ </td>
486
+ <td>
487
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 74</span>
488
+
489
+ <span class='kw'>def</span> <span class='id state'>state</span>
490
+ <span class='ivar'>@state</span>
491
+ <span class='kw'>end</span></pre>
492
+ </td>
493
+ </tr>
494
+ </table>
495
+ </div>
496
+
497
+ </div>
355
498
 
356
-
357
- </div><!-- send-method -->
358
499
 
500
+ <div id="instance_method_details" class="method_details_list">
501
+ <h2>Instance Method Details</h2>
502
+
359
503
 
360
- <div id="method-i-stop" class="method-detail ">
361
-
362
- <div class="method-heading">
363
- <span class="method-name">stop</span><span
364
- class="method-args">()</span>
365
- <span class="method-click-advice">click to toggle source</span>
366
- </div>
367
-
504
+ <div class="method_details first">
505
+ <p class="signature first" id="run-instance_method">
506
+
507
+ - (<tt>Object</tt>) <strong>run</strong>
508
+
368
509
 
369
- <div class="method-description">
370
-
371
- <p>Shuts down the Blather client.</p>
372
-
510
+
511
+ </p><div class="docstring">
512
+ <div class="discussion">
513
+ <p>
514
+ Sets our Blather::Client event processor running.
515
+ </p>
373
516
 
374
-
375
- <div class="method-source-code" id="stop-source">
376
- <pre><span class="ruby-comment"># File lib/safubot/xmpp.rb, line 105</span>
377
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">stop</span>
378
- <span class="ruby-ivar">@state</span> = <span class="ruby-value">:stopped</span>
379
- <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">close</span>
380
- <span class="ruby-keyword">end</span></pre>
381
- </div><!-- stop-source -->
382
-
383
- </div>
384
517
 
385
-
518
+ </div>
519
+ </div>
520
+ <div class="tags">
521
+
522
+
523
+ </div><table class="source_code">
524
+ <tr>
525
+ <td>
526
+ <pre class="lines">
527
+
528
+
529
+ 77
530
+ 78
531
+ 79
532
+ 80
533
+ 81
534
+ 82
535
+ 83
536
+ 84
537
+ 85
538
+ 86
539
+ 87
540
+ 88
541
+ 89
542
+ 90
543
+ 91
544
+ 92
545
+ 93
546
+ 94
547
+ 95
548
+ 96
549
+ 97
550
+ 98
551
+ 99
552
+ 100
553
+ 101
554
+ 102
555
+ 103
556
+ 104
557
+ 105
558
+ 106
559
+ 107
560
+ 108
561
+ 109
562
+ 110
563
+ 111
564
+ 112
565
+ 113
566
+ 114
567
+ 115
568
+ 116
569
+ 117
570
+ 118
571
+ 119
572
+ 120</pre>
573
+ </td>
574
+ <td>
575
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 77</span>
576
+
577
+ <span class='kw'>def</span> <span class='id run'>run</span>
578
+ <span class='ivar'>@client</span> <span class='op'>=</span> <span class='const'>Blather</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id setup'>setup</span><span class='lparen'>(</span><span class='ivar'>@jid</span><span class='comma'>,</span> <span class='ivar'>@password</span><span class='rparen'>)</span>
579
+
580
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span> <span class='kw'>do</span>
581
+ <span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>XMPP client is online at </span><span class='embexpr_beg'>#{</span><span class='ivar'>@client</span><span class='period'>.</span><span class='id jid'>jid</span><span class='period'>.</span><span class='id stripped'>stripped</span><span class='rbrace'>}</span><span class='tstring_content'> :D</span><span class='tstring_end'>&quot;</span></span>
582
+ <span class='id emit'>emit</span><span class='lparen'>(</span><span class='symbol'>:ready</span><span class='rparen'>)</span>
583
+ <span class='kw'>end</span>
584
+
585
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:subscription</span><span class='comma'>,</span> <span class='symbol'>:request?</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id s'>s</span><span class='op'>|</span>
586
+ <span class='const'>Log</span><span class='period'>.</span><span class='id info'>info</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Approving subscription request from: </span><span class='embexpr_beg'>#{</span><span class='id s'>s</span><span class='period'>.</span><span class='id from'>from</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
587
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id write'>write</span> <span class='id s'>s</span><span class='period'>.</span><span class='id approve!'>approve!</span>
588
+ <span class='kw'>end</span>
589
+
590
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:message</span><span class='comma'>,</span> <span class='symbol'>:chat?</span><span class='comma'>,</span> <span class='symbol'>:body</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id msg'>msg</span><span class='op'>|</span>
591
+ <span class='kw'>unless</span> <span class='id msg'>msg</span><span class='period'>.</span><span class='id body'>body</span><span class='period'>.</span><span class='id match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^\?OTR:</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
592
+ <span class='id emit'>emit</span><span class='lparen'>(</span><span class='symbol'>:request</span><span class='comma'>,</span> <span class='const'>Message</span><span class='period'>.</span><span class='id from'>from</span><span class='lparen'>(</span><span class='id msg'>msg</span><span class='rparen'>)</span><span class='period'>.</span><span class='id make_request'>make_request</span><span class='rparen'>)</span>
593
+ <span class='kw'>end</span>
594
+ <span class='kw'>end</span>
595
+
596
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:disconnected</span><span class='rparen'>)</span> <span class='kw'>do</span>
597
+ <span class='kw'>if</span> <span class='ivar'>@state</span> <span class='op'>==</span> <span class='symbol'>:running</span>
598
+ <span class='const'>Log</span><span class='period'>.</span><span class='id warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>XMPP disconnected; attempting reconnection in 5 seconds.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
599
+ <span class='const'>EM</span><span class='op'>::</span><span class='const'>Timer</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id connect'>connect</span> <span class='rbrace'>}</span>
600
+ <span class='kw'>end</span>
601
+ <span class='kw'>end</span>
602
+
603
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id register_handler'>register_handler</span><span class='lparen'>(</span><span class='symbol'>:error</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id e'>e</span><span class='op'>|</span>
604
+ <span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unhandled Blather error: </span><span class='embexpr_beg'>#{</span><span class='gvar'>$!</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='gvar'>$@</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
605
+ <span class='kw'>end</span>
606
+
607
+ <span class='const'>Fiber</span><span class='period'>.</span><span class='id new'>new</span> <span class='kw'>do</span>
608
+ <span class='kw'>begin</span>
609
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id run'>run</span>
610
+ <span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id e'>e</span>
611
+ <span class='kw'>if</span> <span class='id e'>e</span><span class='period'>.</span><span class='id is_a?'>is_a?</span> <span class='const'>Interrupt</span>
612
+ <span class='id raise'>raise</span> <span class='id e'>e</span>
613
+ <span class='kw'>else</span>
614
+ <span class='const'>Log</span><span class='period'>.</span><span class='id error'>error</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Blather client exited unexpectedly: </span><span class='embexpr_beg'>#{</span><span class='gvar'>$!</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='gvar'>$@</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
615
+ <span class='kw'>end</span>
616
+ <span class='kw'>end</span>
617
+ <span class='kw'>end</span><span class='period'>.</span><span class='id resume'>resume</span>
618
+
619
+ <span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:running</span>
620
+ <span class='kw'>end</span></pre>
621
+ </td>
622
+ </tr>
623
+ </table>
624
+ </div>
625
+
626
+ <div class="method_details ">
627
+ <p class="signature " id="send-instance_method">
628
+
629
+ - (<tt>Object</tt>) <strong>send</strong>(resp)
630
+
631
+
632
+
633
+ </p><div class="docstring">
634
+ <div class="discussion">
635
+ <p>
636
+ Dispatch a Response via XMPP.
637
+ </p>
386
638
 
387
-
388
- </div><!-- stop-method -->
389
639
 
640
+ </div>
641
+ </div>
642
+ <div class="tags">
643
+
644
+
645
+ </div><table class="source_code">
646
+ <tr>
647
+ <td>
648
+ <pre class="lines">
649
+
650
+
651
+ 129
652
+ 130
653
+ 131
654
+ 132
655
+ 133
656
+ 134</pre>
657
+ </td>
658
+ <td>
659
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 129</span>
660
+
661
+ <span class='kw'>def</span> <span class='id send'>send</span><span class='lparen'>(</span><span class='id resp'>resp</span><span class='rparen'>)</span>
662
+ <span class='id msg'>msg</span> <span class='op'>=</span> <span class='const'>Blather</span><span class='op'>::</span><span class='const'>Stanza</span><span class='op'>::</span><span class='const'>Message</span><span class='period'>.</span><span class='id new'>new</span>
663
+ <span class='id msg'>msg</span><span class='period'>.</span><span class='id to'>to</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><span class='period'>.</span><span class='id from'>from</span>
664
+ <span class='id msg'>msg</span><span class='period'>.</span><span class='id body'>body</span> <span class='op'>=</span> <span class='id resp'>resp</span><span class='period'>.</span><span class='id text'>text</span>
665
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id write'>write</span> <span class='id msg'>msg</span>
666
+ <span class='kw'>end</span></pre>
667
+ </td>
668
+ </tr>
669
+ </table>
670
+ </div>
390
671
 
391
- </section><!-- public-instance-method-details -->
672
+ <div class="method_details ">
673
+ <p class="signature " id="stop-instance_method">
674
+
675
+ - (<tt>Object</tt>) <strong>stop</strong>
392
676
 
393
- </section><!-- 5Buntitled-5D -->
394
677
 
395
- </div><!-- documentation -->
678
+
679
+ </p><div class="docstring">
680
+ <div class="discussion">
681
+ <p>
682
+ Shuts down the Blather client.
683
+ </p>
396
684
 
397
685
 
398
- <footer id="validator-badges">
399
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
400
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
401
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
402
- </footer>
686
+ </div>
687
+ </div>
688
+ <div class="tags">
689
+
690
+
691
+ </div><table class="source_code">
692
+ <tr>
693
+ <td>
694
+ <pre class="lines">
695
+
696
+
697
+ 123
698
+ 124
699
+ 125
700
+ 126</pre>
701
+ </td>
702
+ <td>
703
+ <pre class="code"><span class="info file"># File 'lib/safubot/xmpp.rb', line 123</span>
704
+
705
+ <span class='kw'>def</span> <span class='id stop'>stop</span>
706
+ <span class='ivar'>@state</span> <span class='op'>=</span> <span class='symbol'>:stopped</span>
707
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id close'>close</span>
708
+ <span class='kw'>end</span></pre>
709
+ </td>
710
+ </tr>
711
+ </table>
712
+ </div>
713
+
714
+ </div>
403
715
 
716
+ </div>
717
+
718
+ <div id="footer">
719
+ Generated on Mon Nov 28 20:20:04 2011 by
720
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
721
+ 0.7.3 (ruby-1.9.2).
722
+ </div>
723
+
724
+ </body>
725
+ </html>