atom-tools 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/doc/classes/Atom/Author.html +130 -0
- data/doc/classes/Atom/Category.html +128 -0
- data/doc/classes/Atom/Collection.html +322 -0
- data/doc/classes/Atom/Content.html +129 -0
- data/doc/classes/Atom/Contributor.html +119 -0
- data/doc/classes/Atom/DigestAuth.html +285 -0
- data/doc/classes/Atom/Element.html +325 -0
- data/doc/classes/Atom/Entry.html +369 -0
- data/doc/classes/Atom/Feed.html +595 -0
- data/doc/classes/Atom/HTTP.html +436 -0
- data/doc/classes/Atom/HTTPResponse.html +149 -0
- data/doc/classes/Atom/Link.html +137 -0
- data/doc/classes/Atom/Service.html +260 -0
- data/doc/classes/Atom/Text.html +245 -0
- data/doc/classes/Atom/Workspace.html +121 -0
- data/doc/classes/XHTML.html +118 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +213 -0
- data/doc/files/lib/atom/collection_rb.html +110 -0
- data/doc/files/lib/atom/element_rb.html +109 -0
- data/doc/files/lib/atom/entry_rb.html +111 -0
- data/doc/files/lib/atom/feed_rb.html +112 -0
- data/doc/files/lib/atom/http_rb.html +112 -0
- data/doc/files/lib/atom/service_rb.html +111 -0
- data/doc/files/lib/atom/text_rb.html +109 -0
- data/doc/files/lib/atom/xml_rb.html +110 -0
- data/doc/files/lib/atom/yaml_rb.html +109 -0
- data/doc/fr_class_index.html +42 -0
- data/doc/fr_file_index.html +36 -0
- data/doc/fr_method_index.html +69 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/atom/collection.rb +0 -21
- data/lib/atom/entry.rb +13 -0
- data/lib/atom/feed.rb +6 -7
- data/lib/atom/http.rb +97 -19
- data/lib/atom/service.rb +2 -22
- data/lib/atom/yaml.rb +1 -1
- data/test/test_feed.rb +27 -4
- data/test/test_http.rb +153 -34
- metadata +39 -2
@@ -0,0 +1,121 @@
|
|
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::Workspace</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::Workspace</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/atom/service_rb.html">
|
59
|
+
lib/atom/service.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
|
+
an <a href="Workspace.html">Atom::Workspace</a> has a title (<a
|
86
|
+
href="Text.html">Atom::Text</a>) and collections, an Array of <a
|
87
|
+
href="Collection.html">Atom::Collection</a> s
|
88
|
+
</p>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<!-- if method_list -->
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
<div id="validator-badges">
|
117
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
</body>
|
121
|
+
</html>
|
@@ -0,0 +1,118 @@
|
|
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: XHTML</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">XHTML</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
|
+
</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
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
<!-- if includes -->
|
84
|
+
|
85
|
+
<div id="section">
|
86
|
+
|
87
|
+
|
88
|
+
<div id="constants-list">
|
89
|
+
<h3 class="section-bar">Constants</h3>
|
90
|
+
|
91
|
+
<div class="name-list">
|
92
|
+
<table summary="Constants">
|
93
|
+
<tr class="top-aligned-row context-row">
|
94
|
+
<td class="context-item-name">NS</td>
|
95
|
+
<td>=</td>
|
96
|
+
<td class="context-item-value">"http://www.w3.org/1999/xhtml"</td>
|
97
|
+
</tr>
|
98
|
+
</table>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<div id="validator-badges">
|
114
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</body>
|
118
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Wed Dec 27 10:57:03 -0700 2006
|
@@ -0,0 +1,213 @@
|
|
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>File: README</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="fileHeader">
|
50
|
+
<h1>README</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Thu Nov 09 20:31:09 -0700 2006</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1>atom-tools README</h1>
|
73
|
+
<p>
|
74
|
+
atom-tools is an all-in-one library for parsing, creating and manipulating
|
75
|
+
Atom <<a href="http://www.w3.org/2005/Atom">www.w3.org/2005/Atom</a>>
|
76
|
+
feeds and entries. It handles all the nasty XML and HTTP details so that
|
77
|
+
you don‘t have to.
|
78
|
+
</p>
|
79
|
+
<h2>Example</h2>
|
80
|
+
<pre>
|
81
|
+
require "atom/feed"
|
82
|
+
require "open-uri"
|
83
|
+
|
84
|
+
feed = Atom::Feed.new "http://www.tbray.org/ongoing/ongoing.atom"
|
85
|
+
# => <http://www.tbray.org/ongoing/ongoing.atom entries: 0 title=''>
|
86
|
+
|
87
|
+
feed.update!
|
88
|
+
feed.entries.length
|
89
|
+
# => 20
|
90
|
+
|
91
|
+
feed.title.to_s
|
92
|
+
# => "ongoing"
|
93
|
+
|
94
|
+
feed.authors.first.name
|
95
|
+
# => "Tim Bray"
|
96
|
+
|
97
|
+
entry = feed.entries.first
|
98
|
+
# => #<Atom::Entry id:'http://www.tbray.org/ongoing/When/200x/2006/11/07/Munich'>
|
99
|
+
|
100
|
+
entry.title.to_s
|
101
|
+
# => "M\303\274nchen"
|
102
|
+
|
103
|
+
entry.links.last
|
104
|
+
# => {"href"=>"http://www.tbray.org/ongoing/When/200x/2006/11/07/Munich#comments", "rel"=>"replies", "type" => "application/xhtml+xml"}
|
105
|
+
|
106
|
+
entry.summary.to_s
|
107
|
+
# => "That local spelling is nicer than the ugly English [...]"
|
108
|
+
</pre>
|
109
|
+
<p>
|
110
|
+
Things are explained in more detail in the RDoc.
|
111
|
+
</p>
|
112
|
+
<h2>The Atom Publishing Protocol</h2>
|
113
|
+
<pre>
|
114
|
+
require "atom/service"
|
115
|
+
|
116
|
+
service = Atom::Service.new "http://necronomicorp.com/app.xml"
|
117
|
+
coll = service.workspaces.first.collections.first
|
118
|
+
# => <http://necronomicorp.com/testatom?app entries: 0 title='testing: entry endpoint'>
|
119
|
+
|
120
|
+
coll.update!
|
121
|
+
# => <http://necronomicorp.com/testatom?app entries: 10 title='testing the APP'>
|
122
|
+
|
123
|
+
entry = coll.entries.first
|
124
|
+
entry.title
|
125
|
+
# => 'html entities'#text
|
126
|
+
|
127
|
+
# modify the title
|
128
|
+
entry.title = "HTML entities"
|
129
|
+
|
130
|
+
# store the modified entry
|
131
|
+
coll.put! entry
|
132
|
+
# => #<Net::HTTPOK 200 OK readbody=true>
|
133
|
+
|
134
|
+
coll.entries.first.title
|
135
|
+
# => 'HTML entities'#text
|
136
|
+
</pre>
|
137
|
+
<p>
|
138
|
+
For details on authentication, see the documentation for <a
|
139
|
+
href="../classes/Atom/HTTP.html">Atom::HTTP</a>
|
140
|
+
</p>
|
141
|
+
<h2>Advanced Use</h2>
|
142
|
+
<h3>Extension Elements</h3>
|
143
|
+
<pre>
|
144
|
+
irt = REXML::Element.new("in-reply-to")
|
145
|
+
irt.add_namespace "http://purl.org/syndication/thread/1.0"
|
146
|
+
|
147
|
+
irt.attributes["ref"] = "tag:entries.com,2005:1"
|
148
|
+
|
149
|
+
entry.extensions << irt
|
150
|
+
|
151
|
+
entry.to_s
|
152
|
+
# => '<entry xmlns="http://www.w3.org/2005/Atom"><in-reply-to ref="tag:entries.com,2005:1" xmlns="http://purl.org/syndication/thread/1.0"/></entry>'
|
153
|
+
</pre>
|
154
|
+
<h2>YAML</h2>
|
155
|
+
<p>
|
156
|
+
if you feel like writing this stuff by hand, atom-tools can slurp an
|
157
|
+
atom:entry from YAML:
|
158
|
+
</p>
|
159
|
+
<pre>
|
160
|
+
require "atom/yaml"
|
161
|
+
|
162
|
+
yaml = <<END
|
163
|
+
title: Atom-Drunk Pirates Run Amok!
|
164
|
+
tags: tag1 tag2
|
165
|
+
authors:
|
166
|
+
-
|
167
|
+
name: Brendan Taylor
|
168
|
+
email: whateley@gmail.com
|
169
|
+
-
|
170
|
+
name: Harvey
|
171
|
+
uri: http://fake.com/
|
172
|
+
|
173
|
+
content: |
|
174
|
+
<p>blah blah blah blah</p>
|
175
|
+
|
176
|
+
<p>and so on.</p>
|
177
|
+
END
|
178
|
+
|
179
|
+
entry = Atom::Entry.from_yaml(yaml)
|
180
|
+
</pre>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
<!-- if includes -->
|
192
|
+
|
193
|
+
<div id="section">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<!-- if method_list -->
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div id="validator-badges">
|
209
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
</body>
|
213
|
+
</html>
|