siffer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/Rakefile +2 -2
  2. data/doc/rdoc/classes/Siffer.html +253 -368
  3. data/doc/rdoc/classes/Siffer/Agent.html +169 -288
  4. data/doc/rdoc/classes/Siffer/Container.html +158 -279
  5. data/doc/rdoc/classes/Siffer/Messages.html +79 -139
  6. data/doc/rdoc/classes/Siffer/Messages/Ack.html +109 -210
  7. data/doc/rdoc/classes/Siffer/Messages/Acl.html +78 -155
  8. data/doc/rdoc/classes/Siffer/Messages/Error.html +151 -242
  9. data/doc/rdoc/classes/Siffer/Messages/Message.html +227 -351
  10. data/doc/rdoc/classes/Siffer/Messages/Message/Header.html +102 -176
  11. data/doc/rdoc/classes/Siffer/Messages/Register.html +147 -250
  12. data/doc/rdoc/classes/Siffer/Messages/RequestBody.html +177 -292
  13. data/doc/rdoc/classes/Siffer/Messages/Status.html +149 -262
  14. data/doc/rdoc/classes/Siffer/Messaging.html +204 -323
  15. data/doc/rdoc/classes/Siffer/Protocol.html +246 -380
  16. data/doc/rdoc/classes/Siffer/Protocol/NonPostRequest.html +53 -110
  17. data/doc/rdoc/classes/Siffer/Protocol/UnknownPath.html +53 -110
  18. data/doc/rdoc/classes/Siffer/Registration.html +243 -383
  19. data/doc/rdoc/classes/Siffer/Request.html +97 -203
  20. data/doc/rdoc/classes/Siffer/RequestLogger.html +102 -204
  21. data/doc/rdoc/classes/Siffer/Response.html +85 -176
  22. data/doc/rdoc/classes/Siffer/Server.html +150 -236
  23. data/doc/rdoc/created.rid +1 -1
  24. data/doc/rdoc/files/LICENSE.html +75 -128
  25. data/doc/rdoc/files/README_rdoc.html +130 -183
  26. data/doc/rdoc/files/lib/siffer/agent_rb.html +49 -0
  27. data/doc/rdoc/files/lib/siffer/container_rb.html +57 -0
  28. data/doc/rdoc/files/lib/siffer/messages/ack_rb.html +49 -0
  29. data/doc/rdoc/files/lib/siffer/messages/acl_rb.html +49 -0
  30. data/doc/rdoc/files/lib/siffer/messages/error_rb.html +49 -0
  31. data/doc/rdoc/files/lib/siffer/messages/message_rb.html +49 -0
  32. data/doc/rdoc/files/lib/siffer/messages/register_rb.html +49 -0
  33. data/doc/rdoc/files/lib/siffer/messages/request_body_rb.html +49 -0
  34. data/doc/rdoc/files/lib/siffer/messages/status_rb.html +49 -0
  35. data/doc/rdoc/files/lib/siffer/messages_rb.html +63 -0
  36. data/doc/rdoc/files/lib/siffer/messaging_rb.html +49 -0
  37. data/doc/rdoc/files/lib/siffer/protocol_rb.html +49 -0
  38. data/doc/rdoc/files/lib/siffer/registration_rb.html +49 -0
  39. data/doc/rdoc/files/lib/siffer/request_logger_rb.html +49 -0
  40. data/doc/rdoc/files/lib/siffer/request_rb.html +49 -0
  41. data/doc/rdoc/files/lib/siffer/response_rb.html +49 -0
  42. data/doc/rdoc/files/lib/siffer/server_rb.html +49 -0
  43. data/doc/rdoc/files/lib/siffer_rb.html +62 -113
  44. data/doc/rdoc/fr_class_index.html +25 -47
  45. data/doc/rdoc/fr_file_index.html +39 -46
  46. data/doc/rdoc/fr_method_index.html +4539 -96
  47. data/doc/rdoc/index.html +14 -23
  48. data/doc/rdoc/rdoc-style.css +314 -203
  49. data/lib/siffer.rb +6 -6
  50. data/lib/{agent.rb → siffer/agent.rb} +5 -3
  51. data/lib/{container.rb → siffer/container.rb} +3 -5
  52. data/lib/siffer/messages.rb +7 -0
  53. data/lib/{messages → siffer/messages}/ack.rb +0 -0
  54. data/lib/{messages → siffer/messages}/acl.rb +0 -0
  55. data/lib/{messages → siffer/messages}/error.rb +0 -0
  56. data/lib/{messages → siffer/messages}/message.rb +0 -0
  57. data/lib/{messages → siffer/messages}/register.rb +0 -0
  58. data/lib/{messages → siffer/messages}/request_body.rb +0 -0
  59. data/lib/{messages → siffer/messages}/status.rb +0 -0
  60. data/lib/{messaging.rb → siffer/messaging.rb} +8 -5
  61. data/lib/{protocol.rb → siffer/protocol.rb} +37 -32
  62. data/lib/{registration.rb → siffer/registration.rb} +2 -2
  63. data/lib/siffer/request.rb +28 -0
  64. data/lib/{request_logger.rb → siffer/request_logger.rb} +8 -7
  65. data/lib/{response.rb → siffer/response.rb} +1 -1
  66. data/lib/{server.rb → siffer/server.rb} +5 -3
  67. data/spec/agent_spec.rb +6 -11
  68. data/spec/container_spec.rb +2 -2
  69. data/spec/default_agent +1 -1
  70. data/spec/messaging_spec.rb +3 -6
  71. data/spec/protocol_spec.rb +27 -26
  72. data/spec/registration_spec.rb +2 -2
  73. data/spec/request_logger_spec.rb +22 -9
  74. data/spec/request_spec.rb +15 -0
  75. data/spec/response_spec.rb +2 -2
  76. data/spec/server_spec.rb +0 -5
  77. data/spec/spec_helper.rb +9 -0
  78. metadata +40 -38
  79. data/doc/rdoc/files/lib/agent_rb.html +0 -101
  80. data/doc/rdoc/files/lib/container_rb.html +0 -108
  81. data/doc/rdoc/files/lib/messages/ack_rb.html +0 -101
  82. data/doc/rdoc/files/lib/messages/acl_rb.html +0 -101
  83. data/doc/rdoc/files/lib/messages/error_rb.html +0 -101
  84. data/doc/rdoc/files/lib/messages/message_rb.html +0 -101
  85. data/doc/rdoc/files/lib/messages/register_rb.html +0 -101
  86. data/doc/rdoc/files/lib/messages/request_body_rb.html +0 -101
  87. data/doc/rdoc/files/lib/messages/status_rb.html +0 -101
  88. data/doc/rdoc/files/lib/messages_rb.html +0 -114
  89. data/doc/rdoc/files/lib/messaging_rb.html +0 -101
  90. data/doc/rdoc/files/lib/protocol_rb.html +0 -101
  91. data/doc/rdoc/files/lib/registration_rb.html +0 -101
  92. data/doc/rdoc/files/lib/request_logger_rb.html +0 -101
  93. data/doc/rdoc/files/lib/request_rb.html +0 -101
  94. data/doc/rdoc/files/lib/response_rb.html +0 -101
  95. data/doc/rdoc/files/lib/server_rb.html +0 -101
  96. data/lib/messages.rb +0 -7
  97. data/lib/request.rb +0 -25
