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,121 +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::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>
|
data/doc/classes/XHTML.html
DELETED
@@ -1,118 +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: 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
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Wed Dec 27 10:57:03 -0700 2006
|
data/doc/files/README.html
DELETED
@@ -1,213 +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>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>
|