atom-tools 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -2
- data/Rakefile +1 -1
- data/bin/atom-client.rb +71 -45
- data/lib/atom/element.rb +7 -2
- data/lib/atom/entry.rb +51 -16
- data/lib/atom/feed.rb +6 -6
- data/lib/atom/http.rb +23 -19
- data/lib/atom/service.rb +0 -2
- data/lib/atom/text.rb +34 -12
- data/lib/atom/xml.rb +26 -17
- data/lib/atom/yaml.rb +23 -8
- data/test/test_constructs.rb +16 -2
- data/test/test_general.rb +22 -9
- data/test/test_http.rb +12 -8
- data/test/test_xml.rb +66 -20
- metadata +4 -40
- data/doc/classes/Atom/Author.html +0 -130
- data/doc/classes/Atom/Category.html +0 -128
- data/doc/classes/Atom/Collection.html +0 -322
- data/doc/classes/Atom/Content.html +0 -129
- data/doc/classes/Atom/Contributor.html +0 -119
- data/doc/classes/Atom/DigestAuth.html +0 -285
- data/doc/classes/Atom/Element.html +0 -325
- data/doc/classes/Atom/Entry.html +0 -369
- data/doc/classes/Atom/Feed.html +0 -595
- data/doc/classes/Atom/HTTP.html +0 -436
- data/doc/classes/Atom/HTTPResponse.html +0 -149
- data/doc/classes/Atom/Link.html +0 -137
- data/doc/classes/Atom/Service.html +0 -260
- data/doc/classes/Atom/Text.html +0 -245
- data/doc/classes/Atom/Workspace.html +0 -121
- data/doc/classes/XHTML.html +0 -118
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -213
- data/doc/files/lib/atom/collection_rb.html +0 -110
- data/doc/files/lib/atom/element_rb.html +0 -109
- data/doc/files/lib/atom/entry_rb.html +0 -111
- data/doc/files/lib/atom/feed_rb.html +0 -112
- data/doc/files/lib/atom/http_rb.html +0 -112
- data/doc/files/lib/atom/service_rb.html +0 -111
- data/doc/files/lib/atom/text_rb.html +0 -109
- data/doc/files/lib/atom/xml_rb.html +0 -110
- data/doc/files/lib/atom/yaml_rb.html +0 -109
- data/doc/fr_class_index.html +0 -42
- data/doc/fr_file_index.html +0 -36
- data/doc/fr_method_index.html +0 -69
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
@@ -1,129 +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: Atom::Content</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">Atom::Content</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/atom/text_rb.html">
|
59
|
-
lib/atom/text.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
|
-
<a href="Text.html">
|
69
|
-
Atom::Text
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
<a href="Content.html">Atom::Content</a> behaves the same as an <a
|
86
|
-
href="Text.html">Atom::Text</a>, but for two things:
|
87
|
-
</p>
|
88
|
-
<ul>
|
89
|
-
<li>the "type" attribute can be an arbitrary media type
|
90
|
-
|
91
|
-
</li>
|
92
|
-
<li>there is a "src" attribute which is an IRI that points to the
|
93
|
-
content of the entry (in which case the content element will be empty)
|
94
|
-
|
95
|
-
</li>
|
96
|
-
</ul>
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
|
101
|
-
</div>
|
102
|
-
|
103
|
-
|
104
|
-
</div>
|
105
|
-
|
106
|
-
|
107
|
-
<!-- if includes -->
|
108
|
-
|
109
|
-
<div id="section">
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<!-- if method_list -->
|
119
|
-
|
120
|
-
|
121
|
-
</div>
|
122
|
-
|
123
|
-
|
124
|
-
<div id="validator-badges">
|
125
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
</body>
|
129
|
-
</html>
|
@@ -1,119 +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: Atom::Contributor</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">Atom::Contributor</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/atom/element_rb.html">
|
59
|
-
lib/atom/element.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
|
-
<a href="Element.html">
|
69
|
-
Atom::Element
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
same as <a href="Author.html">Atom::Author</a>
|
86
|
-
</p>
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
</div>
|
92
|
-
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
<!-- if includes -->
|
98
|
-
|
99
|
-
<div id="section">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<!-- if method_list -->
|
109
|
-
|
110
|
-
|
111
|
-
</div>
|
112
|
-
|
113
|
-
|
114
|
-
<div id="validator-badges">
|
115
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
116
|
-
</div>
|
117
|
-
|
118
|
-
</body>
|
119
|
-
</html>
|
@@ -1,285 +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>Module: Atom::DigestAuth</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>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Atom::DigestAuth</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/atom/http_rb.html">
|
59
|
-
lib/atom/http.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div id="method-list">
|
80
|
-
<h3 class="section-bar">Methods</h3>
|
81
|
-
|
82
|
-
<div class="name-list">
|
83
|
-
<a href="#M000004">digest_authenticate</a>
|
84
|
-
<a href="#M000002">h</a>
|
85
|
-
<a href="#M000003">kd</a>
|
86
|
-
<a href="#M000001">parse_wwwauth_digest</a>
|
87
|
-
</div>
|
88
|
-
</div>
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
<!-- if includes -->
|
94
|
-
|
95
|
-
<div id="section">
|
96
|
-
|
97
|
-
|
98
|
-
<div id="constants-list">
|
99
|
-
<h3 class="section-bar">Constants</h3>
|
100
|
-
|
101
|
-
<div class="name-list">
|
102
|
-
<table summary="Constants">
|
103
|
-
<tr class="top-aligned-row context-row">
|
104
|
-
<td class="context-item-name">CNONCE</td>
|
105
|
-
<td>=</td>
|
106
|
-
<td class="context-item-value">Digest::MD5.new("%x" % (Time.now.to_i + rand(65535))).hexdigest</td>
|
107
|
-
</tr>
|
108
|
-
</table>
|
109
|
-
</div>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
<!-- if method_list -->
|
118
|
-
<div id="methods">
|
119
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
120
|
-
|
121
|
-
<div id="method-M000004" class="method-detail">
|
122
|
-
<a name="M000004"></a>
|
123
|
-
|
124
|
-
<div class="method-heading">
|
125
|
-
<a href="#M000004" class="method-signature">
|
126
|
-
<span class="method-name">digest_authenticate</span><span class="method-args">(req, url, param_string = "")</span>
|
127
|
-
</a>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<div class="method-description">
|
131
|
-
<p>
|
132
|
-
<a href="HTTP.html">HTTP</a> Digest authentication (RFC 2617)
|
133
|
-
</p>
|
134
|
-
<p><a class="source-toggle" href="#"
|
135
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
136
|
-
<div class="method-source-code" id="M000004-source">
|
137
|
-
<pre>
|
138
|
-
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 43</span>
|
139
|
-
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">digest_authenticate</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">param_string</span> = <span class="ruby-value str">""</span>)
|
140
|
-
44: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Digest authentication requires a WWW-Authenticate header"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">param_string</span>.<span class="ruby-identifier">empty?</span>
|
141
|
-
45:
|
142
|
-
46: <span class="ruby-identifier">params</span> = <span class="ruby-identifier">parse_wwwauth_digest</span>(<span class="ruby-identifier">param_string</span>)
|
143
|
-
47: <span class="ruby-identifier">qop</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:qop</span>]
|
144
|
-
48:
|
145
|
-
49: <span class="ruby-identifier">user</span>, <span class="ruby-identifier">pass</span> = <span class="ruby-identifier">username_and_password_for_realm</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:realm</span>])
|
146
|
-
50:
|
147
|
-
51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:algorithm</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"MD5"</span>
|
148
|
-
52: <span class="ruby-identifier">a1</span> = <span class="ruby-identifier">user</span> <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:realm</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">pass</span>
|
149
|
-
53: <span class="ruby-keyword kw">else</span>
|
150
|
-
54: <span class="ruby-comment cmt"># XXX MD5-sess</span>
|
151
|
-
55: <span class="ruby-identifier">raise</span> <span class="ruby-node">"I only support MD5 digest authentication (not #{params[:algorithm].inspect})"</span>
|
152
|
-
56: <span class="ruby-keyword kw">end</span>
|
153
|
-
57:
|
154
|
-
58: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">qop</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">qop</span>.<span class="ruby-identifier">member?</span> <span class="ruby-value str">"auth"</span>
|
155
|
-
59: <span class="ruby-identifier">a2</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">method</span> <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">path</span>
|
156
|
-
60: <span class="ruby-keyword kw">else</span>
|
157
|
-
61: <span class="ruby-comment cmt"># XXX auth-int</span>
|
158
|
-
62: <span class="ruby-identifier">raise</span> <span class="ruby-node">"only 'auth' qop supported (none of: #{qop.inspect})"</span>
|
159
|
-
63: <span class="ruby-keyword kw">end</span>
|
160
|
-
64:
|
161
|
-
65: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">qop</span>.<span class="ruby-identifier">nil?</span>
|
162
|
-
66: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">kd</span>(<span class="ruby-identifier">h</span>(<span class="ruby-identifier">a1</span>), <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:nonce</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">h</span>(<span class="ruby-identifier">a2</span>))
|
163
|
-
67: <span class="ruby-keyword kw">else</span>
|
164
|
-
68: <span class="ruby-ivar">@@nonce_count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
165
|
-
69: <span class="ruby-identifier">nc</span> = (<span class="ruby-value str">'%08x'</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@@nonce_count</span>)
|
166
|
-
70:
|
167
|
-
71: <span class="ruby-comment cmt"># XXX auth-int</span>
|
168
|
-
72: <span class="ruby-identifier">data</span> = <span class="ruby-node">"#{params[:nonce]}:#{nc}:#{CNONCE}:#{"auth"}:#{h(a2)}"</span>
|
169
|
-
73:
|
170
|
-
74: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">kd</span>(<span class="ruby-identifier">h</span>(<span class="ruby-identifier">a1</span>), <span class="ruby-identifier">data</span>)
|
171
|
-
75: <span class="ruby-keyword kw">end</span>
|
172
|
-
76:
|
173
|
-
77: <span class="ruby-identifier">header</span> = <span class="ruby-node">%Q<Digest username="#{user}", uri="#{req.path}", realm="#{params[:realm]}", response="#{response}", nonce="#{params[:nonce]}"></span>
|
174
|
-
78:
|
175
|
-
79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:opaque</span>]
|
176
|
-
80: <span class="ruby-identifier">header</span> <span class="ruby-operator">+=</span> <span class="ruby-node">%Q<, opaque="#{params[:opaque]}"></span>
|
177
|
-
81: <span class="ruby-keyword kw">end</span>
|
178
|
-
82:
|
179
|
-
83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:algorithm</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">"MD5"</span>
|
180
|
-
84: <span class="ruby-identifier">header</span> <span class="ruby-operator">+=</span> <span class="ruby-node">", algorithm=#{algo}"</span>
|
181
|
-
85: <span class="ruby-keyword kw">end</span>
|
182
|
-
86:
|
183
|
-
87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">qop</span>
|
184
|
-
88: <span class="ruby-comment cmt"># XXX auth-int</span>
|
185
|
-
89: <span class="ruby-identifier">header</span> <span class="ruby-operator">+=</span> <span class="ruby-node">%Q<, nc=#{nc}, cnonce="#{CNONCE}", qop=auth></span>
|
186
|
-
90: <span class="ruby-keyword kw">end</span>
|
187
|
-
91:
|
188
|
-
92: <span class="ruby-identifier">req</span>[<span class="ruby-value str">"Authorization"</span>] = <span class="ruby-identifier">header</span>
|
189
|
-
93: <span class="ruby-keyword kw">end</span>
|
190
|
-
</pre>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
|
195
|
-
<div id="method-M000002" class="method-detail">
|
196
|
-
<a name="M000002"></a>
|
197
|
-
|
198
|
-
<div class="method-heading">
|
199
|
-
<a href="#M000002" class="method-signature">
|
200
|
-
<span class="method-name">h</span><span class="method-args">(data)</span>
|
201
|
-
</a>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div class="method-description">
|
205
|
-
<p><a class="source-toggle" href="#"
|
206
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
207
|
-
<div class="method-source-code" id="M000002-source">
|
208
|
-
<pre>
|
209
|
-
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 39</span>
|
210
|
-
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">h</span>(<span class="ruby-identifier">data</span>); <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">data</span>); <span class="ruby-keyword kw">end</span>
|
211
|
-
</pre>
|
212
|
-
</div>
|
213
|
-
</div>
|
214
|
-
</div>
|
215
|
-
|
216
|
-
<div id="method-M000003" class="method-detail">
|
217
|
-
<a name="M000003"></a>
|
218
|
-
|
219
|
-
<div class="method-heading">
|
220
|
-
<a href="#M000003" class="method-signature">
|
221
|
-
<span class="method-name">kd</span><span class="method-args">(secret, data)</span>
|
222
|
-
</a>
|
223
|
-
</div>
|
224
|
-
|
225
|
-
<div class="method-description">
|
226
|
-
<p><a class="source-toggle" href="#"
|
227
|
-
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
228
|
-
<div class="method-source-code" id="M000003-source">
|
229
|
-
<pre>
|
230
|
-
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 40</span>
|
231
|
-
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">kd</span>(<span class="ruby-identifier">secret</span>, <span class="ruby-identifier">data</span>); <span class="ruby-identifier">h</span>(<span class="ruby-identifier">secret</span> <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">data</span>); <span class="ruby-keyword kw">end</span>
|
232
|
-
</pre>
|
233
|
-
</div>
|
234
|
-
</div>
|
235
|
-
</div>
|
236
|
-
|
237
|
-
<div id="method-M000001" class="method-detail">
|
238
|
-
<a name="M000001"></a>
|
239
|
-
|
240
|
-
<div class="method-heading">
|
241
|
-
<a href="#M000001" class="method-signature">
|
242
|
-
<span class="method-name">parse_wwwauth_digest</span><span class="method-args">(param_string)</span>
|
243
|
-
</a>
|
244
|
-
</div>
|
245
|
-
|
246
|
-
<div class="method-description">
|
247
|
-
<p>
|
248
|
-
quoted-strings plus a few special cases for Digest
|
249
|
-
</p>
|
250
|
-
<p><a class="source-toggle" href="#"
|
251
|
-
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
252
|
-
<div class="method-source-code" id="M000001-source">
|
253
|
-
<pre>
|
254
|
-
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 25</span>
|
255
|
-
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_wwwauth_digest</span> <span class="ruby-identifier">param_string</span>
|
256
|
-
26: <span class="ruby-identifier">params</span> = <span class="ruby-identifier">parse_quoted_wwwauth</span> <span class="ruby-identifier">param_string</span>
|
257
|
-
27: <span class="ruby-identifier">qop</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:qop</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:qop</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">","</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
258
|
-
28:
|
259
|
-
29: <span class="ruby-identifier">param_string</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/stale=([^,]*)/</span>) <span class="ruby-keyword kw">do</span>
|
260
|
-
30: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:stale</span>] = (<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"true"</span>)
|
261
|
-
31: <span class="ruby-keyword kw">end</span>
|
262
|
-
32:
|
263
|
-
33: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:algorithm</span>] = <span class="ruby-value str">"MD5"</span>
|
264
|
-
34: <span class="ruby-identifier">param_string</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/algorithm=([^,]*)/</span>) { <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:algorithm</span>] = <span class="ruby-identifier">$1</span> }
|
265
|
-
35:
|
266
|
-
36: <span class="ruby-identifier">params</span>
|
267
|
-
37: <span class="ruby-keyword kw">end</span>
|
268
|
-
</pre>
|
269
|
-
</div>
|
270
|
-
</div>
|
271
|
-
</div>
|
272
|
-
|
273
|
-
|
274
|
-
</div>
|
275
|
-
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
<div id="validator-badges">
|
281
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
282
|
-
</div>
|
283
|
-
|
284
|
-
</body>
|
285
|
-
</html>
|