@@ -1,209 +1,103 @@
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::Request</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::Request</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/request_rb.html">
59
- lib/request.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
- Rack::Request
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
- <div id="description">
82
- <p>
83
- <a href="Request.html">Request</a> represents each <a
84
- href="Request.html#M000069">message</a> received by the <a
85
- href="Server.html">Server</a> or <a href="Agent.html">Agent</a> in <a
86
- href="../Siffer.html">Siffer</a>.
87
- </p>
88
-
89
- </div>
90
-
91
-
92
- </div>
93
-
94
- <div id="method-list">
95
- <h3 class="section-bar">Methods</h3>
96
-
97
- <div class="name-list">
98
- <a href="#M000069">message</a>&nbsp;&nbsp;
99
- <a href="#M000068">new</a>&nbsp;&nbsp;
100
- <a href="#M000070">original</a>&nbsp;&nbsp;
101
- </div>
102
- </div>
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
- <!-- if method_list -->
119
- <div id="methods">
120
- <h3 class="section-bar">Public Class methods</h3>
121
-
122
- <div id="method-M000068" class="method-detail">
123
- <a name="M000068"></a>
124
-
125
- <div class="method-heading">
126
- <a href="#M000068" class="method-signature">
127
- <span class="method-name">new</span><span class="method-args">(env)</span>
128
- </a>
129
- </div>
130
-
131
- <div class="method-description">
132
- <p>
133
- Constructor will assure that <a href="Request.html#M000069">message</a> is
134
- always populated with the body of the request for easy access throughout
135
- the call.
136
- </p>
137
- <p><a class="source-toggle" href="#"
138
- onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
139
- <div class="method-source-code" id="M000068-source">
140
- <pre>
141
- <span class="ruby-comment cmt"># File lib/request.rb, line 8</span>
142
- 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">env</span>)
143
- 9: <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;CONTENT_TYPE&quot;</span>] <span class="ruby-operator">||=</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;appxml&quot;</span>]
144
- 10: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">env</span>)
145
- 11: <span class="ruby-keyword kw">end</span>
146
- </pre>
147
- </div>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Siffer::Request [Siffer == h3o(software) SIF]</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Siffer::Request
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/siffer/request_rb.html">lib/siffer/request.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>Rack::Request</strong>
148
40
  </div>
