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.
Files changed (48) hide show
  1. data/README +2 -2
  2. data/Rakefile +1 -1
  3. data/bin/atom-client.rb +71 -45
  4. data/lib/atom/element.rb +7 -2
  5. data/lib/atom/entry.rb +51 -16
  6. data/lib/atom/feed.rb +6 -6
  7. data/lib/atom/http.rb +23 -19
  8. data/lib/atom/service.rb +0 -2
  9. data/lib/atom/text.rb +34 -12
  10. data/lib/atom/xml.rb +26 -17
  11. data/lib/atom/yaml.rb +23 -8
  12. data/test/test_constructs.rb +16 -2
  13. data/test/test_general.rb +22 -9
  14. data/test/test_http.rb +12 -8
  15. data/test/test_xml.rb +66 -20
  16. metadata +4 -40
  17. data/doc/classes/Atom/Author.html +0 -130
  18. data/doc/classes/Atom/Category.html +0 -128
  19. data/doc/classes/Atom/Collection.html +0 -322
  20. data/doc/classes/Atom/Content.html +0 -129
  21. data/doc/classes/Atom/Contributor.html +0 -119
  22. data/doc/classes/Atom/DigestAuth.html +0 -285
  23. data/doc/classes/Atom/Element.html +0 -325
  24. data/doc/classes/Atom/Entry.html +0 -369
  25. data/doc/classes/Atom/Feed.html +0 -595
  26. data/doc/classes/Atom/HTTP.html +0 -436
  27. data/doc/classes/Atom/HTTPResponse.html +0 -149
  28. data/doc/classes/Atom/Link.html +0 -137
  29. data/doc/classes/Atom/Service.html +0 -260
  30. data/doc/classes/Atom/Text.html +0 -245
  31. data/doc/classes/Atom/Workspace.html +0 -121
  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/collection_rb.html +0 -110
  36. data/doc/files/lib/atom/element_rb.html +0 -109
  37. data/doc/files/lib/atom/entry_rb.html +0 -111
  38. data/doc/files/lib/atom/feed_rb.html +0 -112
  39. data/doc/files/lib/atom/http_rb.html +0 -112
  40. data/doc/files/lib/atom/service_rb.html +0 -111
  41. data/doc/files/lib/atom/text_rb.html +0 -109
  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 -42
  45. data/doc/fr_file_index.html +0 -36
  46. data/doc/fr_method_index.html +0 -69
  47. data/doc/index.html +0 -24
  48. 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>
@@ -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">&quot;http://www.w3.org/1999/xhtml&quot;</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
@@ -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 &lt;<a href="http://www.w3.org/2005/Atom">www.w3.org/2005/Atom</a>&gt;
76
- feeds and entries. It handles all the nasty XML and HTTP details so that
77
- you don&#8216;t have to.
78
- </p>
79
- <h2>Example</h2>
80
- <pre>
81
- require &quot;atom/feed&quot;
82
- require &quot;open-uri&quot;
83
-
84
- feed = Atom::Feed.new &quot;http://www.tbray.org/ongoing/ongoing.atom&quot;
85
- # =&gt; &lt;http://www.tbray.org/ongoing/ongoing.atom entries: 0 title=''&gt;
86
-
87
- feed.update!
88
- feed.entries.length
89
- # =&gt; 20
90
-
91
- feed.title.to_s
92
- # =&gt; &quot;ongoing&quot;
93
-
94
- feed.authors.first.name
95
- # =&gt; &quot;Tim Bray&quot;
96
-
97
- entry = feed.entries.first
98
- # =&gt; #&lt;Atom::Entry id:'http://www.tbray.org/ongoing/When/200x/2006/11/07/Munich'&gt;
99
-
100
- entry.title.to_s
101
- # =&gt; &quot;M\303\274nchen&quot;
102
-
103
- entry.links.last
104
- # =&gt; {&quot;href&quot;=&gt;&quot;http://www.tbray.org/ongoing/When/200x/2006/11/07/Munich#comments&quot;, &quot;rel&quot;=&gt;&quot;replies&quot;, &quot;type&quot; =&gt; &quot;application/xhtml+xml&quot;}
105
-
106
- entry.summary.to_s
107
- # =&gt; &quot;That local spelling is nicer than the ugly English [...]&quot;
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 &quot;atom/service&quot;
115
-
116
- service = Atom::Service.new &quot;http://necronomicorp.com/app.xml&quot;
117
- coll = service.workspaces.first.collections.first
118
- # =&gt; &lt;http://necronomicorp.com/testatom?app entries: 0 title='testing: entry endpoint'&gt;
119
-
120
- coll.update!
121
- # =&gt; &lt;http://necronomicorp.com/testatom?app entries: 10 title='testing the APP'&gt;
122
-
123
- entry = coll.entries.first
124
- entry.title
125
- # =&gt; 'html entities'#text
126
-
127
- # modify the title
128
- entry.title = &quot;HTML entities&quot;
129
-
130
- # store the modified entry
131
- coll.put! entry
132
- # =&gt; #&lt;Net::HTTPOK 200 OK readbody=true&gt;
133
-
134
- coll.entries.first.title
135
- # =&gt; '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(&quot;in-reply-to&quot;)
145
- irt.add_namespace &quot;http://purl.org/syndication/thread/1.0&quot;
146
-
147
- irt.attributes[&quot;ref&quot;] = &quot;tag:entries.com,2005:1&quot;
148
-
149
- entry.extensions &lt;&lt; irt
150
-
151
- entry.to_s
152
- # =&gt; '&lt;entry xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;&lt;in-reply-to ref=&quot;tag:entries.com,2005:1&quot; xmlns=&quot;http://purl.org/syndication/thread/1.0&quot;/&gt;&lt;/entry&gt;'
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 &quot;atom/yaml&quot;
161
-
162
- yaml = &lt;&lt;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
- &lt;p&gt;blah blah blah blah&lt;/p&gt;
175
-
176
- &lt;p&gt;and so on.&lt;/p&gt;
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>