-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTestPuma.html
262 lines (244 loc) · 18.4 KB
/
TestPuma.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no'>
<meta name='apple-touch-fullscreen' content='yes'>
<meta name='apple-mobile-web-app-capable' content='yes'>
<meta name='apple-mobile-web-app-status-bar-style' content='rgba(228,228,228,1.0)'>
<title>Module: TestPuma — Puma master</title>
<link rel='stylesheet' type='text/css' href='../css/y_fonts.css' />
<link rel='stylesheet' type='text/css' href='../css/highlight.github.css' />
<link rel='stylesheet' type='text/css' href='../css/y_style.css' />
<link rel='stylesheet' type='text/css' href='../css/y_list.css' />
<link rel='stylesheet' type='text/css' href='../css/y_color.css' />
<script type='text/javascript'>
var pathId = "TestPuma",
relpath = '';
var t2Info = {
CSEP: '.',
ISEP: '#',
NSEP: '::'
};
</script>
<script type='text/javascript' charset='utf-8' src='../js/highlight.pack.js'></script>
<script type='text/javascript' charset='utf-8' src='../js/y_app.js'></script>
</head>
<body>
<svg id='y_wait' class viewBox='0 0 90 90'></svg>
<div id='settings' class='hidden'></div>
<div id='y_list' class='d h'>
<header id='list_header'></header>
<nav id= 'list_nav' class='y_nav l_nav'>
<ul id='list_items'></ul>
</nav>
</div>
<div id='y_toc' class='f h'>
<header id='toc_header'></header>
<nav id= 'toc_nav' class='y_nav t_nav'>
<ol id='toc_items'></ol>
</nav>
</div>
<div id='y_main' tabindex='-1'>
<header id='y_header'>
<div id='y_menu'>
<a id='home_no_xhr' href='/'>Home</a> »
<a href='.'>Puma master</a> »
<a href='_index.html#alpha_T'>Index (T)</a> »
<span class='title'><a id='t2_doc_top' href='#'>TestPuma ▲</a></span>
</div>
<a id='list_href' href="class_list.html"></a>
<div id='y_measure_em' class='y_measure'></div>
<div id='y_measure_vh' class='y_measure'></div>
<span id='y_measure_50pre' class='y_measure'><code>123456789_123456789_123456789_123456789_123456789_</code></span>
</header>
<div id='content' class='module'>
<h1>Module: TestPuma</h1>
<div id='t2_rel_sf_div'>
<table id='t2_rel_sf' class='y_box'>
<thead>
<tr><td id='t2_relations' colspan='2'>Relationships & Source Files</td></tr>
</thead>
<tbody>
<tr><td class='box_h' colspan='2'>Namespace Children</td></tr>
<tr><td colspan='2'>
<div class='box_1'>Modules:</div>
<div class='box_11'>
<a href="TestPuma/Assertions.html" title="TestPuma::Assertions (module)"><code>Assertions</code></a>,
<a href="TestPuma/PumaSocket.html" title="TestPuma::PumaSocket (module)"><code>PumaSocket</code></a> </div>
</td></tr>
<tr><td colspan='2'>
<div class='box_1'>Classes:</div>
<div class='box_11'>
<a href="TestPuma/Response.html" title="TestPuma::Response (class)"><code>Response</code></a> </div>
</td></tr>
<tr class='single'>
<td id='t2_defined_in' class='box_2 o'>Defined in:</td>
<td class='box_rel'><a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L5'>test/helpers/test_puma.rb</a><span class='defines'>,<br /><a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma/assertions.rb#L3'>test/helpers/test_puma/assertions.rb</a>,<br/> <a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma/puma_socket.rb#L7'>test/helpers/test_puma/puma_socket.rb</a>,<br/> <a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma/response.rb#L1'>test/helpers/test_puma/response.rb</a></span>
</td>
</tr>
</tbody>
</table>
</div>
<h2 id='t2_cnst' class='h2_sum'>Constant Summary</h2>
<div>
<ul class='constants summary full'>
<li>
<span id='ALT_HOST-constant' class='summary_signature'>ALT_HOST =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L34-L37'># File 'test/helpers/test_puma.rb', line 34</a> <pre class='code ruby'><span class='const'><a href="#HOST6-constant" title="TestPuma::HOST6 (constant)">HOST6</a></span></pre>
</li>
<li>
<span id='DARWIN-constant' class='summary_signature'>DARWIN =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L40-L40'># File 'test/helpers/test_puma.rb', line 40</a> <pre class='code ruby'><span class='const'>RUBY_PLATFORM</span>.<span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>darwin</span><span class='tstring_end'>'</span></span></pre>
</li>
<li>
<span id='HOST-constant' class='summary_signature'>HOST =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L33-L36'># File 'test/helpers/test_puma.rb', line 33</a> <pre class='code ruby'><span class='const'><a href="#HOST4-constant" title="TestPuma::HOST4 (constant)">HOST4</a></span></pre>
</li>
<li>
<span id='HOST4-constant' class='summary_signature'>HOST4 =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L12-L19'># File 'test/helpers/test_puma.rb', line 12</a> <pre class='code ruby'><span class='kw'>begin</span>
<span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Socket</span>.<span class='id identifier rubyid_ip_address_list'>ip_address_list</span>.<span class='id identifier rubyid_select'>select</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_ipv4_loopback?'>ipv4_loopback?</span>).<span class='id identifier rubyid_map'>map</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_ip_address'>ip_address</span>)
.<span class='id identifier rubyid_uniq'>uniq</span>.<span class='id identifier rubyid_sort_by'>sort_by</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_length'>length</span>)
<span class='comment'># puts "IPv4 Loopback #{t}"
</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span>.<span class='id identifier rubyid_include?'>include?</span>(<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span>) <span class='op'>?</span> <span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_t'>t</span>.<span class='id identifier rubyid_first'>first</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_str'>str</span>.<span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span>(<span class='symbeg'>:</span><span class='id identifier rubyid_ip'>ip</span>) { <span class='kw'>self</span> }
<span class='id identifier rubyid_str'>str</span>.<span class='id identifier rubyid_freeze'>freeze</span>
<span class='kw'>end</span></pre>
</li>
<li>
<span id='HOST6-constant' class='summary_signature'>HOST6 =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L21-L28'># File 'test/helpers/test_puma.rb', line 21</a> <pre class='code ruby'><span class='kw'>begin</span>
<span class='id identifier rubyid_t'>t</span> <span class='op'>=</span> <span class='const'>Socket</span>.<span class='id identifier rubyid_ip_address_list'>ip_address_list</span>.<span class='id identifier rubyid_select'>select</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_ipv6_loopback?'>ipv6_loopback?</span>).<span class='id identifier rubyid_map'>map</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_ip_address'>ip_address</span>)
.<span class='id identifier rubyid_uniq'>uniq</span>.<span class='id identifier rubyid_sort_by'>sort_by</span>(<span class='op'>&</span><span class='symbeg'>:</span><span class='id identifier rubyid_length'>length</span>)
<span class='comment'># puts "IPv6 Loopback #{t}"
</span> <span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span>.<span class='id identifier rubyid_include?'>include?</span>(<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>::1</span><span class='tstring_end'>'</span></span>) <span class='op'>?</span> <span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>[::1]</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_t'>t</span>.<span class='id identifier rubyid_first'>first</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_str'>str</span>.<span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span>(<span class='symbeg'>:</span><span class='id identifier rubyid_ip'>ip</span>) { <span class='kw'>self</span>.<span class='id identifier rubyid_gsub'>gsub</span> <span class='const'><a href="#RE_HOST_TO_IP-constant" title="TestPuma::RE_HOST_TO_IP (constant)">RE_HOST_TO_IP</a></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> }
<span class='id identifier rubyid_str'>str</span>.<span class='id identifier rubyid_freeze'>freeze</span>
<span class='kw'>end</span></pre>
</li>
<li>
<span id='LINE_SPLIT-constant' class='summary_signature'>LINE_SPLIT =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L8-L8'># File 'test/helpers/test_puma.rb', line 8</a> <pre class='code ruby'><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\r\n</span><span class='tstring_end'>"</span></span></pre>
</li>
<li>
<span id='LOCALHOST-constant' class='summary_signature'>LOCALHOST =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L30-L30'># File 'test/helpers/test_puma.rb', line 30</a> <pre class='code ruby'><span class='const'>ENV</span>.<span class='id identifier rubyid_fetch'>fetch</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>PUMA_CI_DFLT_HOST</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost</span><span class='tstring_end'>'</span></span></pre>
</li>
<li>
<span id='RESP_SPLIT-constant' class='summary_signature'>RESP_SPLIT =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L7-L7'># File 'test/helpers/test_puma.rb', line 7</a> <pre class='code ruby'><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\r\n\r\n</span><span class='tstring_end'>"</span></span></pre>
</li>
<li>
<span id='RE_HOST_TO_IP-constant' class='summary_signature'>RE_HOST_TO_IP =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L10-L10'># File 'test/helpers/test_puma.rb', line 10</a> <pre class='code ruby'><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A\[|\]\z</span><span class='regexp_end'>/o</span></span></pre>
</li>
<li>
<span id='TOKEN-constant' class='summary_signature'>TOKEN =</span>
<br/>
<a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L42-L42'># File 'test/helpers/test_puma.rb', line 42</a> <pre class='code ruby'><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>xxyyzz</span><span class='tstring_end'>"</span></span></pre>
</li>
</ul>
</div>
<h2 class='h2_sum' id='instance_method_summary'>Instance Method Summary</h2>
<div class='div_sum'>
<ul class='summary full'>
<li>
<span class='summary_signature '>
<a href="#bind_uri_str-instance_method" title="#bind_uri_str (instance method)">#<strong>bind_uri_str</strong> </a>
</span>
</li>
<li>
<span class='summary_signature '>
<a href="#control_uri_str-instance_method" title="#control_uri_str (instance method)">#<strong>control_uri_str</strong> </a>
</span>
</li>
<li>
<span class='summary_signature '>
<a href="#new_port-instance_method" title="#new_port (instance method)">#<strong>new_port</strong>(host = HOST) </a>
</span>
<div class='summary_desc'>
<div class='inline'><p>Returns an available port by using <code>TCPServer.open(host, 0)</code>.</p></div>
</div>
</li>
</ul>
</div> <!-- instance_method_summary -->
<h2 class='y_details'>Instance Method Details</h2>
<section class='method_details first' id="bind_uri_str-instance_method">
<h3 class='signature first'>
#<strong>bind_uri_str</strong>
</h3>
<span class='link_repo'>[ <a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L49-L55'>GitHub</a> ]</span>
<div class='source_code h'>
<pre class='lines_num' data-start='49' data-end='55'></pre>
<div class='lines_code'>
<pre><span class='info file'># File 'test/helpers/test_puma.rb', line 49</span></pre>
<pre class='code ruby'>
<span class='kw'>def</span> <span class='id identifier rubyid_bind_uri_str'>bind_uri_str</span>
<span class='kw'>if</span> <span class='ivar'>@bind_port</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>tcp://</span><span class='embexpr_beg'>#{</span><span class='const'><a href="#HOST-constant" title="TestPuma::HOST (constant)">HOST</a></span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='ivar'>@bind_port</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>elsif</span> <span class='ivar'>@bind_path</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unix://</span><span class='embexpr_beg'>#{</span><span class='const'><a href="#HOST-constant" title="TestPuma::HOST (constant)">HOST</a></span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='ivar'>@bind_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
</pre>
</div>
</div>
</section>
<section class='method_details' id="control_uri_str-instance_method">
<h3 class='signature '>
#<strong>control_uri_str</strong>
</h3>
<span class='link_repo'>[ <a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L57-L63'>GitHub</a> ]</span>
<div class='source_code h'>
<pre class='lines_num' data-start='57' data-end='63'></pre>
<div class='lines_code'>
<pre><span class='info file'># File 'test/helpers/test_puma.rb', line 57</span></pre>
<pre class='code ruby'>
<span class='kw'>def</span> <span class='id identifier rubyid_control_uri_str'>control_uri_str</span>
<span class='kw'>if</span> <span class='ivar'>@control_port</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>tcp://</span><span class='embexpr_beg'>#{</span><span class='const'><a href="#HOST-constant" title="TestPuma::HOST (constant)">HOST</a></span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='ivar'>@control_port</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>elsif</span> <span class='ivar'>@control_path</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>unix://</span><span class='embexpr_beg'>#{</span><span class='const'><a href="#HOST-constant" title="TestPuma::HOST (constant)">HOST</a></span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='ivar'>@control_path</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
</pre>
</div>
</div>
</section>
<section class='method_details' id="new_port-instance_method">
<h3 class='signature '>
#<strong>new_port</strong>(host = HOST)
</h3>
<div class='docstring'>
<div class='discussion'>
<p>Returns an available port by using <code>TCPServer.open(host, 0)</code></p>
</div>
</div>
<span class='link_repo'>[ <a class='repo' href='https://github.com/puma/puma/blob/master/test/helpers/test_puma.rb#L45-L47'>GitHub</a> ]</span>
<div class='source_code h'>
<pre class='lines_num' data-start='45' data-end='47'></pre>
<div class='lines_code'>
<pre><span class='info file'># File 'test/helpers/test_puma.rb', line 45</span></pre>
<pre class='code ruby'>
<span class='kw'>def</span> <span class='id identifier rubyid_new_port'>new_port</span>(<span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='const'><a href="#HOST-constant" title="TestPuma::HOST (constant)">HOST</a></span>)
<span class='const'>TCPServer</span>.<span class='id identifier rubyid_open'>open</span>(<span class='id identifier rubyid_host'>host</span><span class='comma'>,</span> <span class='int'>0</span>) { <span class='op'>|</span><span class='id identifier rubyid_server'>server</span><span class='op'>|</span> <span class='id identifier rubyid_server'>server</span>.<span class='id identifier rubyid_connect_address'>connect_address</span>.<span class='id identifier rubyid_ip_port'>ip_port</span> }
<span class='kw'>end</span>
</pre>
</div>
</div>
</section>
<div id='footer'></div>
</div> <!-- content -->
</div> <!-- y_main -->
</body>
</html>