149
41
  </div>
150
-
151
- <h3 class="section-bar">Public Instance methods</h3>
152
-
153
- <div id="method-M000069" class="method-detail">
154
- <a name="M000069"></a>
155
-
156
- <div class="method-heading">
157
- <a href="#M000069" class="method-signature">
158
- <span class="method-name">message</span><span class="method-args">()</span>
159
- </a>
160
- </div>
161
-
162
- <div class="method-description">
163
- <p>
164
- Provides access to the request <a href="Request.html#M000069">message</a>
165
- in <a href="Messages/Message.html">Siffer::Messages::Message</a> format.
166
- </p>
167
- <p><a class="source-toggle" href="#"
168
- onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
169
- <div class="method-source-code" id="M000069-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File lib/request.rb, line 15</span>
172
- 15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>
173
- 16: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">StringIO</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">pos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">length</span>
174
- 17: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">rewind</span>
175
- 18: <span class="ruby-keyword kw">end</span>
176
- 19: <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messages</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestBody</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">body</span>)
177
- 20: <span class="ruby-keyword kw">end</span>
178
- </pre>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='description'>
45
+ <p>
46
+ <a href="Request.html">Request</a> represents each message received by the
47
+ <a href="Server.html">Server</a> or <a href="Agent.html">Agent</a> in <a
48
+ href="../Siffer.html">Siffer</a>.
49
+ </p>
50
+ </div>
51
+ <div id='method-list'>
52
+ <h2>Methods</h2>
53
+ <h3>public instance</h3>
54
+ <ol>
55
+ <li><a href="#M000069">message</a></li>
56
+ <li><a href="#M000070">original</a></li>
57
+ </ol>
58
+ </div>
59
+ <div id='section'>
60
+ <div id='methods'>
61
+ <h2>Public instance methods</h2>
62
+ <div class='public-instance method' id='method-M000069'>
63
+ <a name='M000069'> </a>
64
+ <div class='synopsis'>
65
+ <span class='name'>message</span>
66
+ <span class='arguments'>()</span>
67
+ </div>
68
+ <div class='description'>
69
+ <p>
70
+ Provides access to the request message in <a
71
+ href="Messages/Message.html">Siffer::Messages::Message</a> format.
72
+ </p>
73
+ </div>
74
+ <div class='source'>
75
+ <a class='source-toggle' href='#' onclick="toggleCode('M000069-source'); return false">
76
+ [show source]
77
+ </a>
78
+ <pre id='M000069-source'> <span class="ruby-comment cmt"># File lib/siffer/request.rb, line 8</span>&#x000A; 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>&#x000A; 9: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">StringIO</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">pos</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">length</span>&#x000A;10: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">rewind</span>&#x000A;11: <span class="ruby-keyword kw">end</span>&#x000A;12: <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messages</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestBody</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">body</span>)&#x000A;13: <span class="ruby-keyword kw">end</span></pre>
79
+ </div>
80
+ </div>
81
+ <div class='public-instance method' id='method-M000070'>
82
+ <a name='M000070'> </a>
83
+ <div class='synopsis'>
84
+ <span class='name'>original</span>
85
+ <span class='arguments'>()</span>
86
+ </div>
87
+ <div class='description'>
88
+ <p>
89
+ Alias for <a href="Request.html#M000069">message</a>
90
+ </p>
91
+ </div>
92
+ </div>
93
+ </div>
179
94
  </div>
