rfuzz 0.7 → 0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/doc/rdoc/classes/RFuzz/Browser.html +15 -15
- data/doc/rdoc/classes/RFuzz/Browser.src/{M000068.html → M000083.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/{M000069.html → M000084.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/{M000070.html → M000085.html} +0 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.html +114 -57
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000019.html +12 -13
- data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000011.html → M000020.html} +20 -20
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000021.html +28 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000022.html +30 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000023.html +35 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000024.html +22 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000025.html +44 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000026.html +38 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000016.html → M000027.html} +12 -12
- data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000017.html → M000028.html} +20 -20
- data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000018.html → M000029.html} +4 -4
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000030.html +26 -0
- data/doc/rdoc/classes/RFuzz/HttpClientError.html +118 -0
- data/doc/rdoc/classes/RFuzz/HttpEncoding.html +7 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000001.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000002.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000003.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000004.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000005.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000006.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000007.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000008.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000009.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpResponse.html +74 -13
- data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000031.html +22 -0
- data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000032.html +18 -0
- data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000033.html +18 -0
- data/doc/rdoc/classes/RFuzz/Notifier.html +49 -31
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000044.html → M000058.html} +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000045.html → M000059.html} +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000047.html → M000060.html} +2 -2
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000048.html → M000061.html} +2 -2
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000049.html → M000062.html} +2 -2
- data/doc/rdoc/classes/RFuzz/Notifier.src/{M000046.html → M000063.html} +4 -4
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000064.html +17 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.html +296 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000010.html +19 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000011.html +20 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000012.html +19 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000013.html +18 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000014.html +44 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000015.html +18 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000016.html +18 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000017.html +18 -0
- data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000018.html +22 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.html +62 -62
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000032.html → M000046.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000033.html → M000047.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000036.html → M000050.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000037.html → M000051.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000038.html → M000052.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000039.html → M000053.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000040.html → M000054.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000041.html → M000055.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000042.html → M000056.html} +0 -0
- data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000043.html → M000057.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.html +60 -60
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000056.html → M000071.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000057.html → M000072.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000058.html → M000073.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000059.html → M000074.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000060.html → M000075.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000061.html → M000076.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000062.html → M000077.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000063.html → M000078.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000064.html → M000079.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000065.html → M000080.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000066.html → M000081.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Sampler.src/{M000067.html → M000082.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.html +63 -63
- data/doc/rdoc/classes/RFuzz/Session.src/{M000020.html → M000034.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000021.html → M000035.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000022.html → M000036.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000023.html → M000037.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000024.html → M000038.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000025.html → M000039.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000026.html → M000040.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000027.html → M000041.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000028.html → M000042.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000029.html → M000043.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000030.html → M000044.html} +0 -0
- data/doc/rdoc/classes/RFuzz/Session.src/{M000031.html → M000045.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.html +32 -32
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000050.html → M000065.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000051.html → M000066.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000052.html → M000067.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000053.html → M000068.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000054.html → M000069.html} +0 -0
- data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000055.html → M000070.html} +0 -0
- data/doc/rdoc/classes/RFuzz.html +7 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/lib/rfuzz/client_rb.html +2 -2
- data/doc/rdoc/files/lib/rfuzz/pushbackio_rb.html +108 -0
- data/doc/rdoc/fr_class_index.html +2 -0
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +76 -61
- data/examples/cl_watcher.rb +12 -9
- data/examples/hpricot_pudding.rb +1 -1
- data/examples/mongrel_test_suite/test/http/protocol_parameters.rb +0 -3
- data/examples/mongrel_test_suite/test/rails/catastrophe.rb +26 -0
- data/examples/mongrel_test_suite/test/rails/conditional.rb +81 -0
- data/examples/mongrel_test_suite/test/rails/put.rb +25 -0
- data/examples/mongrel_test_suite/test/rails/redirect.rb +13 -0
- data/examples/mongrel_test_suite/test/rails/static_files.rb +47 -2
- data/examples/rails_security_test.rb +61 -0
- data/ext/http11_client/http11_client.c +15 -1
- data/ext/http11_client/http11_parser.c +627 -203
- data/ext/http11_client/http11_parser.h +2 -0
- data/ext/http11_client/http11_parser.rl +8 -4
- data/lib/rfuzz/client.rb +124 -115
- data/lib/rfuzz/pushbackio.rb +90 -0
- metadata +86 -60
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000010.html +0 -24
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000012.html +0 -50
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000013.html +0 -49
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000014.html +0 -57
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000015.html +0 -37
|
@@ -0,0 +1,296 @@
|
|
|
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: RFuzz::PushBackIO</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">RFuzz::PushBackIO</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/rfuzz/pushbackio_rb.html">
|
|
59
|
+
lib/rfuzz/pushbackio.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
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
A simple class that using a StringIO object internally to allow for faster
|
|
84
|
+
and simpler "push back" semantics. It basically lets you read a
|
|
85
|
+
random amount from a secondary IO object, parse what is needed, and then
|
|
86
|
+
anything remaining can be quickly pushed back in one chunk for the next
|
|
87
|
+
read.
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div id="method-list">
|
|
96
|
+
<h3 class="section-bar">Methods</h3>
|
|
97
|
+
|
|
98
|
+
<div class="name-list">
|
|
99
|
+
<a href="#M000017">close</a>
|
|
100
|
+
<a href="#M000015">flush</a>
|
|
101
|
+
<a href="#M000010">new</a>
|
|
102
|
+
<a href="#M000012">pop</a>
|
|
103
|
+
<a href="#M000018">protect</a>
|
|
104
|
+
<a href="#M000011">push</a>
|
|
105
|
+
<a href="#M000014">read</a>
|
|
106
|
+
<a href="#M000013">reset</a>
|
|
107
|
+
<a href="#M000016">write</a>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<!-- if includes -->
|
|
115
|
+
|
|
116
|
+
<div id="section">
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<div id="attribute-list">
|
|
123
|
+
<h3 class="section-bar">Attributes</h3>
|
|
124
|
+
|
|
125
|
+
<div class="name-list">
|
|
126
|
+
<table>
|
|
127
|
+
<tr class="top-aligned-row context-row">
|
|
128
|
+
<td class="context-item-name">secondary</td>
|
|
129
|
+
<td class="context-item-value"> [RW] </td>
|
|
130
|
+
<td class="context-item-desc"></td>
|
|
131
|
+
</tr>
|
|
132
|
+
</table>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<!-- if method_list -->
|
|
139
|
+
<div id="methods">
|
|
140
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
141
|
+
|
|
142
|
+
<div id="method-M000010" class="method-detail">
|
|
143
|
+
<a name="M000010"></a>
|
|
144
|
+
|
|
145
|
+
<div class="method-heading">
|
|
146
|
+
<a href="PushBackIO.src/M000010.html" target="Code" class="method-signature"
|
|
147
|
+
onclick="popupCode('PushBackIO.src/M000010.html');return false;">
|
|
148
|
+
<span class="method-name">new</span><span class="method-args">(secondary)</span>
|
|
149
|
+
</a>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div class="method-description">
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
157
|
+
|
|
158
|
+
<div id="method-M000017" class="method-detail">
|
|
159
|
+
<a name="M000017"></a>
|
|
160
|
+
|
|
161
|
+
<div class="method-heading">
|
|
162
|
+
<a href="PushBackIO.src/M000017.html" target="Code" class="method-signature"
|
|
163
|
+
onclick="popupCode('PushBackIO.src/M000017.html');return false;">
|
|
164
|
+
<span class="method-name">close</span><span class="method-args">()</span>
|
|
165
|
+
</a>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div class="method-description">
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div id="method-M000015" class="method-detail">
|
|
173
|
+
<a name="M000015"></a>
|
|
174
|
+
|
|
175
|
+
<div class="method-heading">
|
|
176
|
+
<a href="PushBackIO.src/M000015.html" target="Code" class="method-signature"
|
|
177
|
+
onclick="popupCode('PushBackIO.src/M000015.html');return false;">
|
|
178
|
+
<span class="method-name">flush</span><span class="method-args">()</span>
|
|
179
|
+
</a>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div class="method-description">
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div id="method-M000012" class="method-detail">
|
|
187
|
+
<a name="M000012"></a>
|
|
188
|
+
|
|
189
|
+
<div class="method-heading">
|
|
190
|
+
<a href="PushBackIO.src/M000012.html" target="Code" class="method-signature"
|
|
191
|
+
onclick="popupCode('PushBackIO.src/M000012.html');return false;">
|
|
192
|
+
<span class="method-name">pop</span><span class="method-args">(n)</span>
|
|
193
|
+
</a>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<div class="method-description">
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div id="method-M000018" class="method-detail">
|
|
201
|
+
<a name="M000018"></a>
|
|
202
|
+
|
|
203
|
+
<div class="method-heading">
|
|
204
|
+
<a href="PushBackIO.src/M000018.html" target="Code" class="method-signature"
|
|
205
|
+
onclick="popupCode('PushBackIO.src/M000018.html');return false;">
|
|
206
|
+
<span class="method-name">protect</span><span class="method-args">() {|| ...}</span>
|
|
207
|
+
</a>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="method-description">
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<div id="method-M000011" class="method-detail">
|
|
215
|
+
<a name="M000011"></a>
|
|
216
|
+
|
|
217
|
+
<div class="method-heading">
|
|
218
|
+
<a href="PushBackIO.src/M000011.html" target="Code" class="method-signature"
|
|
219
|
+
onclick="popupCode('PushBackIO.src/M000011.html');return false;">
|
|
220
|
+
<span class="method-name">push</span><span class="method-args">(content)</span>
|
|
221
|
+
</a>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div class="method-description">
|
|
225
|
+
<p>
|
|
226
|
+
Pushes the given string content back onto the stream for the next read to
|
|
227
|
+
handle.
|
|
228
|
+
</p>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<div id="method-M000014" class="method-detail">
|
|
233
|
+
<a name="M000014"></a>
|
|
234
|
+
|
|
235
|
+
<div class="method-heading">
|
|
236
|
+
<a href="PushBackIO.src/M000014.html" target="Code" class="method-signature"
|
|
237
|
+
onclick="popupCode('PushBackIO.src/M000014.html');return false;">
|
|
238
|
+
<span class="method-name">read</span><span class="method-args">(n, partial=false)</span>
|
|
239
|
+
</a>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div class="method-description">
|
|
243
|
+
<p>
|
|
244
|
+
First does a read from the internal buffer, and then appends anything
|
|
245
|
+
needed from the secondary IO to complete the request. The return value is
|
|
246
|
+
guaranteed to be a String, and never nil. If it returns a string of length
|
|
247
|
+
0 then there is nothing to read from the buffer (most likely closed). It
|
|
248
|
+
will also avoid reading from a secondary that’s closed.
|
|
249
|
+
</p>
|
|
250
|
+
<p>
|
|
251
|
+
If partial==true then readpartial is used instead.
|
|
252
|
+
</p>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
<div id="method-M000013" class="method-detail">
|
|
257
|
+
<a name="M000013"></a>
|
|
258
|
+
|
|
259
|
+
<div class="method-heading">
|
|
260
|
+
<a href="PushBackIO.src/M000013.html" target="Code" class="method-signature"
|
|
261
|
+
onclick="popupCode('PushBackIO.src/M000013.html');return false;">
|
|
262
|
+
<span class="method-name">reset</span><span class="method-args">()</span>
|
|
263
|
+
</a>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
266
|
+
<div class="method-description">
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div id="method-M000016" class="method-detail">
|
|
271
|
+
<a name="M000016"></a>
|
|
272
|
+
|
|
273
|
+
<div class="method-heading">
|
|
274
|
+
<a href="PushBackIO.src/M000016.html" target="Code" class="method-signature"
|
|
275
|
+
onclick="popupCode('PushBackIO.src/M000016.html');return false;">
|
|
276
|
+
<span class="method-name">write</span><span class="method-args">(content)</span>
|
|
277
|
+
</a>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div class="method-description">
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<div id="validator-badges">
|
|
292
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
</body>
|
|
296
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>new (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 11</span>
|
|
14
|
+
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">secondary</span>)
|
|
15
|
+
12: <span class="ruby-ivar">@secondary</span> = <span class="ruby-identifier">secondary</span>
|
|
16
|
+
13: <span class="ruby-ivar">@buffer</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
14: <span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>push (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 18</span>
|
|
14
|
+
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">content</span>)
|
|
15
|
+
19: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">content</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
16
|
+
20: <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">content</span>)
|
|
17
|
+
21: <span class="ruby-keyword kw">end</span>
|
|
18
|
+
22: <span class="ruby-keyword kw">end</span></pre>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>pop (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 24</span>
|
|
14
|
+
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>(<span class="ruby-identifier">n</span>)
|
|
15
|
+
25: <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">rewind</span>
|
|
16
|
+
26: <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">n</span>) <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>
|
|
17
|
+
27: <span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>reset (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 29</span>
|
|
14
|
+
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
|
15
|
+
30: <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">string</span> = <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">read</span> <span class="ruby-comment cmt"># reset out internal buffer</span>
|
|
16
|
+
31: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,44 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>read (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 40</span>
|
|
14
|
+
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">partial</span>=<span class="ruby-keyword kw">false</span>)
|
|
15
|
+
41: <span class="ruby-identifier">r</span> = <span class="ruby-identifier">pop</span>(<span class="ruby-identifier">n</span>)
|
|
16
|
+
42: <span class="ruby-identifier">needs</span> = <span class="ruby-identifier">n</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">length</span>
|
|
17
|
+
43:
|
|
18
|
+
44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">needs</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
19
|
+
45: <span class="ruby-identifier">sec</span> = <span class="ruby-value str">""</span>
|
|
20
|
+
46: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">partial</span>
|
|
21
|
+
47: <span class="ruby-keyword kw">begin</span>
|
|
22
|
+
48: <span class="ruby-identifier">protect</span> <span class="ruby-keyword kw">do</span>
|
|
23
|
+
49: <span class="ruby-identifier">sec</span> = <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-identifier">needs</span>)
|
|
24
|
+
50: <span class="ruby-keyword kw">end</span>
|
|
25
|
+
51: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
|
|
26
|
+
52: <span class="ruby-comment cmt"># TODO: notify closed? error?</span>
|
|
27
|
+
53: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
54: <span class="ruby-keyword kw">else</span>
|
|
29
|
+
55: <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">sec</span> = <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">needs</span>)}
|
|
30
|
+
56: <span class="ruby-keyword kw">end</span>
|
|
31
|
+
57:
|
|
32
|
+
58: <span class="ruby-identifier">r</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">sec</span> <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>)
|
|
33
|
+
59:
|
|
34
|
+
60: <span class="ruby-comment cmt"># finally, if there's nothing at all returned then this is bad</span>
|
|
35
|
+
61: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
36
|
+
62: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpClientError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Server returned empty response."</span>)
|
|
37
|
+
63: <span class="ruby-keyword kw">end</span>
|
|
38
|
+
64: <span class="ruby-keyword kw">end</span>
|
|
39
|
+
65:
|
|
40
|
+
66: <span class="ruby-identifier">reset</span>
|
|
41
|
+
67: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">r</span>
|
|
42
|
+
68: <span class="ruby-keyword kw">end</span></pre>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>flush (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 70</span>
|
|
14
|
+
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush</span>
|
|
15
|
+
71: <span class="ruby-identifier">protect</span> { <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">flush</span> }
|
|
16
|
+
72: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>write (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 74</span>
|
|
14
|
+
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">content</span>)
|
|
15
|
+
75: <span class="ruby-identifier">protect</span> { <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">content</span>) }
|
|
16
|
+
76: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>close (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 78</span>
|
|
14
|
+
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
|
15
|
+
79: <span class="ruby-identifier">protect</span> { <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">close</span> }
|
|
16
|
+
80: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>protect (RFuzz::PushBackIO)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 82</span>
|
|
14
|
+
82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">protect</span>
|
|
15
|
+
83: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">closed?</span>
|
|
16
|
+
84: <span class="ruby-keyword kw">yield</span>
|
|
17
|
+
85: <span class="ruby-keyword kw">else</span>
|
|
18
|
+
86: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpClientError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Socket closed."</span>)
|
|
19
|
+
87: <span class="ruby-keyword kw">end</span>
|
|
20
|
+
88: <span class="ruby-keyword kw">end</span></pre>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|