clavem 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Clavem::Exceptions
8
8
 
9
- &mdash; Documentation by YARD 0.8.6.2
9
+ &mdash; Documentation by YARD 0.8.7
10
10
 
11
11
  </title>
12
12
 
@@ -100,7 +100,7 @@
100
100
 
101
101
 
102
102
 
103
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Exceptions/AuthorizationDenied.html" title="Clavem::Exceptions::AuthorizationDenied (class)">AuthorizationDenied</a></span>, <span class='object_link'><a href="Exceptions/Failure.html" title="Clavem::Exceptions::Failure (class)">Failure</a></span>, <span class='object_link'><a href="Exceptions/Timeout.html" title="Clavem::Exceptions::Timeout (class)">Timeout</a></span>
103
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Exceptions/Failure.html" title="Clavem::Exceptions::Failure (class)">Failure</a></span>
104
104
 
105
105
 
106
106
  </p>
@@ -116,9 +116,9 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sat Jul 20 13:46:58 2013 by
119
+ Generated on Wed Aug 21 16:17:53 2013 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
- 0.8.6.2 (ruby-1.9.3).
121
+ 0.8.7 (ruby-2.0.0).
122
122
  </div>
123
123
 
124
124
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Clavem::Exceptions::Failure
8
8
 
9
- &mdash; Documentation by YARD 0.8.6.2
9
+ &mdash; Documentation by YARD 0.8.7
10
10
 
11
11
  </title>
12
12
 
@@ -73,12 +73,12 @@
73
73
 
74
74
  <dt class="r1">Inherits:</dt>
75
75
  <dd class="r1">
76
- <span class="inheritName">Exception</span>
76
+ <span class="inheritName">StandardError</span>
77
77
 
78
78
  <ul class="fullTree">
79
79
  <li>Object</li>
80
80
 
81
- <li class="next">Exception</li>
81
+ <li class="next">StandardError</li>
82
82
 
83
83
  <li class="next">Clavem::Exceptions::Failure</li>
84
84
 
@@ -124,9 +124,9 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Sat Jul 20 13:46:58 2013 by
127
+ Generated on Wed Aug 21 16:17:53 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
- 0.8.6.2 (ruby-1.9.3).
129
+ 0.8.7 (ruby-2.0.0).
130
130
  </div>
131
131
 
132
132
  </body>