180
95
  </div>
181
96
  </div>
182
-
183
- <div id="method-M000070" class="method-detail">
184
- <a name="M000070"></a>
185
-
186
- <div class="method-heading">
187
- <span class="method-name">original</span><span class="method-args">()</span>
188
- </div>
189
-
190
- <div class="method-description">
191
- <p>
192
- Alias for <a href="Request.html#M000069">message</a>
193
- </p>
194
- </div>
195
- </div>
196
-
197
-
97
+ <div id='footer-push'></div>
98
+ </div>
99
+ <div id='footer'>
100
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
198
101
  </div>
199
-
200
-
201
- </div>
202
-
203
-
204
- <div id="validator-badges">
205
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
206
- </div>
207
-
208
- </body>
209
- </html>
102
+ </body>
103
+ </html>
@@ -1,211 +1,109 @@
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::RequestLogger</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::RequestLogger</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/request_logger_rb.html">
59
- lib/request_logger.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
- Object
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
- <div id="method-list">
86
- <h3 class="section-bar">Methods</h3>
87
-
88
- <div class="name-list">
89
- <a href="#M000057">call</a>&nbsp;&nbsp;
90
- <a href="#M000058">log_request</a>&nbsp;&nbsp;
91
- <a href="#M000056">new</a>&nbsp;&nbsp;
92
- </div>
93
- </div>
94
-
95
- </div>
96
-
97
-
98
- <!-- if includes -->
99
-
100
- <div id="section">
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
- <!-- if method_list -->
110
- <div id="methods">
111
- <h3 class="section-bar">Public Class methods</h3>
112
-
113
- <div id="method-M000056" class="method-detail">
114
- <a name="M000056"></a>
115
-
116
- <div class="method-heading">
117
- <a href="#M000056" class="method-signature">
118
- <span class="method-name">new</span><span class="method-args">(app, log=nil)</span>
119
- </a>
120
- </div>
121
-
122
- <div class="method-description">
123
- <p><a class="source-toggle" href="#"
124
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
125
- <div class="method-source-code" id="M000056-source">
126
- <pre>
127
- <span class="ruby-comment cmt"># File lib/request_logger.rb, line 3</span>
128
- 3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">log</span>=<span class="ruby-keyword kw">nil</span>)
129
- 4: <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
130
- 5: <span class="ruby-ivar">@log</span> = <span class="ruby-identifier">log</span> <span class="ruby-operator">||</span> <span class="ruby-constant">STDERR</span>
131
- 6: <span class="ruby-keyword kw">end</span>
132
- </pre>
133
- </div>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Siffer::RequestLogger [Siffer == h3o(software) SIF]</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Siffer::RequestLogger
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/siffer/request_logger_rb.html">lib/siffer/request_logger.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>Object</strong>
134
40
  </div>
