atom-tools 0.9.0 → 2.0.5
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.
- data/COPYING +3 -3
- data/README +9 -49
- data/Rakefile +65 -62
- data/bin/atom-cp +159 -0
- data/bin/atom-grep +78 -0
- data/bin/atom-post +73 -0
- data/bin/atom-purge +82 -0
- data/doc/classes/Atom/AttrEl.html +163 -0
- data/doc/classes/Atom/Author.html +2 -19
- data/doc/classes/Atom/AutodiscoveryFailure.html +111 -0
- data/doc/classes/Atom/Categories.html +168 -0
- data/doc/classes/Atom/Category.html +10 -1
- data/doc/classes/Atom/Collection.html +194 -91
- data/doc/classes/Atom/Content.html +42 -1
- data/doc/classes/Atom/Contributor.html +2 -8
- data/doc/classes/Atom/Control.html +126 -0
- data/doc/classes/Atom/Converters.html +571 -0
- data/doc/classes/Atom/DigestAuth.html +285 -0
- data/doc/classes/Atom/Element.html +673 -106
- data/doc/classes/Atom/FileCache.html +287 -0
- data/doc/classes/Atom/HTTP.html +211 -95
- data/doc/classes/Atom/HTTPResponse.html +190 -0
- data/doc/classes/Atom/HasCategories.html +187 -0
- data/doc/classes/Atom/HasLinks.html +168 -0
- data/doc/classes/Atom/Link.html +80 -3
- data/doc/classes/Atom/NilCache.html +202 -0
- data/doc/classes/Atom/ParseError.html +111 -0
- data/doc/classes/Atom/Parsers.html +311 -0
- data/doc/classes/Atom/Person.html +130 -0
- data/doc/classes/Atom/Rights.html +113 -0
- data/doc/classes/Atom/Service.html +298 -0
- data/doc/{files/lib/atom/yaml_rb.html → classes/Atom/Source.html} +26 -24
- data/doc/classes/Atom/Subtitle.html +113 -0
- data/doc/classes/Atom/Summary.html +113 -0
- data/doc/classes/Atom/Text.html +196 -53
- data/doc/classes/Atom/Title.html +113 -0
- data/doc/classes/Atom/Tools.html +525 -0
- data/doc/classes/Atom/Workspace.html +121 -0
- data/doc/classes/Object.html +204 -0
- data/doc/created.rid +1 -1
- data/doc/files/README.html +9 -49
- data/doc/files/lib/atom/cache_rb.html +302 -0
- data/doc/files/lib/atom/collection_rb.html +1 -2
- data/doc/files/lib/atom/element_rb.html +2 -1
- data/doc/files/lib/atom/entry_rb.html +2 -2
- data/doc/files/lib/atom/feed_rb.html +1 -2
- data/doc/files/lib/atom/http_rb.html +6 -1
- data/doc/files/lib/atom/{xml_rb.html → service_rb.html} +8 -6
- data/doc/files/lib/atom/text_rb.html +2 -1
- data/doc/files/lib/atom/{app_rb.html → tools_rb.html} +4 -6
- data/doc/fr_class_index.html +23 -3
- data/doc/fr_file_index.html +3 -3
- data/doc/fr_method_index.html +111 -36
- data/lib/atom/cache.rb +178 -0
- data/lib/atom/collection.rb +90 -40
- data/lib/atom/element.rb +569 -161
- data/lib/atom/entry.rb +63 -89
- data/lib/atom/feed.rb +65 -67
- data/lib/atom/http.rb +421 -49
- data/lib/atom/service.rb +106 -0
- data/lib/atom/text.rb +138 -61
- data/lib/atom/tools.rb +163 -0
- data/spec/entry_spec.rb +364 -0
- data/spec/ext_spec.rb +42 -0
- data/spec/feed_spec.rb +39 -0
- data/spec/fixtures/contacts-feed.xml +34 -0
- data/spec/fixtures/entry-w-ext.xml +15 -0
- data/spec/fixtures/entry-w-xml.xml +24 -0
- data/spec/fixtures/entry.xml +42 -0
- data/spec/fixtures/feed-w-ext.xml +33 -0
- data/spec/fixtures/service-w-xhtml-ns.xml +21 -0
- data/spec/fixtures/service.xml +36 -0
- data/spec/service_spec.rb +108 -0
- data/spec/spec_helper.rb +9 -0
- data/test/conformance/order.rb +11 -10
- data/test/conformance/title.rb +9 -9
- data/test/conformance/updated.rb +2 -1
- data/test/runtests.rb +0 -0
- data/test/test_constructs.rb +78 -8
- data/test/test_feed.rb +35 -29
- data/test/test_general.rb +3 -30
- data/test/test_http.rb +248 -34
- data/test/test_protocol.rb +143 -24
- data/test/test_xml.rb +145 -53
- metadata +116 -62
- data/bin/atom-client.rb +0 -246
- data/bin/atom-server.rb~ +0 -71
- data/doc/classes/Atom/App.html +0 -217
- data/doc/classes/Atom/Entry.html +0 -365
- data/doc/classes/Atom/Feed.html +0 -585
- data/lib/atom/app.rb +0 -87
- data/lib/atom/xml.rb +0 -200
- data/lib/atom/yaml.rb +0 -101
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
<tr class="top-aligned-row">
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
|
67
67
|
<td>
|
|
68
|
-
<a href="
|
|
69
|
-
|
|
68
|
+
<a href="Element.html">
|
|
69
|
+
Atom::Element
|
|
70
70
|
</a>
|
|
71
71
|
</td>
|
|
72
72
|
</tr>
|
|
@@ -80,13 +80,6 @@
|
|
|
80
80
|
|
|
81
81
|
<div id="contextContent">
|
|
82
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
83
|
|
|
91
84
|
|
|
92
85
|
</div>
|
|
@@ -95,12 +88,16 @@ href="Collection.html">Collection</a>
|
|
|
95
88
|
<h3 class="section-bar">Methods</h3>
|
|
96
89
|
|
|
97
90
|
<div class="name-list">
|
|
98
|
-
<a href="#
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
101
|
-
<a href="#
|
|
102
|
-
<a href="#
|
|
103
|
-
<a href="#
|
|
91
|
+
<a href="#M000103">accepts</a>
|
|
92
|
+
<a href="#M000104">accepts=</a>
|
|
93
|
+
<a href="#M000109">delete!</a>
|
|
94
|
+
<a href="#M000105">new</a>
|
|
95
|
+
<a href="#M000106">parse</a>
|
|
96
|
+
<a href="#M000107">post!</a>
|
|
97
|
+
<a href="#M000110">post_media!</a>
|
|
98
|
+
<a href="#M000108">put!</a>
|
|
99
|
+
<a href="#M000111">put_media!</a>
|
|
100
|
+
<a href="#M000102">title</a>
|
|
104
101
|
</div>
|
|
105
102
|
</div>
|
|
106
103
|
|
|
@@ -121,17 +118,14 @@ href="Collection.html">Collection</a>
|
|
|
121
118
|
<div class="name-list">
|
|
122
119
|
<table>
|
|
123
120
|
<tr class="top-aligned-row context-row">
|
|
124
|
-
<td class="context-item-name">
|
|
125
|
-
<td class="context-item-value"> [
|
|
126
|
-
<td class="context-item-desc">
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
useful
|
|
133
|
-
</p>
|
|
134
|
-
</td>
|
|
121
|
+
<td class="context-item-name">feed</td>
|
|
122
|
+
<td class="context-item-value"> [R] </td>
|
|
123
|
+
<td class="context-item-desc"></td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr class="top-aligned-row context-row">
|
|
126
|
+
<td class="context-item-name">http</td>
|
|
127
|
+
<td class="context-item-value"> [R] </td>
|
|
128
|
+
<td class="context-item-desc"></td>
|
|
135
129
|
</tr>
|
|
136
130
|
</table>
|
|
137
131
|
</div>
|
|
@@ -143,24 +137,60 @@ useful
|
|
|
143
137
|
<div id="methods">
|
|
144
138
|
<h3 class="section-bar">Public Class methods</h3>
|
|
145
139
|
|
|
146
|
-
<div id="method-
|
|
147
|
-
<a name="
|
|
140
|
+
<div id="method-M000105" class="method-detail">
|
|
141
|
+
<a name="M000105"></a>
|
|
142
|
+
|
|
143
|
+
<div class="method-heading">
|
|
144
|
+
<a href="#M000105" class="method-signature">
|
|
145
|
+
<span class="method-name">new</span><span class="method-args">(href = nil, http = Atom::HTTP.new)</span>
|
|
146
|
+
</a>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div class="method-description">
|
|
150
|
+
<p><a class="source-toggle" href="#"
|
|
151
|
+
onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
|
|
152
|
+
<div class="method-source-code" id="M000105-source">
|
|
153
|
+
<pre>
|
|
154
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 70</span>
|
|
155
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">href</span> = <span class="ruby-keyword kw">nil</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>)
|
|
156
|
+
<span class="ruby-keyword kw">super</span>()
|
|
157
|
+
|
|
158
|
+
<span class="ruby-ivar">@http</span> = <span class="ruby-identifier">http</span>
|
|
159
|
+
|
|
160
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">href</span>
|
|
161
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">href</span> = <span class="ruby-identifier">href</span>
|
|
162
|
+
<span class="ruby-keyword kw">end</span>
|
|
163
|
+
<span class="ruby-keyword kw">end</span>
|
|
164
|
+
</pre>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div id="method-M000106" class="method-detail">
|
|
170
|
+
<a name="M000106"></a>
|
|
148
171
|
|
|
149
172
|
<div class="method-heading">
|
|
150
|
-
<a href="#
|
|
151
|
-
<span class="method-name">
|
|
173
|
+
<a href="#M000106" class="method-signature">
|
|
174
|
+
<span class="method-name">parse</span><span class="method-args">(xml, base = '')</span>
|
|
152
175
|
</a>
|
|
153
176
|
</div>
|
|
154
177
|
|
|
155
178
|
<div class="method-description">
|
|
156
179
|
<p><a class="source-toggle" href="#"
|
|
157
|
-
onclick="toggleCode('
|
|
158
|
-
<div class="method-source-code" id="
|
|
180
|
+
onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
|
|
181
|
+
<div class="method-source-code" id="M000106-source">
|
|
159
182
|
<pre>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
183
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 80</span>
|
|
184
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">xml</span>, <span class="ruby-identifier">base</span> = <span class="ruby-value str">''</span>
|
|
185
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-keyword kw">super</span>
|
|
186
|
+
|
|
187
|
+
<span class="ruby-comment cmt"># URL absolutization</span>
|
|
188
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">e</span>.<span class="ruby-identifier">base</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span>
|
|
189
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span> = (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">base</span>.<span class="ruby-identifier">to_uri</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span>).<span class="ruby-identifier">to_s</span>
|
|
190
|
+
<span class="ruby-keyword kw">end</span>
|
|
191
|
+
|
|
192
|
+
<span class="ruby-identifier">e</span>
|
|
193
|
+
<span class="ruby-keyword kw">end</span>
|
|
164
194
|
</pre>
|
|
165
195
|
</div>
|
|
166
196
|
</div>
|
|
@@ -168,11 +198,61 @@ useful
|
|
|
168
198
|
|
|
169
199
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
170
200
|
|
|
171
|
-
<div id="method-
|
|
172
|
-
<a name="
|
|
201
|
+
<div id="method-M000103" class="method-detail">
|
|
202
|
+
<a name="M000103"></a>
|
|
203
|
+
|
|
204
|
+
<div class="method-heading">
|
|
205
|
+
<a href="#M000103" class="method-signature">
|
|
206
|
+
<span class="method-name">accepts</span><span class="method-args">()</span>
|
|
207
|
+
</a>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="method-description">
|
|
211
|
+
<p><a class="source-toggle" href="#"
|
|
212
|
+
onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
|
|
213
|
+
<div class="method-source-code" id="M000103-source">
|
|
214
|
+
<pre>
|
|
215
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 54</span>
|
|
216
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accepts</span>
|
|
217
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@accepts</span>.<span class="ruby-identifier">empty?</span>
|
|
218
|
+
[<span class="ruby-value str">'application/atom+xml;type=entry'</span>]
|
|
219
|
+
<span class="ruby-keyword kw">else</span>
|
|
220
|
+
<span class="ruby-ivar">@accepts</span>
|
|
221
|
+
<span class="ruby-keyword kw">end</span>
|
|
222
|
+
<span class="ruby-keyword kw">end</span>
|
|
223
|
+
</pre>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div id="method-M000104" class="method-detail">
|
|
229
|
+
<a name="M000104"></a>
|
|
230
|
+
|
|
231
|
+
<div class="method-heading">
|
|
232
|
+
<a href="#M000104" class="method-signature">
|
|
233
|
+
<span class="method-name">accepts=</span><span class="method-args">(array)</span>
|
|
234
|
+
</a>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div class="method-description">
|
|
238
|
+
<p><a class="source-toggle" href="#"
|
|
239
|
+
onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
|
|
240
|
+
<div class="method-source-code" id="M000104-source">
|
|
241
|
+
<pre>
|
|
242
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 62</span>
|
|
243
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accepts=</span> <span class="ruby-identifier">array</span>
|
|
244
|
+
<span class="ruby-ivar">@accepts</span> = <span class="ruby-identifier">array</span>
|
|
245
|
+
<span class="ruby-keyword kw">end</span>
|
|
246
|
+
</pre>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<div id="method-M000109" class="method-detail">
|
|
252
|
+
<a name="M000109"></a>
|
|
173
253
|
|
|
174
254
|
<div class="method-heading">
|
|
175
|
-
<a href="#
|
|
255
|
+
<a href="#M000109" class="method-signature">
|
|
176
256
|
<span class="method-name">delete!</span><span class="method-args">(entry, url = entry.edit_url)</span>
|
|
177
257
|
</a>
|
|
178
258
|
</div>
|
|
@@ -182,53 +262,53 @@ useful
|
|
|
182
262
|
DELETE an entry from the collection
|
|
183
263
|
</p>
|
|
184
264
|
<p><a class="source-toggle" href="#"
|
|
185
|
-
onclick="toggleCode('
|
|
186
|
-
<div class="method-source-code" id="
|
|
265
|
+
onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
|
|
266
|
+
<div class="method-source-code" id="M000109-source">
|
|
187
267
|
<pre>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
268
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 106</span>
|
|
269
|
+
<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>)
|
|
270
|
+
<span class="ruby-ivar">@http</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">url</span>)
|
|
271
|
+
<span class="ruby-keyword kw">end</span>
|
|
192
272
|
</pre>
|
|
193
273
|
</div>
|
|
194
274
|
</div>
|
|
195
275
|
</div>
|
|
196
276
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
277
|
+
<div id="method-M000107" class="method-detail">
|
|
278
|
+
<a name="M000107"></a>
|
|
199
279
|
|
|
200
280
|
<div class="method-heading">
|
|
201
|
-
<a href="#
|
|
281
|
+
<a href="#M000107" class="method-signature">
|
|
202
282
|
<span class="method-name">post!</span><span class="method-args">(entry, slug = nil)</span>
|
|
203
283
|
</a>
|
|
204
284
|
</div>
|
|
205
285
|
|
|
206
286
|
<div class="method-description">
|
|
207
287
|
<p>
|
|
208
|
-
POST an entry to the collection, with
|
|
288
|
+
POST an entry to the collection, with an optional slug
|
|
209
289
|
</p>
|
|
210
290
|
<p><a class="source-toggle" href="#"
|
|
211
|
-
onclick="toggleCode('
|
|
212
|
-
<div class="method-source-code" id="
|
|
291
|
+
onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
|
|
292
|
+
<div class="method-source-code" id="M000107-source">
|
|
213
293
|
<pre>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
294
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 92</span>
|
|
295
|
+
<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>)
|
|
296
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Cowardly refusing to POST a non-Atom::Entry"</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>
|
|
297
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"application/atom+xml"</span> }
|
|
298
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Slug"</span>] = <span class="ruby-identifier">slug</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">slug</span>
|
|
299
|
+
|
|
300
|
+
<span class="ruby-ivar">@http</span>.<span class="ruby-identifier">post</span>(<span class="ruby-ivar">@href</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">headers</span>)
|
|
301
|
+
<span class="ruby-keyword kw">end</span>
|
|
222
302
|
</pre>
|
|
223
303
|
</div>
|
|
224
304
|
</div>
|
|
225
305
|
</div>
|
|
226
306
|
|
|
227
|
-
<div id="method-
|
|
228
|
-
<a name="
|
|
307
|
+
<div id="method-M000110" class="method-detail">
|
|
308
|
+
<a name="M000110"></a>
|
|
229
309
|
|
|
230
310
|
<div class="method-heading">
|
|
231
|
-
<a href="#
|
|
311
|
+
<a href="#M000110" class="method-signature">
|
|
232
312
|
<span class="method-name">post_media!</span><span class="method-args">(data, content_type, slug = nil)</span>
|
|
233
313
|
</a>
|
|
234
314
|
</div>
|
|
@@ -238,26 +318,26 @@ POST an entry to the collection, with a slug
|
|
|
238
318
|
POST a media item to the collection
|
|
239
319
|
</p>
|
|
240
320
|
<p><a class="source-toggle" href="#"
|
|
241
|
-
onclick="toggleCode('
|
|
242
|
-
<div class="method-source-code" id="
|
|
321
|
+
onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
|
|
322
|
+
<div class="method-source-code" id="M000110-source">
|
|
243
323
|
<pre>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
324
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 111</span>
|
|
325
|
+
<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>)
|
|
326
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">content_type</span>}
|
|
327
|
+
<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Slug"</span>] = <span class="ruby-identifier">slug</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">slug</span>
|
|
328
|
+
|
|
329
|
+
<span class="ruby-ivar">@http</span>.<span class="ruby-identifier">post</span>(<span class="ruby-ivar">@href</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
|
|
330
|
+
<span class="ruby-keyword kw">end</span>
|
|
251
331
|
</pre>
|
|
252
332
|
</div>
|
|
253
333
|
</div>
|
|
254
334
|
</div>
|
|
255
335
|
|
|
256
|
-
<div id="method-
|
|
257
|
-
<a name="
|
|
336
|
+
<div id="method-M000108" class="method-detail">
|
|
337
|
+
<a name="M000108"></a>
|
|
258
338
|
|
|
259
339
|
<div class="method-heading">
|
|
260
|
-
<a href="#
|
|
340
|
+
<a href="#M000108" class="method-signature">
|
|
261
341
|
<span class="method-name">put!</span><span class="method-args">(entry, url = entry.edit_url)</span>
|
|
262
342
|
</a>
|
|
263
343
|
</div>
|
|
@@ -267,23 +347,23 @@ POST a media item to the collection
|
|
|
267
347
|
PUT an updated version of an entry to the collection
|
|
268
348
|
</p>
|
|
269
349
|
<p><a class="source-toggle" href="#"
|
|
270
|
-
onclick="toggleCode('
|
|
271
|
-
<div class="method-source-code" id="
|
|
350
|
+
onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
|
|
351
|
+
<div class="method-source-code" id="M000108-source">
|
|
272
352
|
<pre>
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
353
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 101</span>
|
|
354
|
+
<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>)
|
|
355
|
+
<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>)
|
|
356
|
+
<span class="ruby-keyword kw">end</span>
|
|
277
357
|
</pre>
|
|
278
358
|
</div>
|
|
279
359
|
</div>
|
|
280
360
|
</div>
|
|
281
361
|
|
|
282
|
-
<div id="method-
|
|
283
|
-
<a name="
|
|
362
|
+
<div id="method-M000111" class="method-detail">
|
|
363
|
+
<a name="M000111"></a>
|
|
284
364
|
|
|
285
365
|
<div class="method-heading">
|
|
286
|
-
<a href="#
|
|
366
|
+
<a href="#M000111" class="method-signature">
|
|
287
367
|
<span class="method-name">put_media!</span><span class="method-args">(data, content_type, slug = nil)</span>
|
|
288
368
|
</a>
|
|
289
369
|
</div>
|
|
@@ -293,15 +373,38 @@ PUT an updated version of an entry to the collection
|
|
|
293
373
|
PUT a media item to the collection
|
|
294
374
|
</p>
|
|
295
375
|
<p><a class="source-toggle" href="#"
|
|
296
|
-
onclick="toggleCode('
|
|
297
|
-
<div class="method-source-code" id="
|
|
376
|
+
onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
|
|
377
|
+
<div class="method-source-code" id="M000111-source">
|
|
378
|
+
<pre>
|
|
379
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 119</span>
|
|
380
|
+
<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>)
|
|
381
|
+
<span class="ruby-identifier">headers</span> = {<span class="ruby-value str">"Content-Type"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">content_type</span>}
|
|
382
|
+
|
|
383
|
+
<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>)
|
|
384
|
+
<span class="ruby-keyword kw">end</span>
|
|
385
|
+
</pre>
|
|
386
|
+
</div>
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div id="method-M000102" class="method-detail">
|
|
391
|
+
<a name="M000102"></a>
|
|
392
|
+
|
|
393
|
+
<div class="method-heading">
|
|
394
|
+
<a href="#M000102" class="method-signature">
|
|
395
|
+
<span class="method-name">title</span><span class="method-args">()</span>
|
|
396
|
+
</a>
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
<div class="method-description">
|
|
400
|
+
<p><a class="source-toggle" href="#"
|
|
401
|
+
onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
|
|
402
|
+
<div class="method-source-code" id="M000102-source">
|
|
298
403
|
<pre>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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>
|
|
404
|
+
<span class="ruby-comment cmt"># File lib/atom/collection.rb, line 50</span>
|
|
405
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">title</span>
|
|
406
|
+
<span class="ruby-ivar">@title</span> <span class="ruby-keyword kw">or</span> <span class="ruby-ivar">@feed</span>.<span class="ruby-identifier">title</span>
|
|
407
|
+
<span class="ruby-keyword kw">end</span>
|
|
305
408
|
</pre>
|
|
306
409
|
</div>
|
|
307
410
|
</div>
|
|
@@ -89,7 +89,7 @@ href="Text.html">Atom::Text</a>, but for two things:
|
|
|
89
89
|
<li>the "type" attribute can be an arbitrary media type
|
|
90
90
|
|
|
91
91
|
</li>
|
|
92
|
-
<li>there is a "src" attribute which is an
|
|
92
|
+
<li>there is a "src" attribute which is an URI that points to the
|
|
93
93
|
content of the entry (in which case the content element will be empty)
|
|
94
94
|
|
|
95
95
|
</li>
|
|
@@ -100,6 +100,13 @@ content of the entry (in which case the content element will be empty)
|
|
|
100
100
|
|
|
101
101
|
</div>
|
|
102
102
|
|
|
103
|
+
<div id="method-list">
|
|
104
|
+
<h3 class="section-bar">Methods</h3>
|
|
105
|
+
|
|
106
|
+
<div class="name-list">
|
|
107
|
+
<a href="#M000048">src=</a>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
103
110
|
|
|
104
111
|
</div>
|
|
105
112
|
|
|
@@ -116,6 +123,40 @@ content of the entry (in which case the content element will be empty)
|
|
|
116
123
|
|
|
117
124
|
|
|
118
125
|
<!-- if method_list -->
|
|
126
|
+
<div id="methods">
|
|
127
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
128
|
+
|
|
129
|
+
<div id="method-M000048" class="method-detail">
|
|
130
|
+
<a name="M000048"></a>
|
|
131
|
+
|
|
132
|
+
<div class="method-heading">
|
|
133
|
+
<a href="#M000048" class="method-signature">
|
|
134
|
+
<span class="method-name">src=</span><span class="method-args">(v)</span>
|
|
135
|
+
</a>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div class="method-description">
|
|
139
|
+
<p><a class="source-toggle" href="#"
|
|
140
|
+
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
|
141
|
+
<div class="method-source-code" id="M000048-source">
|
|
142
|
+
<pre>
|
|
143
|
+
<span class="ruby-comment cmt"># File lib/atom/text.rb, line 206</span>
|
|
144
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">src=</span> <span class="ruby-identifier">v</span>
|
|
145
|
+
<span class="ruby-ivar">@content</span> = <span class="ruby-keyword kw">nil</span>
|
|
146
|
+
|
|
147
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base</span>
|
|
148
|
+
<span class="ruby-ivar">@src</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base</span>.<span class="ruby-identifier">to_uri</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">v</span>).<span class="ruby-identifier">to_s</span>
|
|
149
|
+
<span class="ruby-keyword kw">else</span>
|
|
150
|
+
<span class="ruby-ivar">@src</span> = <span class="ruby-identifier">v</span>
|
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
|
152
|
+
<span class="ruby-keyword kw">end</span>
|
|
153
|
+
</pre>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
</div>
|
|
119
160
|
|
|
120
161
|
|
|
121
162
|
</div>
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
<tr class="top-aligned-row">
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
|
67
67
|
<td>
|
|
68
|
-
<a href="
|
|
69
|
-
Atom::
|
|
68
|
+
<a href="Person.html">
|
|
69
|
+
Atom::Person
|
|
70
70
|
</a>
|
|
71
71
|
</td>
|
|
72
72
|
</tr>
|
|
@@ -80,12 +80,6 @@
|
|
|
80
80
|
|
|
81
81
|
<div id="contextContent">
|
|
82
82
|
|
|
83
|
-
<div id="description">
|
|
84
|
-
<p>
|
|
85
|
-
same as <a href="Author.html">Atom::Author</a>
|
|
86
|
-
</p>
|
|
87
|
-
|
|
88
|
-
</div>
|
|
89
83
|
|
|
90
84
|
|
|
91
85
|
</div>
|
|
@@ -0,0 +1,126 @@
|
|
|
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::Control</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::Control</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/atom/entry_rb.html">
|
|
59
|
+
lib/atom/entry.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
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<!-- if includes -->
|
|
92
|
+
|
|
93
|
+
<div id="section">
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<div id="attribute-list">
|
|
100
|
+
<h3 class="section-bar">Attributes</h3>
|
|
101
|
+
|
|
102
|
+
<div class="name-list">
|
|
103
|
+
<table>
|
|
104
|
+
<tr class="top-aligned-row context-row">
|
|
105
|
+
<td class="context-item-name">draft</td>
|
|
106
|
+
<td class="context-item-value"> [RW] </td>
|
|
107
|
+
<td class="context-item-desc"></td>
|
|
108
|
+
</tr>
|
|
109
|
+
</table>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<!-- if method_list -->
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<div id="validator-badges">
|
|
122
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|