atom-tools 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/README +3 -3
  2. data/Rakefile +1 -1
  3. data/bin/atom-client.rb +13 -10
  4. data/lib/atom/collection.rb +2 -2
  5. data/lib/atom/element.rb +5 -1
  6. data/lib/atom/entry.rb +9 -2
  7. data/lib/atom/feed.rb +11 -6
  8. data/lib/atom/http.rb +157 -38
  9. data/lib/atom/service.rb +170 -0
  10. data/lib/atom/text.rb +15 -2
  11. data/lib/atom/xml.rb +1 -1
  12. data/test/conformance/updated.rb +2 -1
  13. data/test/test_constructs.rb +45 -2
  14. data/test/test_feed.rb +27 -0
  15. data/test/test_http.rb +116 -20
  16. data/test/test_protocol.rb +77 -13
  17. data/test/test_xml.rb +15 -1
  18. metadata +3 -38
  19. data/bin/atom-server.rb~ +0 -71
  20. data/doc/classes/Atom/App.html +0 -217
  21. data/doc/classes/Atom/Author.html +0 -130
  22. data/doc/classes/Atom/Category.html +0 -128
  23. data/doc/classes/Atom/Collection.html +0 -322
  24. data/doc/classes/Atom/Content.html +0 -129
  25. data/doc/classes/Atom/Contributor.html +0 -119
  26. data/doc/classes/Atom/Element.html +0 -325
  27. data/doc/classes/Atom/Entry.html +0 -365
  28. data/doc/classes/Atom/Feed.html +0 -585
  29. data/doc/classes/Atom/HTTP.html +0 -374
  30. data/doc/classes/Atom/Link.html +0 -137
  31. data/doc/classes/Atom/Text.html +0 -229
  32. data/doc/classes/XHTML.html +0 -118
  33. data/doc/created.rid +0 -1
  34. data/doc/files/README.html +0 -213
  35. data/doc/files/lib/atom/app_rb.html +0 -110
  36. data/doc/files/lib/atom/collection_rb.html +0 -110
  37. data/doc/files/lib/atom/element_rb.html +0 -109
  38. data/doc/files/lib/atom/entry_rb.html +0 -111
  39. data/doc/files/lib/atom/feed_rb.html +0 -112
  40. data/doc/files/lib/atom/http_rb.html +0 -109
  41. data/doc/files/lib/atom/text_rb.html +0 -108
  42. data/doc/files/lib/atom/xml_rb.html +0 -110
  43. data/doc/files/lib/atom/yaml_rb.html +0 -109
  44. data/doc/fr_class_index.html +0 -39
  45. data/doc/fr_file_index.html +0 -36
  46. data/doc/fr_method_index.html +0 -62
  47. data/doc/index.html +0 -24
  48. data/doc/rdoc-style.css +0 -208
  49. data/lib/atom/app.rb +0 -87