135
41
  </div>
136
-
137
- <h3 class="section-bar">Public Instance methods</h3>
138
-
139
- <div id="method-M000057" class="method-detail">
140
- <a name="M000057"></a>
141
-
142
- <div class="method-heading">
143
- <a href="#M000057" class="method-signature">
144
- <span class="method-name">call</span><span class="method-args">(env)</span>
145
- </a>
146
- </div>
147
-
148
- <div class="method-description">
149
- <p><a class="source-toggle" href="#"
150
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
151
- <div class="method-source-code" id="M000057-source">
152
- <pre>
153
- <span class="ruby-comment cmt"># File lib/request_logger.rb, line 8</span>
154
- 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
155
- 9: <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">env</span>
156
- 10: <span class="ruby-comment cmt"># Maybe there is a better way to pick the body of the input</span>
157
- 11: <span class="ruby-comment cmt"># instead of reading it then stuffing it back in ??</span>
158
- 12: <span class="ruby-ivar">@msg</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;rack.input&quot;</span>].<span class="ruby-identifier">read</span>
159
- 13: <span class="ruby-identifier">log_request</span>
160
- 14: <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;rack.input&quot;</span>] = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@msg</span>)
161
- 15: <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
162
- 16: <span class="ruby-keyword kw">end</span>
163
- </pre>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='method-list'>
45
+ <h2>Methods</h2>
46
+ <h3>public class</h3>
47
+ <ol>
48
+ <li><a href="#M000057">new</a></li>
49
+ </ol>
50
+ <h3>public instance</h3>
51
+ <ol>
52
+ <li><a href="#M000058">call</a></li>
53
+ <li><a href="#M000059">log_request</a></li>
54
+ </ol>
164
55
  </div>
