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,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>new (WWW::CheckBox)</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.rb, line 110</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">checked</span>)
|
15
|
-
<span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@value</span>, <span class="ruby-ivar">@checked</span> = <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">checked</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
data/doc/classes/WWW/Cookie.html
DELETED
@@ -1,207 +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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: WWW::Cookie</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">WWW::Cookie</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/mechanize/cookie_rb.html">
|
59
|
-
lib/mechanize/cookie.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000032">new</a>
|
90
|
-
<a href="#M000033">parse</a>
|
91
|
-
<a href="#M000034">to_s</a>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
98
|
-
<!-- if includes -->
|
99
|
-
|
100
|
-
<div id="section">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
<div id="attribute-list">
|
107
|
-
<h3 class="section-bar">Attributes</h3>
|
108
|
-
|
109
|
-
<div class="name-list">
|
110
|
-
<table>
|
111
|
-
<tr class="top-aligned-row context-row">
|
112
|
-
<td class="context-item-name">domain</td>
|
113
|
-
<td class="context-item-value"> [R] </td>
|
114
|
-
<td class="context-item-desc"></td>
|
115
|
-
</tr>
|
116
|
-
<tr class="top-aligned-row context-row">
|
117
|
-
<td class="context-item-name">expires</td>
|
118
|
-
<td class="context-item-value"> [R] </td>
|
119
|
-
<td class="context-item-desc"></td>
|
120
|
-
</tr>
|
121
|
-
<tr class="top-aligned-row context-row">
|
122
|
-
<td class="context-item-name">name</td>
|
123
|
-
<td class="context-item-value"> [R] </td>
|
124
|
-
<td class="context-item-desc"></td>
|
125
|
-
</tr>
|
126
|
-
<tr class="top-aligned-row context-row">
|
127
|
-
<td class="context-item-name">path</td>
|
128
|
-
<td class="context-item-value"> [R] </td>
|
129
|
-
<td class="context-item-desc"></td>
|
130
|
-
</tr>
|
131
|
-
<tr class="top-aligned-row context-row">
|
132
|
-
<td class="context-item-name">secure</td>
|
133
|
-
<td class="context-item-value"> [R] </td>
|
134
|
-
<td class="context-item-desc"></td>
|
135
|
-
</tr>
|
136
|
-
<tr class="top-aligned-row context-row">
|
137
|
-
<td class="context-item-name">value</td>
|
138
|
-
<td class="context-item-value"> [R] </td>
|
139
|
-
<td class="context-item-desc"></td>
|
140
|
-
</tr>
|
141
|
-
</table>
|
142
|
-
</div>
|
143
|
-
</div>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<!-- if method_list -->
|
148
|
-
<div id="methods">
|
149
|
-
<h3 class="section-bar">Public Class methods</h3>
|
150
|
-
|
151
|
-
<div id="method-M000032" class="method-detail">
|
152
|
-
<a name="M000032"></a>
|
153
|
-
|
154
|
-
<div class="method-heading">
|
155
|
-
<a href="Cookie.src/M000032.html" target="Code" class="method-signature"
|
156
|
-
onclick="popupCode('Cookie.src/M000032.html');return false;">
|
157
|
-
<span class="method-name">new</span><span class="method-args">(url, cookie_text)</span>
|
158
|
-
</a>
|
159
|
-
</div>
|
160
|
-
|
161
|
-
<div class="method-description">
|
162
|
-
</div>
|
163
|
-
</div>
|
164
|
-
|
165
|
-
<div id="method-M000033" class="method-detail">
|
166
|
-
<a name="M000033"></a>
|
167
|
-
|
168
|
-
<div class="method-heading">
|
169
|
-
<a href="Cookie.src/M000033.html" target="Code" class="method-signature"
|
170
|
-
onclick="popupCode('Cookie.src/M000033.html');return false;">
|
171
|
-
<span class="method-name">parse</span><span class="method-args">(uri, raw_cookie) {|Cookie.new(uri, cookie)| ...}</span>
|
172
|
-
</a>
|
173
|
-
</div>
|
174
|
-
|
175
|
-
<div class="method-description">
|
176
|
-
</div>
|
177
|
-
</div>
|
178
|
-
|
179
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
180
|
-
|
181
|
-
<div id="method-M000034" class="method-detail">
|
182
|
-
<a name="M000034"></a>
|
183
|
-
|
184
|
-
<div class="method-heading">
|
185
|
-
<a href="Cookie.src/M000034.html" target="Code" class="method-signature"
|
186
|
-
onclick="popupCode('Cookie.src/M000034.html');return false;">
|
187
|
-
<span class="method-name">to_s</span><span class="method-args">()</span>
|
188
|
-
</a>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
<div class="method-description">
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
|
195
|
-
|
196
|
-
</div>
|
197
|
-
|
198
|
-
|
199
|
-
</div>
|
200
|
-
|
201
|
-
|
202
|
-
<div id="validator-badges">
|
203
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
204
|
-
</div>
|
205
|
-
|
206
|
-
</body>
|
207
|
-
</html>
|
@@ -1,59 +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>new (WWW::Cookie)</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/cookie.rb, line 4</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">cookie_text</span>)
|
15
|
-
<span class="ruby-identifier">cookie</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
16
|
-
<span class="ruby-identifier">cookie_text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/; /</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'='</span>, <span class="ruby-value">2</span>)
|
18
|
-
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">name</span>
|
19
|
-
<span class="ruby-identifier">cookie</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span> <span class="ruby-value">? </span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">value</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
20
|
-
<span class="ruby-keyword kw">end</span>
|
21
|
-
|
22
|
-
<span class="ruby-ivar">@path</span> = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">delete</span>(
|
23
|
-
<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"path"</span> }
|
24
|
-
) <span class="ruby-operator">||</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">path</span>
|
25
|
-
|
26
|
-
<span class="ruby-identifier">expires_key</span> = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"expires"</span> }
|
27
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expires_key</span>
|
28
|
-
<span class="ruby-ivar">@expires</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">expires_key</span>),
|
29
|
-
<span class="ruby-value str">"%A %d-%b-%y %H:%M:%S %Z"</span>)
|
30
|
-
<span class="ruby-keyword kw">end</span>
|
31
|
-
|
32
|
-
<span class="ruby-identifier">secure_key</span> = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"secure"</span> }
|
33
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">secure_key</span>
|
34
|
-
<span class="ruby-ivar">@secure</span> = <span class="ruby-keyword kw">true</span>
|
35
|
-
<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">secure_key</span>)
|
36
|
-
<span class="ruby-keyword kw">else</span>
|
37
|
-
<span class="ruby-ivar">@secure</span> = <span class="ruby-keyword kw">false</span>
|
38
|
-
<span class="ruby-keyword kw">end</span>
|
39
|
-
|
40
|
-
<span class="ruby-comment cmt"># Set the domain name of the cookie</span>
|
41
|
-
<span class="ruby-identifier">domain_key</span> = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"domain"</span> }
|
42
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">domain_key</span>
|
43
|
-
<span class="ruby-identifier">domain</span> = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">domain_key</span>)
|
44
|
-
<span class="ruby-identifier">domain</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/^\./</span>, <span class="ruby-value str">''</span>)
|
45
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/#{domain}$/</span>
|
46
|
-
<span class="ruby-ivar">@domain</span> = <span class="ruby-identifier">domain</span>
|
47
|
-
<span class="ruby-keyword kw">end</span>
|
48
|
-
<span class="ruby-keyword kw">else</span>
|
49
|
-
<span class="ruby-ivar">@domain</span> = <span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span>
|
50
|
-
<span class="ruby-keyword kw">end</span>
|
51
|
-
|
52
|
-
<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
53
|
-
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">strip</span>
|
54
|
-
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">strip</span>
|
55
|
-
<span class="ruby-ivar">@string</span> = <span class="ruby-node">"#{k}=#{URI::escape(v)}"</span>
|
56
|
-
}
|
57
|
-
<span class="ruby-keyword kw">end</span></pre>
|
58
|
-
</body>
|
59
|
-
</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>parse (WWW::Cookie)</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/cookie.rb, line 49</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Cookie</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">raw_cookie</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
15
|
-
<span class="ruby-identifier">esc</span> = <span class="ruby-identifier">raw_cookie</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/(expires=[^,]*),([^;]*(;|$))/i</span>) { <span class="ruby-node">"#{$1}#{$2}"</span> }
|
16
|
-
<span class="ruby-identifier">esc</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cookie</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-constant">Cookie</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">cookie</span>)
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</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_s (WWW::Cookie)</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/cookie.rb, line 56</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
15
|
-
<span class="ruby-ivar">@string</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,197 +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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: WWW::CookieJar</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">WWW::CookieJar</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/mechanize/cookie_rb.html">
|
59
|
-
lib/mechanize/cookie.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000009">add</a>
|
90
|
-
<a href="#M000010">cookies</a>
|
91
|
-
<a href="#M000011">empty?</a>
|
92
|
-
<a href="#M000008">new</a>
|
93
|
-
</div>
|
94
|
-
</div>
|
95
|
-
|
96
|
-
</div>
|
97
|
-
|
98
|
-
|
99
|
-
<!-- if includes -->
|
100
|
-
|
101
|
-
<div id="section">
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<div id="attribute-list">
|
108
|
-
<h3 class="section-bar">Attributes</h3>
|
109
|
-
|
110
|
-
<div class="name-list">
|
111
|
-
<table>
|
112
|
-
<tr class="top-aligned-row context-row">
|
113
|
-
<td class="context-item-name">jar</td>
|
114
|
-
<td class="context-item-value"> [RW] </td>
|
115
|
-
<td class="context-item-desc"></td>
|
116
|
-
</tr>
|
117
|
-
</table>
|
118
|
-
</div>
|
119
|
-
</div>
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<!-- if method_list -->
|
124
|
-
<div id="methods">
|
125
|
-
<h3 class="section-bar">Public Class methods</h3>
|
126
|
-
|
127
|
-
<div id="method-M000008" class="method-detail">
|
128
|
-
<a name="M000008"></a>
|
129
|
-
|
130
|
-
<div class="method-heading">
|
131
|
-
<a href="CookieJar.src/M000008.html" target="Code" class="method-signature"
|
132
|
-
onclick="popupCode('CookieJar.src/M000008.html');return false;">
|
133
|
-
<span class="method-name">new</span><span class="method-args">()</span>
|
134
|
-
</a>
|
135
|
-
</div>
|
136
|
-
|
137
|
-
<div class="method-description">
|
138
|
-
</div>
|
139
|
-
</div>
|
140
|
-
|
141
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
142
|
-
|
143
|
-
<div id="method-M000009" class="method-detail">
|
144
|
-
<a name="M000009"></a>
|
145
|
-
|
146
|
-
<div class="method-heading">
|
147
|
-
<a href="CookieJar.src/M000009.html" target="Code" class="method-signature"
|
148
|
-
onclick="popupCode('CookieJar.src/M000009.html');return false;">
|
149
|
-
<span class="method-name">add</span><span class="method-args">(cookie)</span>
|
150
|
-
</a>
|
151
|
-
</div>
|
152
|
-
|
153
|
-
<div class="method-description">
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
|
157
|
-
<div id="method-M000010" class="method-detail">
|
158
|
-
<a name="M000010"></a>
|
159
|
-
|
160
|
-
<div class="method-heading">
|
161
|
-
<a href="CookieJar.src/M000010.html" target="Code" class="method-signature"
|
162
|
-
onclick="popupCode('CookieJar.src/M000010.html');return false;">
|
163
|
-
<span class="method-name">cookies</span><span class="method-args">(url)</span>
|
164
|
-
</a>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
<div class="method-description">
|
168
|
-
</div>
|
169
|
-
</div>
|
170
|
-
|
171
|
-
<div id="method-M000011" class="method-detail">
|
172
|
-
<a name="M000011"></a>
|
173
|
-
|
174
|
-
<div class="method-heading">
|
175
|
-
<a href="CookieJar.src/M000011.html" target="Code" class="method-signature"
|
176
|
-
onclick="popupCode('CookieJar.src/M000011.html');return false;">
|
177
|
-
<span class="method-name">empty?</span><span class="method-args">(url)</span>
|
178
|
-
</a>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
<div class="method-description">
|
182
|
-
</div>
|
183
|
-
</div>
|
184
|
-
|
185
|
-
|
186
|
-
</div>
|
187
|
-
|
188
|
-
|
189
|
-
</div>
|
190
|
-
|
191
|
-
|
192
|
-
<div id="validator-badges">
|
193
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
194
|
-
</div>
|
195
|
-
|
196
|
-
</body>
|
197
|
-
</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>new (WWW::CookieJar)</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/cookie.rb, line 63</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
15
|
-
<span class="ruby-ivar">@jar</span> = {}
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</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 (WWW::CookieJar)</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/cookie.rb, line 67</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add</span>(<span class="ruby-identifier">cookie</span>)
|
15
|
-
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@jar</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">domain</span>)
|
16
|
-
<span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">domain</span>] = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
|
19
|
-
<span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">domain</span>][<span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">cookie</span>
|
20
|
-
<span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,33 +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>cookies (WWW::CookieJar)</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/cookie.rb, line 75</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cookies</span>(<span class="ruby-identifier">url</span>)
|
15
|
-
<span class="ruby-identifier">cookies</span> = []
|
16
|
-
<span class="ruby-ivar">@jar</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">domain</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/#{domain}$/</span>
|
18
|
-
<span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">domain</span>].<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
19
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/^#{@jar[domain][name].path}/</span>
|
20
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">domain</span>][<span class="ruby-identifier">name</span>].<span class="ruby-identifier">expires</span>.<span class="ruby-identifier">nil?</span>
|
21
|
-
<span class="ruby-identifier">cookies</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">domain</span>][<span class="ruby-identifier">name</span>]
|
22
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">domain</span>][<span class="ruby-identifier">name</span>].<span class="ruby-identifier">expires</span>
|
23
|
-
<span class="ruby-identifier">cookies</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@jar</span>[<span class="ruby-identifier">domain</span>][<span class="ruby-identifier">name</span>]
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
25
|
-
<span class="ruby-keyword kw">end</span>
|
26
|
-
<span class="ruby-keyword kw">end</span>
|
27
|
-
<span class="ruby-keyword kw">end</span>
|
28
|
-
<span class="ruby-keyword kw">end</span>
|
29
|
-
|
30
|
-
<span class="ruby-identifier">cookies</span>
|
31
|
-
<span class="ruby-keyword kw">end</span></pre>
|
32
|
-
</body>
|
33
|
-
</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>empty? (WWW::CookieJar)</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/cookie.rb, line 94</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">empty?</span>(<span class="ruby-identifier">url</span>)
|
15
|
-
<span class="ruby-identifier">cookies</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">true</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|