@@ -0,0 +1,370 @@
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: Clavem::Server
8
+
9
+ &mdash; Documentation by YARD 0.8.7
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (S)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Clavem.html" title="Clavem (module)">Clavem</a></span></span>
36
+ &raquo;
37
+ <span class="title">Server</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Clavem::Server
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">EM::Connection</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">EM::Connection</li>
82
+
83
+ <li class="next">Clavem::Server</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dt class="r2">Includes:</dt>
96
+ <dd class="r2">EM::HttpServer</dd>
97
+
98
+
99
+
100
+
101
+
102
+ <dt class="r1 last">Defined in:</dt>
103
+ <dd class="r1 last">lib/clavem/server.rb</dd>
104
+
105
+ </dl>
106
+ <div class="clear"></div>
107
+
108
+ <h2>Overview</h2><div class="docstring">
109
+ <div class="discussion">
110
+ <p>A class to handle oAuth callbacks on the browser via HTTP.</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+
118
+ </div>
119
+ <h2>Constant Summary</h2>
120
+
121
+ <dl class="constants">
122
+
123
+ <dt id="TEMPLATE-constant" class="">TEMPLATE =
124
+ <div class="docstring">
125
+ <div class="discussion">
126
+ <p>The template to send to the browser.</p>
127
+
128
+
129
+ </div>
130
+ </div>
131
+ <div class="tags">
132
+
133
+
134
+ </div>
135
+ </dt>
136
+ <dd><pre class="code"><span class='heredoc_beg'>&lt;&lt;-EOTEMPLATE</span>
137
+ <span class='tstring_content'>&lt;html&gt;
138
+ &lt;head&gt;
139
+ &lt;title&gt;Clavem&lt;/title&gt;
140
+ &lt;script type=&quot;text/javascript&quot;&gt; close_window = (function(){ window.open(&quot;&quot;, &quot;_self&quot;, &quot;&quot;); window.close(); })(); &lt;/script&gt;
141
+ &lt;/head&gt;
142
+ &lt;body&gt;&lt;h4&gt;%s&lt;/h4&gt;&lt;/body&gt;
143
+ &lt;/html&gt;
144
+ </span><span class='heredoc_end'>EOTEMPLATE</span></pre></dd>
145
+
146
+ </dl>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <h2>
157
+ Instance Method Summary
158
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
159
+ </h2>
160
+
161
+ <ul class="summary">
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Server) <strong>initialize</strong>(authorizer) </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+ <span class="note title constructor">constructor</span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ <span class="summary_desc"><div class='inline'><p>Creates a new server.</p>
183
+ </div></span>
184
+
185
+ </li>
186
+
187
+
188
+ <li class="public ">
189
+ <span class="summary_signature">
190
+
191
+ <a href="#process_http_request-instance_method" title="#process_http_request (instance method)">- (Object) <strong>process_http_request</strong> </a>
192
+
193
+
194
+
195
+ </span>
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ <span class="summary_desc"><div class='inline'><p>Save the token and sends a response back to the user.</p>
206
+ </div></span>
207
+
208
+ </li>
209
+
210
+
211
+ </ul>
212
+
213
+
214
+
215
+
216
+ <div id="constructor_details" class="method_details_list">
217
+ <h2>Constructor Details</h2>
218
+
219
+ <div class="method_details first">
220
+ <h3 class="signature first" id="initialize-instance_method">
221
+
222
+ - (<tt><span class='object_link'><a href="" title="Clavem::Server (class)">Server</a></span></tt>) <strong>initialize</strong>(authorizer)
223
+
224
+
225
+
226
+
227
+
228
+ </h3><div class="docstring">
229
+ <div class="discussion">
230
+ <p>Creates a new server.</p>
231
+
232
+
233
+ </div>
234
+ </div>
235
+ <div class="tags">
236
+ <p class="tag_title">Parameters:</p>
237
+ <ul class="param">
238
+
239
+ <li>
240
+
241
+ <span class='name'>authorizer</span>
242
+
243
+
244
+ <span class='type'>(<tt><span class='object_link'><a href="Authorizer.html" title="Clavem::Authorizer (class)">Authorizer</a></span></tt>)</span>
245
+
246
+
247
+
248
+ &mdash;
249
+ <div class='inline'><p>The authorizer of this server.</p>
250
+ </div>
251
+
252
+ </li>
253
+
254
+ </ul>
255
+
256
+
257
+ </div><table class="source_code">
258
+ <tr>
259
+ <td>
260
+ <pre class="lines">
261
+
262
+
263
+ 26
264
+ 27
265
+ 28</pre>
266
+ </td>
267
+ <td>
268
+ <pre class="code"><span class="info file"># File 'lib/clavem/server.rb', line 26</span>
269
+
270
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_authorizer'>authorizer</span><span class='rparen'>)</span>
271
+ <span class='ivar'>@authorizer</span> <span class='op'>=</span> <span class='id identifier rubyid_authorizer'>authorizer</span>
272
+ <span class='kw'>end</span></pre>
273
+ </td>
274
+ </tr>
275
+ </table>
276
+ </div>
277
+
278
+ </div>
279
+
280
+
281
+ <div id="instance_method_details" class="method_details_list">
282
+ <h2>Instance Method Details</h2>
283
+
284
+
285
+ <div class="method_details first">
286
+ <h3 class="signature first" id="process_http_request-instance_method">
287
+
288
+ - (<tt>Object</tt>) <strong>process_http_request</strong>
289
+
290
+
291
+
292
+
293
+
294
+ </h3><div class="docstring">
295
+ <div class="discussion">
296
+ <p>Save the token and sends a response back to the user.</p>
297
+
298
+
299
+ </div>
300
+ </div>
301
+ <div class="tags">
302
+
303
+
304
+ </div><table class="source_code">
305
+ <tr>
306
+ <td>
307
+ <pre class="lines">
308
+
309
+
310
+ 31
311
+ 32
312
+ 33
313
+ 34
314
+ 35
315
+ 36
316
+ 37
317
+ 38
318
+ 39
319
+ 40
320
+ 41
321
+ 42
322
+ 43
323
+ 44
324
+ 45
325
+ 46
326
+ 47
327
+ 48
328
+ 49
329
+ 50</pre>
330
+ </td>
331
+ <td>
332
+ <pre class="code"><span class="info file"># File 'lib/clavem/server.rb', line 31</span>
333
+
334
+ <span class='kw'>def</span> <span class='id identifier rubyid_process_http_request'>process_http_request</span>
335
+ <span class='comment'># Handle the token
336
+ </span> <span class='id identifier rubyid_token'>token</span> <span class='op'>=</span> <span class='ivar'>@authorizer</span><span class='period'>.</span><span class='id identifier rubyid_response_handler'>response_handler</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='const'>CGI</span><span class='op'>::</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='ivar'>@http_query_string</span><span class='rparen'>)</span><span class='rparen'>)</span>
337
+ <span class='kw'>if</span> <span class='id identifier rubyid_token'>token</span> <span class='kw'>then</span>
338
+ <span class='ivar'>@authorizer</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span> <span class='op'>=</span> <span class='id identifier rubyid_token'>token</span>
339
+ <span class='ivar'>@authorizer</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='symbol'>:succeeded</span>
340
+ <span class='kw'>else</span>
341
+ <span class='ivar'>@authorizer</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='symbol'>:denied</span>
342
+ <span class='kw'>end</span>
343
+
344
+ <span class='comment'># Build the request
345
+ </span> <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>EM</span><span class='op'>::</span><span class='const'>DelegatedHttpResponse</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
346
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='int'>200</span>
347
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_content_type'>content_type</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>text/html</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
348
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='const'>TEMPLATE</span> <span class='op'>%</span> <span class='lbracket'>[</span><span class='ivar'>@authorizer</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_template'>template</span><span class='rbracket'>]</span>
349
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_send_response'>send_response</span>
350
+
351
+ <span class='comment'># Stop after serving the request.
352
+ </span> <span class='const'>EM</span><span class='period'>.</span><span class='id identifier rubyid_add_timer'>add_timer</span><span class='lparen'>(</span><span class='float'>0.1</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='const'>EM</span><span class='period'>.</span><span class='id identifier rubyid_stop'>stop</span> <span class='rbrace'>}</span>
353
+ <span class='kw'>end</span></pre>
354
+ </td>
355
+ </tr>
356
+ </table>
357
+ </div>
358
+
359
+ </div>
360
+
361
+ </div>
362
+
363
+ <div id="footer">
364
+ Generated on Wed Aug 21 16:17:53 2013 by
365
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
366
+ 0.8.7 (ruby-2.0.0).
367
+ </div>
368
+
369
+ </body>
370
+ </html>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Clavem::Version
8
8
 
9
- &mdash; Documentation by YARD 0.8.6.2
9
+ &mdash; Documentation by YARD 0.8.7
10
10
 
11
11
  </title>
12
12
 
@@ -119,7 +119,7 @@
119
119
 
120
120
  </div>
121
121
  </dt>
122
- <dd><pre class="code"><span class='int'>1</span></pre></dd>
122
+ <dd><pre class="code"><span class='int'>2</span></pre></dd>
123
123
 
124
124
  <dt id="MINOR-constant" class="">MINOR =
125
125
  <div class="docstring">
@@ -134,7 +134,7 @@
134
134
 
135
135
  </div>
136
136
  </dt>
137
- <dd><pre class="code"><span class='int'>4</span></pre></dd>
137
+ <dd><pre class="code"><span class='int'>0</span></pre></dd>
138
138
 
139
139
  <dt id="PATCH-constant" class="">PATCH =
140
140
  <div class="docstring">
@@ -180,9 +180,9 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Sat Jul 20 13:46:58 2013 by
183
+ Generated on Wed Aug 21 16:17:53 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
- 0.8.6.2 (ruby-1.9.3).
185
+ 0.8.7 (ruby-2.0.0).
186
186
  </div>
187
187
 
188
188
  </body>