mechanize 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mechanize might be problematic. Click here for more details.
- data/EXAMPLES +55 -0
- data/README +3 -12
- data/lib/mechanize/cookie.rb +1 -2
- data/lib/mechanize/form.rb +182 -0
- data/lib/mechanize/form_elements.rb +105 -0
- data/lib/mechanize/page.rb +130 -0
- data/lib/mechanize/page_elements.rb +28 -0
- data/lib/mechanize.rb +27 -369
- data/test/htdocs/file_upload.html +13 -0
- data/test/htdocs/frame_test.html +23 -0
- data/test/server.rb +1 -0
- data/test/servlets.rb +6 -0
- data/test/tc_cookies.rb +2 -3
- data/test/tc_forms.rb +2 -3
- data/test/tc_frames.rb +22 -0
- data/test/tc_links.rb +2 -3
- data/test/tc_mech.rb +2 -3
- data/test/tc_response_code.rb +2 -3
- data/test/tc_upload.rb +34 -0
- data/test/test_includes.rb +5 -0
- data/test/ts_mech.rb +2 -0
- metadata +59 -307
- data/doc/classes/Net/HTTP/Copy.html +0 -134
- data/doc/classes/Net/HTTP/Delete.html +0 -134
- data/doc/classes/Net/HTTP/Get.html +0 -134
- data/doc/classes/Net/HTTP/Head.html +0 -134
- data/doc/classes/Net/HTTP/Lock.html +0 -134
- data/doc/classes/Net/HTTP/Mkcol.html +0 -134
- data/doc/classes/Net/HTTP/Move.html +0 -134
- data/doc/classes/Net/HTTP/Options.html +0 -134
- data/doc/classes/Net/HTTP/Post.html +0 -134
- data/doc/classes/Net/HTTP/Propfind.html +0 -134
- data/doc/classes/Net/HTTP/Proppatch.html +0 -134
- data/doc/classes/Net/HTTP/Put.html +0 -134
- data/doc/classes/Net/HTTP/Trace.html +0 -134
- data/doc/classes/Net/HTTP/Unlock.html +0 -134
- data/doc/classes/Net/HTTP.html +0 -1716
- data/doc/classes/Net/HTTP.src/M000103.html +0 -18
- data/doc/classes/Net/HTTP.src/M000104.html +0 -18
- data/doc/classes/Net/HTTP.src/M000105.html +0 -18
- data/doc/classes/Net/HTTP.src/M000106.html +0 -18
- data/doc/classes/Net/HTTP.src/M000107.html +0 -29
- data/doc/classes/Net/HTTP.src/M000108.html +0 -18
- data/doc/classes/Net/HTTP.src/M000109.html +0 -22
- data/doc/classes/Net/HTTP.src/M000110.html +0 -18
- data/doc/classes/Net/HTTP.src/M000111.html +0 -18
- data/doc/classes/Net/HTTP.src/M000112.html +0 -18
- data/doc/classes/Net/HTTP.src/M000113.html +0 -18
- data/doc/classes/Net/HTTP.src/M000114.html +0 -22
- data/doc/classes/Net/HTTP.src/M000115.html +0 -29
- data/doc/classes/Net/HTTP.src/M000116.html +0 -18
- data/doc/classes/Net/HTTP.src/M000117.html +0 -19
- data/doc/classes/Net/HTTP.src/M000118.html +0 -19
- data/doc/classes/Net/HTTP.src/M000119.html +0 -18
- data/doc/classes/Net/HTTP.src/M000121.html +0 -18
- data/doc/classes/Net/HTTP.src/M000122.html +0 -28
- data/doc/classes/Net/HTTP.src/M000123.html +0 -19
- data/doc/classes/Net/HTTP.src/M000124.html +0 -30
- data/doc/classes/Net/HTTP.src/M000125.html +0 -18
- data/doc/classes/Net/HTTP.src/M000126.html +0 -18
- data/doc/classes/Net/HTTP.src/M000127.html +0 -18
- data/doc/classes/Net/HTTP.src/M000128.html +0 -18
- data/doc/classes/Net/HTTP.src/M000129.html +0 -18
- data/doc/classes/Net/HTTP.src/M000130.html +0 -18
- data/doc/classes/Net/HTTP.src/M000133.html +0 -28
- data/doc/classes/Net/HTTP.src/M000134.html +0 -20
- data/doc/classes/Net/HTTP.src/M000135.html +0 -28
- data/doc/classes/Net/HTTP.src/M000136.html +0 -18
- data/doc/classes/Net/HTTP.src/M000137.html +0 -18
- data/doc/classes/Net/HTTP.src/M000138.html +0 -18
- data/doc/classes/Net/HTTP.src/M000139.html +0 -18
- data/doc/classes/Net/HTTP.src/M000140.html +0 -18
- data/doc/classes/Net/HTTP.src/M000141.html +0 -18
- data/doc/classes/Net/HTTP.src/M000142.html +0 -18
- data/doc/classes/Net/HTTP.src/M000143.html +0 -18
- data/doc/classes/Net/HTTP.src/M000144.html +0 -18
- data/doc/classes/Net/HTTP.src/M000145.html +0 -18
- data/doc/classes/Net/HTTP.src/M000146.html +0 -18
- data/doc/classes/Net/HTTP.src/M000147.html +0 -18
- data/doc/classes/Net/HTTP.src/M000148.html +0 -18
- data/doc/classes/Net/HTTP.src/M000152.html +0 -19
- data/doc/classes/Net/HTTP.src/M000153.html +0 -39
- data/doc/classes/Net/HTTP.src/M000154.html +0 -18
- data/doc/classes/Net/HTTP.src/M000156.html +0 -24
- data/doc/classes/Net/HTTP.src/M000157.html +0 -18
- data/doc/classes/Net/HTTP.src/M000158.html +0 -19
- data/doc/classes/Net/HTTP.src/M000159.html +0 -21
- data/doc/classes/Net/HTTP.src/M000161.html +0 -19
- data/doc/classes/Net/HTTPError.html +0 -120
- data/doc/classes/Net/HTTPExceptions.html +0 -137
- data/doc/classes/Net/HTTPFatalError.html +0 -120
- data/doc/classes/Net/HTTPGenericRequest.html +0 -274
- data/doc/classes/Net/HTTPGenericRequest.src/M000088.html +0 -26
- data/doc/classes/Net/HTTPGenericRequest.src/M000089.html +0 -18
- data/doc/classes/Net/HTTPGenericRequest.src/M000090.html +0 -18
- data/doc/classes/Net/HTTPGenericRequest.src/M000091.html +0 -18
- data/doc/classes/Net/HTTPGenericRequest.src/M000092.html +0 -19
- data/doc/classes/Net/HTTPGenericRequest.src/M000093.html +0 -20
- data/doc/classes/Net/HTTPGenericRequest.src/M000094.html +0 -20
- data/doc/classes/Net/HTTPHeader.html +0 -734
- data/doc/classes/Net/HTTPHeader.src/M000055.html +0 -23
- data/doc/classes/Net/HTTPHeader.src/M000056.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000057.html +0 -22
- data/doc/classes/Net/HTTPHeader.src/M000058.html +0 -22
- data/doc/classes/Net/HTTPHeader.src/M000059.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000060.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000061.html +0 -20
- data/doc/classes/Net/HTTPHeader.src/M000063.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000065.html +0 -20
- data/doc/classes/Net/HTTPHeader.src/M000066.html +0 -20
- data/doc/classes/Net/HTTPHeader.src/M000067.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000068.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000069.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000070.html +0 -20
- data/doc/classes/Net/HTTPHeader.src/M000072.html +0 -30
- data/doc/classes/Net/HTTPHeader.src/M000073.html +0 -43
- data/doc/classes/Net/HTTPHeader.src/M000075.html +0 -21
- data/doc/classes/Net/HTTPHeader.src/M000076.html +0 -22
- data/doc/classes/Net/HTTPHeader.src/M000077.html +0 -20
- data/doc/classes/Net/HTTPHeader.src/M000078.html +0 -21
- data/doc/classes/Net/HTTPHeader.src/M000079.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000080.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000081.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000082.html +0 -19
- data/doc/classes/Net/HTTPHeader.src/M000083.html +0 -23
- data/doc/classes/Net/HTTPHeader.src/M000084.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000086.html +0 -18
- data/doc/classes/Net/HTTPHeader.src/M000087.html +0 -18
- data/doc/classes/Net/HTTPRequest.html +0 -150
- data/doc/classes/Net/HTTPRequest.src/M000102.html +0 -21
- data/doc/classes/Net/HTTPResponse.html +0 -425
- data/doc/classes/Net/HTTPResponse.src/M000162.html +0 -18
- data/doc/classes/Net/HTTPResponse.src/M000163.html +0 -18
- data/doc/classes/Net/HTTPResponse.src/M000164.html +0 -23
- data/doc/classes/Net/HTTPResponse.src/M000165.html +0 -18
- data/doc/classes/Net/HTTPResponse.src/M000166.html +0 -32
- data/doc/classes/Net/HTTPResponse.src/M000167.html +0 -18
- data/doc/classes/Net/HTTPRetriableError.html +0 -120
- data/doc/classes/Net/HTTPServerException.html +0 -120
- data/doc/classes/Net/ProtoAuthError.html +0 -113
- data/doc/classes/Net/ProtoCommandError.html +0 -113
- data/doc/classes/Net/ProtoFatalError.html +0 -113
- data/doc/classes/Net/ProtoRetriableError.html +0 -113
- data/doc/classes/Net/ProtoServerError.html +0 -113
- data/doc/classes/Net/ProtoSyntaxError.html +0 -113
- data/doc/classes/Net/ProtoUnknownError.html +0 -113
- data/doc/classes/Net/ProtocolError.html +0 -111
- data/doc/classes/Net/WriteAdapter.html +0 -235
- data/doc/classes/Net/WriteAdapter.src/M000095.html +0 -19
- data/doc/classes/Net/WriteAdapter.src/M000096.html +0 -18
- data/doc/classes/Net/WriteAdapter.src/M000097.html +0 -18
- data/doc/classes/Net/WriteAdapter.src/M000099.html +0 -19
- data/doc/classes/Net/WriteAdapter.src/M000100.html +0 -18
- data/doc/classes/Net/WriteAdapter.src/M000101.html +0 -18
- data/doc/classes/REXML/Comment.html +0 -137
- data/doc/classes/REXML/Comment.src/M000053.html +0 -18
- data/doc/classes/REXML/Node.html +0 -240
- data/doc/classes/REXML/Node.src/M000047.html +0 -21
- data/doc/classes/REXML/Node.src/M000048.html +0 -21
- data/doc/classes/REXML/Node.src/M000049.html +0 -22
- data/doc/classes/REXML/Node.src/M000050.html +0 -18
- data/doc/classes/REXML/Node.src/M000051.html +0 -18
- data/doc/classes/REXML/Node.src/M000052.html +0 -18
- data/doc/classes/REXML/Text.html +0 -137
- data/doc/classes/REXML/Text.src/M000054.html +0 -18
- data/doc/classes/REXML.html +0 -109
- data/doc/classes/WWW/Button.html +0 -190
- data/doc/classes/WWW/Button.src/M000028.html +0 -18
- data/doc/classes/WWW/Button.src/M000029.html +0 -18
- data/doc/classes/WWW/Button.src/M000030.html +0 -25
- data/doc/classes/WWW/CheckBox.html +0 -160
- data/doc/classes/WWW/CheckBox.src/M000024.html +0 -18
- data/doc/classes/WWW/Cookie.html +0 -207
- data/doc/classes/WWW/Cookie.src/M000032.html +0 -59
- data/doc/classes/WWW/Cookie.src/M000033.html +0 -21
- data/doc/classes/WWW/Cookie.src/M000034.html +0 -18
- data/doc/classes/WWW/CookieJar.html +0 -197
- data/doc/classes/WWW/CookieJar.src/M000008.html +0 -18
- data/doc/classes/WWW/CookieJar.src/M000009.html +0 -22
- data/doc/classes/WWW/CookieJar.src/M000010.html +0 -33
- data/doc/classes/WWW/CookieJar.src/M000011.html +0 -18
- data/doc/classes/WWW/Field.html +0 -174
- data/doc/classes/WWW/Field.src/M000045.html +0 -18
- data/doc/classes/WWW/Field.src/M000046.html +0 -26
- data/doc/classes/WWW/FileUpload.html +0 -163
- data/doc/classes/WWW/FileUpload.src/M000031.html +0 -19
- data/doc/classes/WWW/Form.html +0 -152
- data/doc/classes/WWW/Form.src/M000044.html +0 -19
- data/doc/classes/WWW/GlobalForm.html +0 -271
- data/doc/classes/WWW/GlobalForm.src/M000004.html +0 -24
- data/doc/classes/WWW/GlobalForm.src/M000005.html +0 -26
- data/doc/classes/WWW/GlobalForm.src/M000006.html +0 -46
- data/doc/classes/WWW/GlobalForm.src/M000007.html +0 -46
- data/doc/classes/WWW/ImageButton.html +0 -157
- data/doc/classes/WWW/ImageButton.src/M000027.html +0 -22
- data/doc/classes/WWW/Link.html +0 -160
- data/doc/classes/WWW/Link.src/M000025.html +0 -20
- data/doc/classes/WWW/Mechanize.html +0 -379
- data/doc/classes/WWW/Mechanize.src/M000013.html +0 -21
- data/doc/classes/WWW/Mechanize.src/M000014.html +0 -18
- data/doc/classes/WWW/Mechanize.src/M000015.html +0 -24
- data/doc/classes/WWW/Mechanize.src/M000016.html +0 -19
- data/doc/classes/WWW/Mechanize.src/M000017.html +0 -23
- data/doc/classes/WWW/Mechanize.src/M000018.html +0 -32
- data/doc/classes/WWW/Mechanize.src/M000019.html +0 -19
- data/doc/classes/WWW/Mechanize.src/M000020.html +0 -18
- data/doc/classes/WWW/Mechanize.src/M000021.html +0 -33
- data/doc/classes/WWW/Mechanize.src/M000022.html +0 -18
- data/doc/classes/WWW/Meta.html +0 -113
- data/doc/classes/WWW/Page.html +0 -313
- data/doc/classes/WWW/Page.src/M000036.html +0 -18
- data/doc/classes/WWW/Page.src/M000037.html +0 -18
- data/doc/classes/WWW/Page.src/M000038.html +0 -18
- data/doc/classes/WWW/Page.src/M000039.html +0 -19
- data/doc/classes/WWW/Page.src/M000040.html +0 -19
- data/doc/classes/WWW/Page.src/M000041.html +0 -19
- data/doc/classes/WWW/Page.src/M000042.html +0 -19
- data/doc/classes/WWW/Page.src/M000043.html +0 -19
- data/doc/classes/WWW/RadioButton.html +0 -160
- data/doc/classes/WWW/RadioButton.src/M000012.html +0 -18
- data/doc/classes/WWW/ResponseCodeError.html +0 -150
- data/doc/classes/WWW/ResponseCodeError.src/M000035.html +0 -18
- data/doc/classes/WWW/SelectList.html +0 -160
- data/doc/classes/WWW/SelectList.src/M000026.html +0 -28
- data/doc/classes/WWW.html +0 -130
- data/doc/created.rid +0 -1
- data/doc/files/CHANGELOG.html +0 -136
- data/doc/files/LICENSE.html +0 -531
- data/doc/files/README.html +0 -161
- data/doc/files/lib/mechanize/cookie_rb.html +0 -101
- data/doc/files/lib/mechanize/net-overrides/net/http_rb.html +0 -139
- data/doc/files/lib/mechanize/net-overrides/net/https_rb.html +0 -109
- data/doc/files/lib/mechanize/net-overrides/net/protocol_rb.html +0 -117
- data/doc/files/lib/mechanize/parsing_rb.html +0 -267
- data/doc/files/lib/mechanize/parsing_rb.src/M000001.html +0 -22
- data/doc/files/lib/mechanize/parsing_rb.src/M000002.html +0 -44
- data/doc/files/lib/mechanize/parsing_rb.src/M000003.html +0 -34
- data/doc/files/lib/mechanize_rb.html +0 -152
- data/doc/fr_class_index.html +0 -80
- data/doc/fr_file_index.html +0 -35
- data/doc/fr_method_index.html +0 -194
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
@@ -1,23 +0,0 @@
|
|
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>initialize_http_header (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1021</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_http_header</span>(<span class="ruby-identifier">initheader</span>)
|
15
|
-
<span class="ruby-ivar">@header</span> = {}
|
16
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">initheader</span>
|
17
|
-
<span class="ruby-identifier">initheader</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
18
|
-
<span class="ruby-identifier">warn</span> <span class="ruby-node">"net/http: warning: duplicated HTTP header: #{key}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">$VERBOSE</span>
|
19
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>] = [<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strip</span>]
|
20
|
-
<span class="ruby-keyword kw">end</span>
|
21
|
-
<span class="ruby-keyword kw">end</span></pre>
|
22
|
-
</body>
|
23
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>[] (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1038</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
|
15
|
-
<span class="ruby-identifier">a</span> = <span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
16
|
-
<span class="ruby-identifier">a</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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>[]= (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1044</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
|
15
|
-
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>
|
16
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>
|
17
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>] = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">val</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_str</span> }
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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>add_field (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1062</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_field</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
|
15
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>)
|
16
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>].<span class="ruby-identifier">concat</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">val</span>)
|
17
|
-
<span class="ruby-keyword kw">else</span>
|
18
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>] = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">val</span>).<span class="ruby-identifier">dup</span>
|
19
|
-
<span class="ruby-keyword kw">end</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>get_fields (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1080</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fields</span>(<span class="ruby-identifier">key</span>)
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>]
|
16
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>].<span class="ruby-identifier">dup</span>
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>fetch (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1088</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment cmt">#:yield: +key+</span>
|
15
|
-
<span class="ruby-identifier">a</span> = <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
16
|
-
<span class="ruby-identifier">a</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>each_header (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1094</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_header</span> <span class="ruby-comment cmt">#:yield: +key+, +value+</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">va</span><span class="ruby-operator">|</span>
|
16
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">k</span>, <span class="ruby-identifier">va</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>each_name (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1103</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_name</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment cmt">#:yield: +key+</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">each_key</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>each_capitalized_name (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1110</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_capitalized_name</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment cmt">#:yield: +key+</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
16
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">capitalize</span>(<span class="ruby-identifier">k</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>each_value (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1117</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_value</span> <span class="ruby-comment cmt">#:yield: +value+</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">va</span><span class="ruby-operator">|</span>
|
16
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">va</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>delete (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1124</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>key? (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1129</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">downcase</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>to_hash (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1134</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">dup</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>each_capitalized (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1139</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_capitalized</span>
|
15
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
16
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">capitalize</span>(<span class="ruby-identifier">k</span>), <span class="ruby-identifier">v</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,30 +0,0 @@
|
|
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>range (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1154</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'range'</span>]
|
16
|
-
<span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Range'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,/</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">m</span> = <span class="ruby-regexp re">/bytes\s*=\s*(\d+)?\s*-\s*(\d+)?/i</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">spec</span>) <span class="ruby-keyword kw">or</span>
|
18
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-node">"wrong Range: #{spec}"</span>
|
19
|
-
<span class="ruby-identifier">d1</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>
|
20
|
-
<span class="ruby-identifier">d2</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span>
|
21
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>] <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">d1</span><span class="ruby-operator">..</span><span class="ruby-identifier">d2</span>
|
22
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>] <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">d1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>
|
23
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>] <span class="ruby-keyword kw">then</span> <span class="ruby-operator">-</span><span class="ruby-identifier">d2</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>
|
24
|
-
<span class="ruby-keyword kw">else</span>
|
25
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'range is not specified'</span>
|
26
|
-
<span class="ruby-keyword kw">end</span>
|
27
|
-
}
|
28
|
-
<span class="ruby-keyword kw">end</span></pre>
|
29
|
-
</body>
|
30
|
-
</html>
|
@@ -1,43 +0,0 @@
|
|
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>set_range (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1176</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_range</span>(<span class="ruby-identifier">r</span>, <span class="ruby-identifier">e</span> = <span class="ruby-keyword kw">nil</span>)
|
15
|
-
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">r</span>
|
16
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'range'</span>
|
17
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">r</span>
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-identifier">r</span> = (<span class="ruby-identifier">r</span><span class="ruby-operator">...</span><span class="ruby-identifier">r</span><span class="ruby-operator">+</span><span class="ruby-identifier">e</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>
|
20
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">r</span>
|
21
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Numeric</span>
|
22
|
-
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">to_i</span>
|
23
|
-
<span class="ruby-identifier">rangestr</span> = (<span class="ruby-identifier">n</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-node">"0-#{n-1}"</span> <span class="ruby-operator">:</span> <span class="ruby-node">"-#{-n}"</span>)
|
24
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Range</span>
|
25
|
-
<span class="ruby-identifier">first</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">first</span>
|
26
|
-
<span class="ruby-identifier">last</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">last</span>
|
27
|
-
<span class="ruby-identifier">last</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">exclude_end?</span>
|
28
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span>
|
29
|
-
<span class="ruby-identifier">rangestr</span> = (<span class="ruby-identifier">first</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-node">"#{first}-"</span> <span class="ruby-operator">:</span> <span class="ruby-node">"-#{-first}"</span>)
|
30
|
-
<span class="ruby-keyword kw">else</span>
|
31
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'range.first is negative'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
32
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'range.last is negative'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
33
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'must be .first < .last'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span> <span class="ruby-operator">></span> <span class="ruby-identifier">last</span>
|
34
|
-
<span class="ruby-identifier">rangestr</span> = <span class="ruby-node">"#{first}-#{last}"</span>
|
35
|
-
<span class="ruby-keyword kw">end</span>
|
36
|
-
<span class="ruby-keyword kw">else</span>
|
37
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">'Range/Integer is required'</span>
|
38
|
-
<span class="ruby-keyword kw">end</span>
|
39
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-value str">'range'</span>] = [<span class="ruby-node">"bytes=#{rangestr}"</span>]
|
40
|
-
<span class="ruby-identifier">r</span>
|
41
|
-
<span class="ruby-keyword kw">end</span></pre>
|
42
|
-
</body>
|
43
|
-
</html>
|
@@ -1,21 +0,0 @@
|
|
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>content_length (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1209</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_length</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">key?</span>(<span class="ruby-value str">'Content-Length'</span>)
|
16
|
-
<span class="ruby-identifier">len</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Length'</span>].<span class="ruby-identifier">slice</span>(<span class="ruby-regexp re">/\d+/</span>) <span class="ruby-keyword kw">or</span>
|
17
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'wrong Content-Length format'</span>
|
18
|
-
<span class="ruby-identifier">len</span>.<span class="ruby-identifier">to_i</span>
|
19
|
-
<span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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>content_length= (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1216</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_length=</span>(<span class="ruby-identifier">len</span>)
|
15
|
-
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">len</span>
|
16
|
-
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'content-length'</span>
|
17
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-ivar">@header</span>[<span class="ruby-value str">'content-length'</span>] = [<span class="ruby-identifier">len</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>]
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>chunked? (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1228</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chunked?</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'transfer-encoding'</span>]
|
16
|
-
<span class="ruby-identifier">field</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Transfer-Encoding'</span>]
|
17
|
-
(<span class="ruby-regexp re">/(?:\A|[^\-\w])chunked(?![\-\w])/i</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">field</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
18
|
-
<span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,21 +0,0 @@
|
|
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>content_range (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1237</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_range</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'content-range'</span>]
|
16
|
-
<span class="ruby-identifier">m</span> = <span class="ruby-regexp re">%r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i</span>.<span class="ruby-identifier">match</span>(<span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Range'</span>]) <span class="ruby-keyword kw">or</span>
|
17
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">HTTPHeaderSyntaxError</span>, <span class="ruby-value str">'wrong Content-Range format'</span>
|
18
|
-
<span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">..</span> <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
19
|
-
<span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>range_length (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1245</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range_length</span>
|
15
|
-
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">content_range</span>() <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
16
|
-
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">end</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">begin</span>
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>content_type (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1250</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type</span>
|
15
|
-
<span class="ruby-node">"#{main_type()}/#{sub_type()}"</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>main_type (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1254</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_type</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'content-type'</span>]
|
16
|
-
<span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Type'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">';'</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
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>sub_type (Net::HTTPHeader)</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/mechanize/net-overrides/net/http.rb, line 1259</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sub_type</span>
|
15
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'content-type'</span>]
|
16
|
-
<span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Type'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">';'</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|