@@ -1,130 +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::Author</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::Author</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
- A person construct has the following child elements:
86
- </p>
87
- <table>
88
- <tr><td valign="top">name (required):</td><td>a human-readable name
89
-
90
- </td></tr>
91
- <tr><td valign="top">uri:</td><td>an IRI associated with the person
92
-
93
- </td></tr>
94
- <tr><td valign="top">email:</td><td>an email address associated with the person
95
-
96
- </td></tr>
97
- </table>
98
-
99
- </div>
100
-
101
-
102
- </div>
103
-
104
-
105
- </div>
106
-
107
-
108
- <!-- if includes -->
109
-
110
- <div id="section">
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <!-- if method_list -->
120
-
121
-
122
- </div>
123
-
124
-
125
- <div id="validator-badges">
126
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
127
- </div>
128
-
129
- </body>
130
- </html>
@@ -1,128 +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::Category</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::Category</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
- Atom::AttrEl
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
- <div id="description">
82
- <p>
83
- A category has the following attributes:
84
- </p>
85
- <table>
86
- <tr><td valign="top">term (required):</td><td>a string that identifies the category
87
-
88
- </td></tr>
89
- <tr><td valign="top">scheme:</td><td>an IRI that identifies a categorization scheme
90
-
91
- </td></tr>
92
- <tr><td valign="top">label:</td><td>a human-readable label
93
-
94
- </td></tr>
95
- </table>
96
-
97
- </div>
98
-
99
-
100
- </div>
101
-
102
-
103
- </div>
104
-
105
-
106
- <!-- if includes -->
107
-
108
- <div id="section">
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
- <!-- if method_list -->
118
-
119
-
120
- </div>
121
-
122
-
123
- <div id="validator-badges">
124
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
125
- </div>
126
-
127
- </body>
128
- </html>
@@ -1,322 +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::Collection</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::Collection</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/atom/collection_rb.html">
59
- lib/atom/collection.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="Feed.html">
69
- Feed
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
- represents an Atom Publishing Protocol <a
86
- href="Collection.html">Collection</a>
87
- </p>
88
-
89
- </div>
90
-
91
-
92
- </div>
93
-
94
- <div id="method-list">
95
- <h3 class="section-bar">Methods</h3>
96
-
97
- <div class="name-list">
98
- <a href="#M000029">delete!</a>&nbsp;&nbsp;
99
- <a href="#M000026">new</a>&nbsp;&nbsp;
100
- <a href="#M000027">post!</a>&nbsp;&nbsp;
101
- <a href="#M000030">post_media!</a>&nbsp;&nbsp;
102
- <a href="#M000028">put!</a>&nbsp;&nbsp;
103
- <a href="#M000031">put_media!</a>&nbsp;&nbsp;
104
- </div>
105
- </div>
106
-
107
- </div>
108
-
109
-
110
- <!-- if includes -->
111
-
112
- <div id="section">
113
-
114
-
115
-
116
-
117
-
118
- <div id="attribute-list">
119
- <h3 class="section-bar">Attributes</h3>
120
-
121
- <div class="name-list">
122
- <table>
123
- <tr class="top-aligned-row context-row">
124
- <td class="context-item-name">accepts</td>
125
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
126
- <td class="context-item-desc">
127
- comma separated string that contains a list of media types accepted by a
128
- collection.
129
-
130
- <p>
131
- XXX I should parse this in some way, but I&#8217;m not sure what&#8217;s
132
- useful
133
- </p>
134
- </td>
135
- </tr>
136
- </table>
137
- </div>
138
- </div>
139
-
140
-
141
-
142
- <!-- if method_list -->
143
- <div id="methods">
144
- <h3 class="section-bar">Public Class methods</h3>
145
-
146
- <div id="method-M000026" class="method-detail">
147
- <a name="M000026"></a>
148
-
149
- <div class="method-heading">
150
- <a href="#M000026" class="method-signature">
151
- <span class="method-name">new</span><span class="method-args">(uri, http = Atom::HTTP.new)</span>
152
- </a>
153
- </div>
154
-
155
- <div class="method-description">
156
- <p><a class="source-toggle" href="#"
157
- onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
158
- <div class="method-source-code" id="M000026-source">
159
- <pre>
160
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 16</span>
161
- 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">http</span> = <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>)
162
- 17: <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">http</span>
163
- 18: <span class="ruby-keyword kw">end</span>
164
- </pre>
165
- </div>
166
- </div>
167
- </div>
168
-
169
- <h3 class="section-bar">Public Instance methods</h3>
170
-
171
- <div id="method-M000029" class="method-detail">
172
- <a name="M000029"></a>
173
-
174
- <div class="method-heading">
175
- <a href="#M000029" class="method-signature">
176
- <span class="method-name">delete!</span><span class="method-args">(entry, url = entry.edit_url)</span>
177
- </a>
178
- </div>
179
-
180
- <div class="method-description">
181
- <p>
182
- DELETE an entry from the collection
183
- </p>
184
- <p><a class="source-toggle" href="#"
185
- onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
186
- <div class="method-source-code" id="M000029-source">
187
- <pre>
188
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 35</span>
189
- 35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete!</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">url</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">edit_url</span>)
190
- 36: <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">url</span>)
191
- 37: <span class="ruby-keyword kw">end</span>
192
- </pre>
193
- </div>
194
- </div>
195
- </div>
196
-
197
- <div id="method-M000027" class="method-detail">
198
- <a name="M000027"></a>
199
-
200
- <div class="method-heading">
201
- <a href="#M000027" class="method-signature">
202
- <span class="method-name">post!</span><span class="method-args">(entry, slug = nil)</span>
203
- </a>
204
- </div>
205
-
206
- <div class="method-description">
207
- <p>
208
- POST an entry to the collection, with a slug
209
- </p>
210
- <p><a class="source-toggle" href="#"
211
- onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
212
- <div class="method-source-code" id="M000027-source">
213
- <pre>
214
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 21</span>
215
- 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post!</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">slug</span> = <span class="ruby-keyword kw">nil</span>)
216
- 22: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cowardly refusing to POST a non-Atom::Entry&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>
217
- 23: <span class="ruby-identifier">headers</span> = {<span class="ruby-value str">&quot;Content-Type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;application/atom+xml&quot;</span> }
218
- 24: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">&quot;Slug&quot;</span>] = <span class="ruby-identifier">slug</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">slug</span>
219
- 25:
220
- 26: <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">post</span>(<span class="ruby-ivar">@uri</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">headers</span>)
221
- 27: <span class="ruby-keyword kw">end</span>
222
- </pre>
223
- </div>
224
- </div>
225
- </div>
226
-
227
- <div id="method-M000030" class="method-detail">
228
- <a name="M000030"></a>
229
-
230
- <div class="method-heading">
231
- <a href="#M000030" class="method-signature">
232
- <span class="method-name">post_media!</span><span class="method-args">(data, content_type, slug = nil)</span>
233
- </a>
234
- </div>
235
-
236
- <div class="method-description">
237
- <p>
238
- POST a media item to the collection
239
- </p>
240
- <p><a class="source-toggle" href="#"
241
- onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
242
- <div class="method-source-code" id="M000030-source">
243
- <pre>
244
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 40</span>
245
- 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post_media!</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">content_type</span>, <span class="ruby-identifier">slug</span> = <span class="ruby-keyword kw">nil</span>)
246
- 41: <span class="ruby-identifier">headers</span> = {<span class="ruby-value str">&quot;Content-Type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">content_type</span>}
247
- 42: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">&quot;Slug&quot;</span>] = <span class="ruby-identifier">slug</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">slug</span>
248
- 43:
249
- 44: <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">post</span>(<span class="ruby-ivar">@uri</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
250
- 45: <span class="ruby-keyword kw">end</span>
251
- </pre>
252
- </div>
253
- </div>
254
- </div>
255
-
256
- <div id="method-M000028" class="method-detail">
257
- <a name="M000028"></a>
258
-
259
- <div class="method-heading">
260
- <a href="#M000028" class="method-signature">
261
- <span class="method-name">put!</span><span class="method-args">(entry, url = entry.edit_url)</span>
262
- </a>
263
- </div>
264
-
265
- <div class="method-description">
266
- <p>
267
- PUT an updated version of an entry to the collection
268
- </p>
269
- <p><a class="source-toggle" href="#"
270
- onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
271
- <div class="method-source-code" id="M000028-source">
272
- <pre>
273
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 30</span>
274
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put!</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">url</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">edit_url</span>)
275
- 31: <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">put_atom_entry</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">url</span>)
276
- 32: <span class="ruby-keyword kw">end</span>
277
- </pre>
278
- </div>
279
- </div>
280
- </div>
281
-
282
- <div id="method-M000031" class="method-detail">
283
- <a name="M000031"></a>
284
-
285
- <div class="method-heading">
286
- <a href="#M000031" class="method-signature">
287
- <span class="method-name">put_media!</span><span class="method-args">(data, content_type, slug = nil)</span>
288
- </a>
289
- </div>
290
-
291
- <div class="method-description">
292
- <p>
293
- PUT a media item to the collection
294
- </p>
295
- <p><a class="source-toggle" href="#"
296
- onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
297
- <div class="method-source-code" id="M000031-source">
298
- <pre>
299
- <span class="ruby-comment cmt"># File lib/atom/collection.rb, line 48</span>
300
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_media!</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">content_type</span>, <span class="ruby-identifier">slug</span> = <span class="ruby-keyword kw">nil</span>)
301
- 49: <span class="ruby-identifier">headers</span> = {<span class="ruby-value str">&quot;Content-Type&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">content_type</span>}
302
- 50:
303
- 51: <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">put</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
304
- 52: <span class="ruby-keyword kw">end</span>
305
- </pre>
306
- </div>
307
- </div>
308
- </div>
309
-
310
-
311
- </div>
312
-
313
-
314
- </div>
315
-
316
-
317
- <div id="validator-badges">
318
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
319
- </div>
320
-
321
- </body>
322
- </html>