siffer 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +65 -0
  3. data/Rakefile +64 -0
  4. data/bin/siffer +71 -0
  5. data/doc/SIF ImplementationSpecification.pdf +0 -0
  6. data/doc/rdoc/classes/Siffer.html +374 -0
  7. data/doc/rdoc/classes/Siffer/Agent.html +296 -0
  8. data/doc/rdoc/classes/Siffer/Container.html +286 -0
  9. data/doc/rdoc/classes/Siffer/Messages.html +141 -0
  10. data/doc/rdoc/classes/Siffer/Messages/Ack.html +216 -0
  11. data/doc/rdoc/classes/Siffer/Messages/Acl.html +160 -0
  12. data/doc/rdoc/classes/Siffer/Messages/Error.html +248 -0
  13. data/doc/rdoc/classes/Siffer/Messages/Message.html +359 -0
  14. data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +181 -0
  15. data/doc/rdoc/classes/Siffer/Messages/Register.html +257 -0
  16. data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +300 -0
  17. data/doc/rdoc/classes/Siffer/Messages/Status.html +269 -0
  18. data/doc/rdoc/classes/Siffer/Messaging.html +331 -0
  19. data/doc/rdoc/classes/Siffer/Protocol.html +388 -0
  20. data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +111 -0
  21. data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +111 -0
  22. data/doc/rdoc/classes/Siffer/Registration.html +391 -0
  23. data/doc/rdoc/classes/Siffer/Request.html +209 -0
  24. data/doc/rdoc/classes/Siffer/RequestLogger.html +211 -0
  25. data/doc/rdoc/classes/Siffer/Response.html +182 -0
  26. data/doc/rdoc/classes/Siffer/Server.html +242 -0
  27. data/doc/rdoc/created.rid +1 -0
  28. data/doc/rdoc/files/LICENSE.html +129 -0
  29. data/doc/rdoc/files/README_rdoc.html +184 -0
  30. data/doc/rdoc/files/lib/agent_rb.html +101 -0
  31. data/doc/rdoc/files/lib/container_rb.html +108 -0
  32. data/doc/rdoc/files/lib/messages/ack_rb.html +101 -0
  33. data/doc/rdoc/files/lib/messages/acl_rb.html +101 -0
  34. data/doc/rdoc/files/lib/messages/error_rb.html +101 -0
  35. data/doc/rdoc/files/lib/messages/message_rb.html +101 -0
  36. data/doc/rdoc/files/lib/messages/register_rb.html +101 -0
  37. data/doc/rdoc/files/lib/messages/request_body_rb.html +101 -0
  38. data/doc/rdoc/files/lib/messages/status_rb.html +101 -0
  39. data/doc/rdoc/files/lib/messages_rb.html +114 -0
  40. data/doc/rdoc/files/lib/messaging_rb.html +101 -0
  41. data/doc/rdoc/files/lib/protocol_rb.html +101 -0
  42. data/doc/rdoc/files/lib/registration_rb.html +101 -0
  43. data/doc/rdoc/files/lib/request_logger_rb.html +101 -0
  44. data/doc/rdoc/files/lib/request_rb.html +101 -0
  45. data/doc/rdoc/files/lib/response_rb.html +101 -0
  46. data/doc/rdoc/files/lib/server_rb.html +101 -0
  47. data/doc/rdoc/files/lib/siffer_rb.html +115 -0
  48. data/doc/rdoc/fr_class_index.html +47 -0
  49. data/doc/rdoc/fr_file_index.html +46 -0
  50. data/doc/rdoc/fr_method_index.html +96 -0
  51. data/doc/rdoc/index.html +24 -0
  52. data/doc/rdoc/rdoc-style.css +208 -0
  53. data/lib/agent.rb +43 -0
  54. data/lib/container.rb +96 -0
  55. data/lib/messages.rb +7 -0
  56. data/lib/messages/ack.rb +43 -0
  57. data/lib/messages/acl.rb +25 -0
  58. data/lib/messages/error.rb +174 -0
  59. data/lib/messages/message.rb +71 -0
  60. data/lib/messages/register.rb +60 -0
  61. data/lib/messages/request_body.rb +66 -0
  62. data/lib/messages/status.rb +55 -0
  63. data/lib/messaging.rb +96 -0
  64. data/lib/protocol.rb +159 -0
  65. data/lib/registration.rb +87 -0
  66. data/lib/request.rb +25 -0
  67. data/lib/request_logger.rb +31 -0
  68. data/lib/response.rb +26 -0
  69. data/lib/server.rb +40 -0
  70. data/lib/siffer.rb +44 -0
  71. data/spec/agent_spec.rb +53 -0
  72. data/spec/cli_spec.rb +40 -0
  73. data/spec/container_spec.rb +103 -0
  74. data/spec/default_agent +6 -0
  75. data/spec/default_server +5 -0
  76. data/spec/message_specs/ack_spec.rb +28 -0
  77. data/spec/message_specs/error_spec.rb +24 -0
  78. data/spec/message_specs/header_spec.rb +25 -0
  79. data/spec/message_specs/message_spec.rb +57 -0
  80. data/spec/message_specs/register_spec.rb +86 -0
  81. data/spec/message_specs/request_body_spec.rb +58 -0
  82. data/spec/message_specs/status_spec.rb +25 -0
  83. data/spec/messaging_spec.rb +88 -0
  84. data/spec/protocol_spec.rb +49 -0
  85. data/spec/registration_spec.rb +33 -0
  86. data/spec/request_logger_spec.rb +15 -0
  87. data/spec/request_spec.rb +10 -0
  88. data/spec/response_spec.rb +24 -0
  89. data/spec/server_spec.rb +35 -0
  90. data/spec/spec_helper.rb +26 -0
  91. metadata +191 -0