165
- </div>
166
- </div>
167
-
168
- <div id="method-M000058" class="method-detail">
169
- <a name="M000058"></a>
170
-
171
- <div class="method-heading">
172
- <a href="#M000058" class="method-signature">
173
- <span class="method-name">log_request</span><span class="method-args">()</span>
174
- </a>
175
- </div>
176
-
177
- <div class="method-description">
178
- <p><a class="source-toggle" href="#"
179
- onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
180
- <div class="method-source-code" id="M000058-source">
181
- <pre>
182
- <span class="ruby-comment cmt"># File lib/request_logger.rb, line 18</span>
183
- 18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_request</span>
184
- 19: <span class="ruby-ivar">@now</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
185
- 20: <span class="ruby-identifier">message</span> = <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messages</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestBody</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@msg</span>)
186
- 21: <span class="ruby-ivar">@log</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">%{%s request made by %s on %s at %s\n}</span> <span class="ruby-operator">%</span>
187
- 22: [
188
- 23: <span class="ruby-identifier">message</span>.<span class="ruby-identifier">type</span>,
189
- 24: <span class="ruby-ivar">@env</span>[<span class="ruby-value str">&quot;REMOTE_USER&quot;</span>],
190
- 25: <span class="ruby-ivar">@now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%b/%d/%Y&quot;</span>),
191
- 26: <span class="ruby-ivar">@now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M:%S&quot;</span>)
192
- 27: ]
193
- 28: <span class="ruby-keyword kw">end</span>
194
- </pre>
56
+ <div id='section'>
57
+ <div id='methods'>
58
+ <h2>Public class methods</h2>
59
+ <div class='public-class method' id='method-M000057'>
60
+ <a name='M000057'> </a>
61
+ <div class='synopsis'>
62
+ <span class='name'>new</span>
63
+ <span class='arguments'>(app, log=nil)</span>
64
+ </div>
65
+ <div class='source'>
66
+ <a class='source-toggle' href='#' onclick="toggleCode('M000057-source'); return false">
67
+ [show source]
68
+ </a>
69
+ <pre id='M000057-source'> <span class="ruby-comment cmt"># File lib/siffer/request_logger.rb, line 3</span>&#x000A;3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">log</span>=<span class="ruby-keyword kw">nil</span>)&#x000A;4: <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>&#x000A;5: <span class="ruby-ivar">@log</span> = <span class="ruby-identifier">log</span> <span class="ruby-operator">||</span> <span class="ruby-constant">STDERR</span>&#x000A;6: <span class="ruby-keyword kw">end</span></pre>
70
+ </div>
71
+ </div>
72
+ <h2>Public instance methods</h2>
73
+ <div class='public-instance method' id='method-M000058'>
74
+ <a name='M000058'> </a>
75
+ <div class='synopsis'>
76
+ <span class='name'>call</span>
77
+ <span class='arguments'>(env)</span>
78
+ </div>
79
+ <div class='source'>
80
+ <a class='source-toggle' href='#' onclick="toggleCode('M000058-source'); return false">
81
+ [show source]
82
+ </a>
83
+ <pre id='M000058-source'> <span class="ruby-comment cmt"># File lib/siffer/request_logger.rb, line 8</span>&#x000A; 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)&#x000A; 9: <span class="ruby-ivar">@msg</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;rack.input&quot;</span>].<span class="ruby-identifier">read</span>&#x000A;10: <span class="ruby-identifier">log_request</span>&#x000A;11: <span class="ruby-identifier">env</span>[<span class="ruby-value str">&quot;rack.input&quot;</span>].<span class="ruby-identifier">rewind</span>&#x000A;12: <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)&#x000A;13: <span class="ruby-keyword kw">end</span></pre>
84
+ </div>
85
+ </div>
86
+ <div class='public-instance method' id='method-M000059'>
87
+ <a name='M000059'> </a>
88
+ <div class='synopsis'>
89
+ <span class='name'>log_request</span>
90
+ <span class='arguments'>()</span>
91
+ </div>
92
+ <div class='source'>
93
+ <a class='source-toggle' href='#' onclick="toggleCode('M000059-source'); return false">
94
+ [show source]
95
+ </a>
96
+ <pre id='M000059-source'> <span class="ruby-comment cmt"># File lib/siffer/request_logger.rb, line 15</span>&#x000A;15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_request</span>&#x000A;16: <span class="ruby-ivar">@now</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>&#x000A;17: <span class="ruby-identifier">message</span> = <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messages</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestBody</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@msg</span>).<span class="ruby-identifier">type</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-value str">&quot;Unknown&quot;</span>&#x000A;18: <span class="ruby-identifier">host</span> = <span class="ruby-constant">Siffer</span><span class="ruby-operator">::</span><span class="ruby-constant">Messages</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestBody</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@msg</span>).<span class="ruby-identifier">source_id</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-value str">&quot;Unknown Source&quot;</span>&#x000A;19: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">host</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> &#x000A;20: <span class="ruby-identifier">host</span> = <span class="ruby-value str">&quot;Unknown Source&quot;</span>&#x000A;21: <span class="ruby-keyword kw">end</span>&#x000A;22: <span class="ruby-ivar">@log</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">%{%s request made by %s on %s at %s\n}</span> <span class="ruby-operator">%</span>&#x000A;23: [&#x000A;24: <span class="ruby-identifier">message</span>,&#x000A;25: <span class="ruby-identifier">host</span>,&#x000A;26: <span class="ruby-ivar">@now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%b/%d/%Y&quot;</span>),&#x000A;27: <span class="ruby-ivar">@now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M:%S&quot;</span>)&#x000A;28: ]&#x000A;29: <span class="ruby-keyword kw">end</span></pre>
97
+ </div>
98
+ </div>
99
+ </div>
195
100
  </div>
196
101
  </div>
197
102
  </div>
198
-
199
-
103
+ <div id='footer-push'></div>
104
+ </div>
105
+ <div id='footer'>
106
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
200
107
  </div>
201
-
202
-
203
- </div>
204
-
205
-
206
- <div id="validator-badges">
207
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
208
- </div>
209
-
210
- </body>
211
- </html>
108
+ </body>
109
+ </html>