atom-tools 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/COPYING +18 -0
  2. data/README +103 -0
  3. data/Rakefile +77 -0
  4. data/bin/atom-client.rb +246 -0
  5. data/bin/atom-server.rb~ +71 -0
  6. data/doc/classes/Atom/App.html +217 -0
  7. data/doc/classes/Atom/Author.html +130 -0
  8. data/doc/classes/Atom/Category.html +128 -0
  9. data/doc/classes/Atom/Collection.html +322 -0
  10. data/doc/classes/Atom/Content.html +129 -0
  11. data/doc/classes/Atom/Contributor.html +119 -0
  12. data/doc/classes/Atom/Element.html +325 -0
  13. data/doc/classes/Atom/Entry.html +365 -0
  14. data/doc/classes/Atom/Feed.html +585 -0
  15. data/doc/classes/Atom/HTTP.html +374 -0
  16. data/doc/classes/Atom/Link.html +137 -0
  17. data/doc/classes/Atom/Text.html +229 -0
  18. data/doc/classes/XHTML.html +118 -0
  19. data/doc/created.rid +1 -0
  20. data/doc/files/README.html +213 -0
  21. data/doc/files/lib/atom/app_rb.html +110 -0
  22. data/doc/files/lib/atom/collection_rb.html +110 -0
  23. data/doc/files/lib/atom/element_rb.html +109 -0
  24. data/doc/files/lib/atom/entry_rb.html +111 -0
  25. data/doc/files/lib/atom/feed_rb.html +112 -0
  26. data/doc/files/lib/atom/http_rb.html +109 -0
  27. data/doc/files/lib/atom/text_rb.html +108 -0
  28. data/doc/files/lib/atom/xml_rb.html +110 -0
  29. data/doc/files/lib/atom/yaml_rb.html +109 -0
  30. data/doc/fr_class_index.html +39 -0
  31. data/doc/fr_file_index.html +36 -0
  32. data/doc/fr_method_index.html +62 -0
  33. data/doc/index.html +24 -0
  34. data/doc/rdoc-style.css +208 -0
  35. data/lib/atom/app.rb +87 -0
  36. data/lib/atom/collection.rb +75 -0
  37. data/lib/atom/element.rb +277 -0
  38. data/lib/atom/entry.rb +135 -0
  39. data/lib/atom/feed.rb +229 -0
  40. data/lib/atom/http.rb +132 -0
  41. data/lib/atom/text.rb +163 -0
  42. data/lib/atom/xml.rb +200 -0
  43. data/lib/atom/yaml.rb +101 -0
  44. data/setup.rb +1585 -0
  45. data/test/conformance/order.rb +117 -0
  46. data/test/conformance/title.rb +108 -0
  47. data/test/conformance/updated.rb +33 -0
  48. data/test/conformance/xhtmlcontentdiv.rb +18 -0
  49. data/test/conformance/xmlnamespace.rb +54 -0
  50. data/test/runtests.rb +14 -0
  51. data/test/test_constructs.rb +91 -0
  52. data/test/test_feed.rb +128 -0
  53. data/test/test_general.rb +99 -0
  54. data/test/test_http.rb +86 -0
  55. data/test/test_protocol.rb +69 -0
  56. data/test/test_xml.rb +353 -0
  57. metadata +107 -0
@@ -0,0 +1,322 @@
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>
@@ -0,0 +1,129 @@
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 &quot;type&quot; attribute can be an arbitrary media type
90
+
91
+ </li>
92
+ <li>there is a &quot;src&quot; 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>