@@ -0,0 +1,388 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: Siffer::Protocol</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">Siffer::Protocol</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/protocol_rb.html">
59
+ lib/protocol.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+ <div id="description">
76
+ <p>
77
+ The <a href="Protocol.html">Protocol</a> module deals with the transport
78
+ validation. Provides constants for HTTP statuses as well as acceptable
79
+ paths for <a href="../Siffer.html">Siffer</a> Servers and Agents.
80
+ </p>
81
+
82
+ </div>
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000008">check_path_against_protocol</a>&nbsp;&nbsp;
92
+ <a href="#M000011">error_response</a>&nbsp;&nbsp;
93
+ <a href="#M000012">no_response_available</a>&nbsp;&nbsp;
94
+ <a href="#M000007">request_failed_protocol?</a>&nbsp;&nbsp;
95
+ <a href="#M000009">uri</a>&nbsp;&nbsp;
96
+ <a href="#M000010">with_each_request</a>&nbsp;&nbsp;
97
+ </div>
98
+ </div>
99
+
100
+ </div>
101
+
102
+
103
+ <!-- if includes -->
104
+ <div id="includes">
105
+ <h3 class="section-bar">Included Modules</h3>
106
+
107
+ <div id="includes-list">
108
+ <span class="include-name"><a href="Messages.html">Siffer::Messages</a></span>
109
+ <span class="include-name"><a href="Messaging.html">Siffer::Messaging</a></span>
110
+ </div>
111
+ </div>
112
+
113
+ <div id="section">
114
+
115
+ <div id="class-list">
116
+ <h3 class="section-bar">Classes and Modules</h3>
117
+
118
+ Class <a href="Protocol/NonPostRequest.html" class="link">Siffer::Protocol::NonPostRequest</a><br />
119
+ Class <a href="Protocol/UnknownPath.html" class="link">Siffer::Protocol::UnknownPath</a><br />
120
+
121
+ </div>
122
+
123
+ <div id="constants-list">
124
+ <h3 class="section-bar">Constants</h3>
125
+
126
+ <div class="name-list">
127
+ <table summary="Constants">
128
+ <tr class="top-aligned-row context-row">
129
+ <td class="context-item-name">ACCEPTABLE_PATHS</td>
130
+ <td>=</td>
131
+ <td class="context-item-value">{ :root =&gt; &quot;/&quot;, :ping =&gt; &quot;/ping&quot;, :status =&gt; &quot;/status&quot;, :register =&gt; &quot;/register&quot;</td>
132
+ <td width="3em">&nbsp;</td>
133
+ <td class="context-item-desc">
134
+ Paths that comply with the messaging protocol determined by the SIF
135
+ Specification. These are <a href="../Siffer.html">Siffer</a> specific and
136
+ not spelled out in SIF Specification (rather implied). Each path will
137
+ generate it&#8216;s own predicate method (i.e. ping?) that can be used to
138
+ determine the requests path based on the content of the message or the
139
+ path-info of the request.
140
+
141
+ </td>
142
+ </tr>
143
+ <tr class="top-aligned-row context-row">
144
+ <td class="context-item-name">HTTP_STATUS_CODES</td>
145
+ <td>=</td>
146
+ <td class="context-item-value">{ 100 =&gt; 'Continue', 101 =&gt; 'Switching Protocols', 200 =&gt; 'OK', 201 =&gt; 'Created', 202 =&gt; 'Accepted', 203 =&gt; 'Non-Authoritative Information', 204 =&gt; 'No Content', 205 =&gt; 'Reset Content', 206 =&gt; 'Partial Content', 300 =&gt; 'Multiple Choices', 301 =&gt; 'Moved Permanently', 302 =&gt; 'Moved Temporarily', 303 =&gt; 'See Other', 304 =&gt; 'Not Modified', 305 =&gt; 'Use Proxy', 400 =&gt; 'Bad Request', 401 =&gt; 'Unauthorized', 402 =&gt; 'Payment Required', 403 =&gt; 'Forbidden', 404 =&gt; 'Not Found', 405 =&gt; 'Method Not Allowed', 406 =&gt; 'Not Acceptable', 407 =&gt; 'Proxy Authentication Required', 408 =&gt; 'Request Time-out', 409 =&gt; 'Conflict', 410 =&gt; 'Gone', 411 =&gt; 'Length Required', 412 =&gt; 'Precondition Failed', 413 =&gt; 'Request Entity Too Large', 414 =&gt; 'Request-URI Too Large', 415 =&gt; 'Unsupported Media Type', 500 =&gt; 'Internal Server Error', 501 =&gt; 'Not Implemented', 502 =&gt; 'Bad Gateway', 503 =&gt; 'Service Unavailable', 504 =&gt; 'Gateway Time-out', 505 =&gt; 'HTTP Version not supported'</td>
147
+ <td width="3em">&nbsp;</td>
148
+ <td class="context-item-desc">
149
+ Every standard HTTP code mapped to the appropriate message. Stolen from
150
+ Mongrel.
151
+
152
+ </td>
153
+ </tr>
154
+ </table>
155
+ </div>
156
+ </div>
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <!-- if method_list -->
164
+ <div id="methods">
165
+ <h3 class="section-bar">Public Instance methods</h3>
166
+
167
+ <div id="method-M000008" class="method-detail">
168
+ <a name="M000008"></a>
169
+
170
+ <div class="method-heading">
171
+ <a href="#M000008" class="method-signature">
172
+ <span class="method-name">check_path_against_protocol</span><span class="method-args">()</span>
173
+ </a>
174
+ </div>
175
+
176
+ <div class="method-description">
177
+ <p>
178
+ Validates the request object against the Acceptable Paths (<a
179
+ href="../Siffer.html">Siffer</a> spec) and that the request is a POST.
180
+ </p>
181
+ <p><a class="source-toggle" href="#"
182
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
183
+ <div class="method-source-code" id="M000008-source">
184
+ <pre>
185
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 34</span>
186
+ 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_path_against_protocol</span>
187
+ 35: <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">ACCEPTABLE_PATHS</span>.<span class="ruby-identifier">has_value?</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">path_info</span>
188
+ 36: <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownPath</span>
189
+ 37: <span class="ruby-keyword kw">end</span>
190
+ 38: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">post?</span>
191
+ 39: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NonPostRequest</span>
192
+ 40: <span class="ruby-keyword kw">end</span>
193
+ 41: <span class="ruby-keyword kw">end</span>
194
+ </pre>
195
+ </div>
196
+ </div>
197
+ </div>
198
+
199
+ <div id="method-M000011" class="method-detail">
200
+ <a name="M000011"></a>
201
+
202
+ <div class="method-heading">
203
+ <a href="#M000011" class="method-signature">
204
+ <span class="method-name">error_response</span><span class="method-args">(category,code, desc = nil)</span>
205
+ </a>
206
+ </div>
207
+
208
+ <div class="method-description">
209
+ <p>
210
+ Sets the @response to a <a
211
+ href="Messages/Ack.html">Siffer::Messages::Ack</a> message with the
212
+ appropriate Error category and code. Optional description is allowed and
213
+ placed in the ExtendedDesc node.
214
+ </p>
215
+ <p><a class="source-toggle" href="#"
216
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
217
+ <div class="method-source-code" id="M000011-source">
218
+ <pre>
219
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 70</span>
220
+ 70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error_response</span>(<span class="ruby-identifier">category</span>,<span class="ruby-identifier">code</span>, <span class="ruby-identifier">desc</span> = <span class="ruby-keyword kw">nil</span>)
221
+ 71: <span class="ruby-identifier">error</span> = <span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">category</span>,<span class="ruby-identifier">code</span>,<span class="ruby-identifier">desc</span>)
222
+ 72: <span class="ruby-identifier">ack</span> = <span class="ruby-constant">Ack</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">original</span>, <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>)
223
+ 73: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ack</span>)
224
+ 74: <span class="ruby-keyword kw">end</span>
225
+ </pre>
226
+ </div>
227
+ </div>
228
+ </div>
229
+
230
+ <div id="method-M000012" class="method-detail">
231
+ <a name="M000012"></a>
232
+
233
+ <div class="method-heading">
234
+ <a href="#M000012" class="method-signature">
235
+ <span class="method-name">no_response_available</span><span class="method-args">()</span>
236
+ </a>
237
+ </div>
238
+
239
+ <div class="method-description">
240
+ <p>
241
+ Determines if there is a response instance created. If not it creates one
242
+ with an Ack/Error describing not having anything to process.
243
+ </p>
244
+ <p><a class="source-toggle" href="#"
245
+ onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
246
+ <div class="method-source-code" id="M000012-source">
247
+ <pre>
248
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 79</span>
249
+ 79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">no_response_available</span>
250
+ 80: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">nil?</span>
251
+ 81: <span class="ruby-identifier">err</span> = <span class="ruby-value str">&quot;You are receiving this message because you failed to \nprovide enough information to respond to. This is likely due\nto the message type missing (i.e. Register,Provide) or possibly\nnot enough information to process effectively. Please check the \nmessage you are sending and resend after any corrections.\n&quot;</span>
252
+ 82: <span class="ruby-operator">!</span><span class="ruby-identifier">error_response</span>(<span class="ruby-value">12</span>,<span class="ruby-value">1</span>,<span class="ruby-identifier">err</span>)
253
+ 83: <span class="ruby-keyword kw">end</span>
254
+ 84: <span class="ruby-keyword kw">end</span>
255
+ </pre>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <div id="method-M000007" class="method-detail">
261
+ <a name="M000007"></a>
262
+
263
+ <div class="method-heading">
264
+ <a href="#M000007" class="method-signature">
265
+ <span class="method-name">request_failed_protocol?</span><span class="method-args">()</span>
266
+ </a>
267
+ </div>
268
+
269
+ <div class="method-description">
270
+ <p>
271
+ Checks the incoming request against the following protocol constraints:
272
+ </p>
273
+ <ul>
274
+ <li>Unknown PATH
275
+
276
+ </li>
277
+ <li>Non-POST request
278
+
279
+ </li>
280
+ </ul>
281
+ <p><a class="source-toggle" href="#"
282
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
283
+ <div class="method-source-code" id="M000007-source">
284
+ <pre>
285
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 16</span>
286
+ 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_failed_protocol?</span>
287
+ 17: <span class="ruby-keyword kw">begin</span>
288
+ 18: <span class="ruby-identifier">check_path_against_protocol</span>
289
+ 19: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">UnknownPath</span>
290
+ 20: <span class="ruby-comment cmt"># TODO: Make a better Not Found response</span>
291
+ 21: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-value">404</span>],
292
+ 22: <span class="ruby-value">404</span>,
293
+ 23: {<span class="ruby-value str">&quot;Content-Type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-value str">&quot;htm&quot;</span>]})
294
+ 24: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NonPostRequest</span>
295
+ 25: <span class="ruby-comment cmt"># TODO: Make a better Method Not Allowed response</span>
296
+ 26: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-value">405</span>],
297
+ 27: <span class="ruby-value">405</span>,
298
+ 28: {<span class="ruby-value str">&quot;Content-Type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messaging</span><span class="ruby-operator">::</span><span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-value str">&quot;htm&quot;</span>]})
299
+ 29: <span class="ruby-keyword kw">end</span>
300
+ 30: <span class="ruby-keyword kw">end</span>
301
+ </pre>
302
+ </div>
303
+ </div>
304
+ </div>
305
+
306
+ <div id="method-M000009" class="method-detail">
307
+ <a name="M000009"></a>
308
+
309
+ <div class="method-heading">
310
+ <a href="#M000009" class="method-signature">
311
+ <span class="method-name">uri</span><span class="method-args">()</span>
312
+ </a>
313
+ </div>
314
+
315
+ <div class="method-description">
316
+ <p>
317
+ Returns the URI of the component (<a href="Server.html">Server</a> or <a
318
+ href="Agent.html">Agent</a>)
319
+ </p>
320
+ <p><a class="source-toggle" href="#"
321
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
322
+ <div class="method-source-code" id="M000009-source">
323
+ <pre>
324
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 44</span>
325
+ 44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uri</span>
326
+ 45: <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;http://#{host}:#{port}&quot;</span>).<span class="ruby-identifier">to_s</span>
327
+ 46: <span class="ruby-keyword kw">end</span>
328
+ </pre>
329
+ </div>
330
+ </div>
331
+ </div>
332
+
333
+ <div id="method-M000010" class="method-detail">
334
+ <a name="M000010"></a>
335
+
336
+ <div class="method-heading">
337
+ <a href="#M000010" class="method-signature">
338
+ <span class="method-name">with_each_request</span><span class="method-args">(env) {|if block_given?| ...}</span>
339
+ </a>
340
+ </div>
341
+
342
+ <div class="method-description">
343
+ <pre>
344
+ Provides a context for each request. Creates the @request, @response and
345
+ @original objects to use throughout the call.
346
+ Validates against Protocol as well as Messaging using #request_failed
347
+ predicates respectively.
348
+
349
+ Yields the block if provided to allow further processing.
350
+ </pre>
351
+ <p>
352
+ Finishes by calling finish on the response object or returns the generic
353
+ </p>
354
+ <pre>
355
+ response message.
356
+ </pre>
357
+ <p><a class="source-toggle" href="#"
358
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
359
+ <div class="method-source-code" id="M000010-source">
360
+ <pre>
361
+ <span class="ruby-comment cmt"># File lib/protocol.rb, line 57</span>
362
+ 57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_each_request</span>(<span class="ruby-identifier">env</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
363
+ 58: <span class="ruby-ivar">@request</span> = <span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
364
+ 59: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request_failed_protocol?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">request_failed_messaging?</span>
365
+ 60: <span class="ruby-identifier">using_message_from</span> <span class="ruby-ivar">@request</span> <span class="ruby-keyword kw">do</span> <span class="ruby-comment cmt"># possibly a concurrency issue here</span>
366
+ 61: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
367
+ 62: <span class="ruby-keyword kw">end</span>
368
+ 63: <span class="ruby-keyword kw">end</span>
369
+ 64: <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">finish</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">no_response_available</span>
370
+ 65: <span class="ruby-keyword kw">end</span>
371
+ </pre>
372
+ </div>
373
+ </div>
374
+ </div>
375
+
376
+
377
+ </div>
378
+
379
+
380
+ </div>
381
+
382
+
383
+ <div id="validator-badges">
384
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
385
+ </div>
386
+
387
+ </body>
388
+ </html>
@@ -0,0 +1,111 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Siffer::Protocol::NonPostRequest</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Siffer::Protocol::NonPostRequest</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/protocol_rb.html">
59
+ lib/protocol.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Exception
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+
86
+ </div>
87
+
88
+
89
+ <!-- if includes -->
90
+
91
+ <div id="section">
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <!-- if method_list -->
101
+
102
+
103
+ </div>
104
+
105
+
106
+ <div id="validator-badges">
107
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
108
+ </div>
109
+
110
+ </body>
111
+ </html>