s33r 0.2 → 0.3

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 (71) hide show
  1. data/bin/s3cli.rb +25 -16
  2. data/html/classes/MIME.html +120 -0
  3. data/html/classes/MIME/InvalidContentType.html +119 -0
  4. data/html/classes/MIME/Type.html +1173 -0
  5. data/html/classes/MIME/Types.html +566 -0
  6. data/html/classes/Net.html +108 -0
  7. data/html/classes/Net/HTTPGenericRequest.html +233 -0
  8. data/html/classes/Net/HTTPResponse.html +242 -0
  9. data/html/classes/S33r.html +743 -0
  10. data/html/classes/S33r/BucketListing.html +372 -0
  11. data/html/classes/S33r/Client.html +981 -0
  12. data/html/classes/S33r/NamedBucket.html +620 -0
  13. data/html/classes/S33r/S33rException.html +118 -0
  14. data/html/classes/S33r/S33rException/BucketListingMaxKeysError.html +111 -0
  15. data/html/classes/S33r/S33rException/InvalidBucketListing.html +111 -0
  16. data/html/classes/S33r/S33rException/MalformedBucketName.html +111 -0
  17. data/html/classes/S33r/S33rException/MethodNotAvailable.html +111 -0
  18. data/html/classes/S33r/S33rException/MissingRequiredHeaders.html +111 -0
  19. data/html/classes/S33r/S33rException/MissingResource.html +111 -0
  20. data/html/classes/S33r/S33rException/UnsupportedCannedACL.html +111 -0
  21. data/html/classes/S33r/S33rException/UnsupportedHTTPMethod.html +111 -0
  22. data/html/classes/S33r/S3Object.html +307 -0
  23. data/html/classes/S33r/S3User.html +171 -0
  24. data/html/classes/S33r/Sync.html +151 -0
  25. data/html/classes/XML.html +200 -0
  26. data/html/classes/XML/Document.html +125 -0
  27. data/html/classes/XML/Node.html +124 -0
  28. data/html/created.rid +1 -0
  29. data/html/files/CHANGELOG.html +101 -0
  30. data/html/files/MIT-LICENSE.html +129 -0
  31. data/html/files/README_txt.html +209 -0
  32. data/html/files/lib/s33r/bucket_listing_rb.html +116 -0
  33. data/html/files/lib/s33r/client_rb.html +110 -0
  34. data/html/files/lib/s33r/core_rb.html +113 -0
  35. data/html/files/lib/s33r/libxml_extensions_rb.html +107 -0
  36. data/html/files/lib/s33r/mimetypes_rb.html +120 -0
  37. data/html/files/lib/s33r/named_bucket_rb.html +101 -0
  38. data/html/files/lib/s33r/s33r_exception_rb.html +101 -0
  39. data/html/files/lib/s33r/s33r_http_rb.html +108 -0
  40. data/html/files/lib/s33r/sync_rb.html +101 -0
  41. data/html/files/lib/s33r_rb.html +101 -0
  42. data/html/fr_class_index.html +52 -0
  43. data/html/fr_file_index.html +39 -0
  44. data/html/fr_method_index.html +126 -0
  45. data/html/index.html +24 -0
  46. data/html/rdoc-style.css +208 -0
  47. data/lib/s33r/bucket_listing.rb +69 -60
  48. data/lib/s33r/client.rb +150 -73
  49. data/lib/s33r/core.rb +56 -44
  50. data/lib/s33r/libxml_extensions.rb +10 -5
  51. data/lib/s33r/mimetypes.rb +3 -2
  52. data/lib/s33r/named_bucket.rb +89 -24
  53. data/lib/s33r/{s3_exception.rb → s33r_exception.rb} +2 -2
  54. data/lib/s33r/{net_http_overrides.rb → s33r_http.rb} +29 -21
  55. data/lib/s33r/sync.rb +4 -2
  56. data/test/cases/spec_bucket_listing.rb +10 -13
  57. data/test/cases/spec_client.rb +65 -0
  58. data/test/cases/spec_core.rb +16 -11
  59. data/test/cases/spec_namedbucket.rb +32 -0
  60. data/test/cases/spec_sync.rb +6 -5
  61. data/test/cases/spec_xml.rb +1 -1
  62. data/test/files/client_config.yml +6 -0
  63. data/test/files/namedbucket_config.yml +12 -0
  64. data/test/{s3_test_constants.rb → test_setup.rb} +7 -6
  65. metadata +63 -11
  66. data/LICENSE.txt +0 -22
  67. data/MIT-LICENSE +0 -21
  68. data/README.txt +0 -19
  69. data/bin/config.yml +0 -5
  70. data/test/cases/unit_client.rb +0 -40
  71. data/test/cases/unit_named_bucket.rb +0 -12
@@ -0,0 +1,620 @@
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: S33r::NamedBucket</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">S33r::NamedBucket</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/s33r/named_bucket_rb.html">
59
+ lib/s33r/named_bucket.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="Client.html">
69
+ Client
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
+ Wraps the <a href="Client.html">S33r::Client</a> class to make it more
86
+ convenient for use with a single bucket.
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="#M000063">[]</a>&nbsp;&nbsp;
99
+ <a href="#M000071">delete</a>&nbsp;&nbsp;
100
+ <a href="#M000072">delete_key</a>&nbsp;&nbsp;
101
+ <a href="#M000066">each_item</a>&nbsp;&nbsp;
102
+ <a href="#M000067">exists?</a>&nbsp;&nbsp;
103
+ <a href="#M000059">init</a>&nbsp;&nbsp;
104
+ <a href="#M000065">keys</a>&nbsp;&nbsp;
105
+ <a href="#M000064">listing</a>&nbsp;&nbsp;
106
+ <a href="#M000060">new</a>&nbsp;&nbsp;
107
+ <a href="#M000061">public_contents?</a>&nbsp;&nbsp;
108
+ <a href="#M000069">put_file</a>&nbsp;&nbsp;
109
+ <a href="#M000070">put_stream</a>&nbsp;&nbsp;
110
+ <a href="#M000068">put_text</a>&nbsp;&nbsp;
111
+ <a href="#M000073">s3_authenticated_url</a>&nbsp;&nbsp;
112
+ <a href="#M000062">strict?</a>&nbsp;&nbsp;
113
+ </div>
114
+ </div>
115
+
116
+ </div>
117
+
118
+
119
+ <!-- if includes -->
120
+
121
+ <div id="section">
122
+
123
+
124
+
125
+
126
+
127
+ <div id="attribute-list">
128
+ <h3 class="section-bar">Attributes</h3>
129
+
130
+ <div class="name-list">
131
+ <table>
132
+ <tr class="top-aligned-row context-row">
133
+ <td class="context-item-name">bucket_name</td>
134
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
135
+ <td class="context-item-desc"></td>
136
+ </tr>
137
+ <tr class="top-aligned-row context-row">
138
+ <td class="context-item-name">dump_requests</td>
139
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
140
+ <td class="context-item-desc"></td>
141
+ </tr>
142
+ <tr class="top-aligned-row context-row">
143
+ <td class="context-item-name">public_contents</td>
144
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
145
+ <td class="context-item-desc"></td>
146
+ </tr>
147
+ <tr class="top-aligned-row context-row">
148
+ <td class="context-item-name">strict</td>
149
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
150
+ <td class="context-item-desc"></td>
151
+ </tr>
152
+ </table>
153
+ </div>
154
+ </div>
155
+
156
+
157
+
158
+ <!-- if method_list -->
159
+ <div id="methods">
160
+ <h3 class="section-bar">Public Class methods</h3>
161
+
162
+ <div id="method-M000059" class="method-detail">
163
+ <a name="M000059"></a>
164
+
165
+ <div class="method-heading">
166
+ <a href="#M000059" class="method-signature">
167
+ <span class="method-name">init</span><span class="method-args">(config_file)</span>
168
+ </a>
169
+ </div>
170
+
171
+ <div class="method-description">
172
+ <p>
173
+ Initialize an instance from a config_file. The config. file can include a
174
+ separate <tt>options</tt> section specifying options specific to <a
175
+ href="NamedBucket.html">NamedBucket</a> instances (see the initialize
176
+ method for more details). Other options are as for <a
177
+ href="Client.html#M000080">S33r::Client.init</a>.
178
+ </p>
179
+ <p><a class="source-toggle" href="#"
180
+ onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
181
+ <div class="method-source-code" id="M000059-source">
182
+ <pre>
183
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 13</span>
184
+ 13: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">NamedBucket</span>.<span class="ruby-identifier">init</span>(<span class="ruby-identifier">config_file</span>)
185
+ 14: <span class="ruby-identifier">aws_access_key</span>, <span class="ruby-identifier">aws_secret_access_key</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">_</span> = <span class="ruby-keyword kw">super</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">load_config</span>(<span class="ruby-identifier">config_file</span>)
186
+ 15: <span class="ruby-constant">NamedBucket</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">aws_access_key</span>, <span class="ruby-identifier">aws_secret_access_key</span>, <span class="ruby-identifier">options</span>)
187
+ 16: <span class="ruby-keyword kw">end</span>
188
+ </pre>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+ <div id="method-M000060" class="method-detail">
194
+ <a name="M000060"></a>
195
+
196
+ <div class="method-heading">
197
+ <a href="#M000060" class="method-signature">
198
+ <span class="method-name">new</span><span class="method-args">(aws_access_key, aws_secret_access_key, options={}) {|self if block_given?| ...}</span>
199
+ </a>
200
+ </div>
201
+
202
+ <div class="method-description">
203
+ <p>
204
+ Initialize a <a href="NamedBucket.html">NamedBucket</a> instance.
205
+ </p>
206
+ <p>
207
+ <tt>options</tt> is a hash of options for this instance:
208
+ </p>
209
+ <ul>
210
+ <li><tt>:default_bucket =&gt; &#8216;xxxx&#8217;</tt>: name of the bucket this
211
+ client is attached to.
212
+
213
+ </li>
214
+ <li><tt>:public_contents =&gt; true</tt>: all items put into bucket are made
215
+ public (can be overridden per request).
216
+
217
+ </li>
218
+ <li><tt>:strict =&gt; true</tt>: check whether the bucket exists before
219
+ attempting to initialize; initialization # fails if the bucket does not
220
+ exist
221
+
222
+ </li>
223
+ </ul>
224
+ <p><a class="source-toggle" href="#"
225
+ onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
226
+ <div class="method-source-code" id="M000060-source">
227
+ <pre>
228
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 25</span>
229
+ 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">aws_access_key</span>, <span class="ruby-identifier">aws_secret_access_key</span>, <span class="ruby-identifier">options</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
230
+ 26: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">aws_access_key</span>, <span class="ruby-identifier">aws_secret_access_key</span>, <span class="ruby-identifier">options</span>)
231
+ 27:
232
+ 28: <span class="ruby-ivar">@bucket_name</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:default_bucket</span>]
233
+ 29:
234
+ 30: <span class="ruby-comment cmt"># holds a BucketListing instance</span>
235
+ 31: <span class="ruby-ivar">@bucket_listing</span> = <span class="ruby-keyword kw">nil</span>
236
+ 32:
237
+ 33: <span class="ruby-comment cmt"># all content should be created as public-read</span>
238
+ 34: <span class="ruby-ivar">@public_contents</span> = (<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:public_contents</span>])
239
+ 35: <span class="ruby-ivar">@client_headers</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">canned_acl_header</span>(<span class="ruby-value str">'public-read'</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@public_contents</span>
240
+ 36:
241
+ 37: <span class="ruby-ivar">@strict</span> = (<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:strict</span>])
242
+ 38: <span class="ruby-keyword kw">if</span> ((<span class="ruby-ivar">@strict</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bucket_exists?</span>(<span class="ruby-ivar">@bucket_name</span>)) <span class="ruby-operator">||</span> <span class="ruby-ivar">@bucket_name</span>.<span class="ruby-identifier">nil?</span>)
243
+ 39: <span class="ruby-identifier">raise</span> <span class="ruby-constant">S33rException</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingResource</span>, <span class="ruby-node">&quot;The specified bucket name #{@bucket_name} does not exist or is invalid&quot;</span>
244
+ 40: <span class="ruby-keyword kw">end</span>
245
+ 41:
246
+ 42: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
247
+ 43: <span class="ruby-keyword kw">end</span>
248
+ </pre>
249
+ </div>
250
+ </div>
251
+ </div>
252
+
253
+ <h3 class="section-bar">Public Instance methods</h3>
254
+
255
+ <div id="method-M000063" class="method-detail">
256
+ <a name="M000063"></a>
257
+
258
+ <div class="method-heading">
259
+ <a href="#M000063" class="method-signature">
260
+ <span class="method-name">[]</span><span class="method-args">(key)</span>
261
+ </a>
262
+ </div>
263
+
264
+ <div class="method-description">
265
+ <p>
266
+ Get a single object from a bucket as a blob.
267
+ </p>
268
+ <p><a class="source-toggle" href="#"
269
+ onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
270
+ <div class="method-source-code" id="M000063-source">
271
+ <pre>
272
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 56</span>
273
+ 56: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
274
+ 57: <span class="ruby-identifier">get_resource</span>(<span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">key</span>).<span class="ruby-identifier">body</span>
275
+ 58: <span class="ruby-keyword kw">end</span>
276
+ </pre>
277
+ </div>
278
+ </div>
279
+ </div>
280
+
281
+ <div id="method-M000071" class="method-detail">
282
+ <a name="M000071"></a>
283
+
284
+ <div class="method-heading">
285
+ <a href="#M000071" class="method-signature">
286
+ <span class="method-name">delete</span><span class="method-args">(headers={}, options={})</span>
287
+ </a>
288
+ </div>
289
+
290
+ <div class="method-description">
291
+ <p>
292
+ Delete the bucket.
293
+ </p>
294
+ <p><a class="source-toggle" href="#"
295
+ onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
296
+ <div class="method-source-code" id="M000071-source">
297
+ <pre>
298
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 98</span>
299
+ 98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">headers</span>={}, <span class="ruby-identifier">options</span>={})
300
+ 99: <span class="ruby-identifier">delete_bucket</span>(<span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">options</span>)
301
+ 100: <span class="ruby-keyword kw">end</span>
302
+ </pre>
303
+ </div>
304
+ </div>
305
+ </div>
306
+
307
+ <div id="method-M000072" class="method-detail">
308
+ <a name="M000072"></a>
309
+
310
+ <div class="method-heading">
311
+ <a href="#M000072" class="method-signature">
312
+ <span class="method-name">delete_key</span><span class="method-args">(resource_key, headers={})</span>
313
+ </a>
314
+ </div>
315
+
316
+ <div class="method-description">
317
+ <p>
318
+ Delete an object from the bucket.
319
+ </p>
320
+ <p>
321
+ Returns boolean (true = deletion worked OK).
322
+ </p>
323
+ <p><a class="source-toggle" href="#"
324
+ onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
325
+ <div class="method-source-code" id="M000072-source">
326
+ <pre>
327
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 105</span>
328
+ 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_key</span>(<span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>={})
329
+ 106: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">delete_resource</span>(<span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>)
330
+ 107: <span class="ruby-identifier">listing</span>
331
+ 108: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">ok?</span>
332
+ 109: <span class="ruby-keyword kw">end</span>
333
+ </pre>
334
+ </div>
335
+ </div>
336
+ </div>
337
+
338
+ <div id="method-M000066" class="method-detail">
339
+ <a name="M000066"></a>
340
+
341
+ <div class="method-heading">
342
+ <a href="#M000066" class="method-signature">
343
+ <span class="method-name">each_item</span><span class="method-args">() {|item| ...}</span>
344
+ </a>
345
+ </div>
346
+
347
+ <div class="method-description">
348
+ <p>
349
+ List content of the bucket, and attach each item to this bucket as it is
350
+ yielded.
351
+ </p>
352
+ <p><a class="source-toggle" href="#"
353
+ onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
354
+ <div class="method-source-code" id="M000066-source">
355
+ <pre>
356
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 72</span>
357
+ 72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_item</span>
358
+ 73: <span class="ruby-identifier">listing</span>.<span class="ruby-identifier">contents</span>.<span class="ruby-identifier">each_value</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">named_bucket</span> = <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">item</span> }
359
+ 74: <span class="ruby-keyword kw">end</span>
360
+ </pre>
361
+ </div>
362
+ </div>
363
+ </div>
364
+
365
+ <div id="method-M000067" class="method-detail">
366
+ <a name="M000067"></a>
367
+
368
+ <div class="method-heading">
369
+ <a href="#M000067" class="method-signature">
370
+ <span class="method-name">exists?</span><span class="method-args">()</span>
371
+ </a>
372
+ </div>
373
+
374
+ <div class="method-description">
375
+ <p>
376
+ Does this bucket exist? Returns true if the bucket this <a
377
+ href="NamedBucket.html">NamedBucket</a> is mapped to exists.
378
+ </p>
379
+ <p><a class="source-toggle" href="#"
380
+ onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
381
+ <div class="method-source-code" id="M000067-source">
382
+ <pre>
383
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 78</span>
384
+ 78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exists?</span>
385
+ 79: <span class="ruby-identifier">bucket_exists?</span>(<span class="ruby-ivar">@bucket_name</span>)
386
+ 80: <span class="ruby-keyword kw">end</span>
387
+ </pre>
388
+ </div>
389
+ </div>
390
+ </div>
391
+
392
+ <div id="method-M000065" class="method-detail">
393
+ <a name="M000065"></a>
394
+
395
+ <div class="method-heading">
396
+ <a href="#M000065" class="method-signature">
397
+ <span class="method-name">keys</span><span class="method-args">()</span>
398
+ </a>
399
+ </div>
400
+
401
+ <div class="method-description">
402
+ <p>
403
+ Get a pretty list of the keys in the bucket.
404
+ </p>
405
+ <p><a class="source-toggle" href="#"
406
+ onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
407
+ <div class="method-source-code" id="M000065-source">
408
+ <pre>
409
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 67</span>
410
+ 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>
411
+ 68: <span class="ruby-identifier">listing</span>.<span class="ruby-identifier">pretty</span>
412
+ 69: <span class="ruby-keyword kw">end</span>
413
+ </pre>
414
+ </div>
415
+ </div>
416
+ </div>
417
+
418
+ <div id="method-M000064" class="method-detail">
419
+ <a name="M000064"></a>
420
+
421
+ <div class="method-heading">
422
+ <a href="#M000064" class="method-signature">
423
+ <span class="method-name">listing</span><span class="method-args">()</span>
424
+ </a>
425
+ </div>
426
+
427
+ <div class="method-description">
428
+ <p>
429
+ Get a <a href="BucketListing.html">BucketListing</a> instance for the
430
+ content of this bucket.
431
+ </p>
432
+ <p><a class="source-toggle" href="#"
433
+ onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
434
+ <div class="method-source-code" id="M000064-source">
435
+ <pre>
436
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 61</span>
437
+ 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">listing</span>
438
+ 62: <span class="ruby-identifier">_</span>, <span class="ruby-ivar">@bucket_listing</span> = <span class="ruby-identifier">list_bucket</span>(<span class="ruby-ivar">@bucket_name</span>)
439
+ 63: <span class="ruby-ivar">@bucket_listing</span>
440
+ 64: <span class="ruby-keyword kw">end</span>
441
+ </pre>
442
+ </div>
443
+ </div>
444
+ </div>
445
+
446
+ <div id="method-M000061" class="method-detail">
447
+ <a name="M000061"></a>
448
+
449
+ <div class="method-heading">
450
+ <a href="#M000061" class="method-signature">
451
+ <span class="method-name">public_contents?</span><span class="method-args">()</span>
452
+ </a>
453
+ </div>
454
+
455
+ <div class="method-description">
456
+ <p>
457
+ Are all objects added to this bucket made public by default?
458
+ </p>
459
+ <p><a class="source-toggle" href="#"
460
+ onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
461
+ <div class="method-source-code" id="M000061-source">
462
+ <pre>
463
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 46</span>
464
+ 46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">public_contents?</span>
465
+ 47: <span class="ruby-ivar">@public_contents</span>
466
+ 48: <span class="ruby-keyword kw">end</span>
467
+ </pre>
468
+ </div>
469
+ </div>
470
+ </div>
471
+
472
+ <div id="method-M000069" class="method-detail">
473
+ <a name="M000069"></a>
474
+
475
+ <div class="method-heading">
476
+ <a href="#M000069" class="method-signature">
477
+ <span class="method-name">put_file</span><span class="method-args">(filename, resource_key=nil, headers={}, options={})</span>
478
+ </a>
479
+ </div>
480
+
481
+ <div class="method-description">
482
+ <p>
483
+ Put a file into the bucket.
484
+ </p>
485
+ <p><a class="source-toggle" href="#"
486
+ onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
487
+ <div class="method-source-code" id="M000069-source">
488
+ <pre>
489
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 88</span>
490
+ 88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_file</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-identifier">resource_key</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span>={}, <span class="ruby-identifier">options</span>={})
491
+ 89: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">options</span>)
492
+ 90: <span class="ruby-keyword kw">end</span>
493
+ </pre>
494
+ </div>
495
+ </div>
496
+ </div>
497
+
498
+ <div id="method-M000070" class="method-detail">
499
+ <a name="M000070"></a>
500
+
501
+ <div class="method-heading">
502
+ <a href="#M000070" class="method-signature">
503
+ <span class="method-name">put_stream</span><span class="method-args">(data, resource_key, headers={})</span>
504
+ </a>
505
+ </div>
506
+
507
+ <div class="method-description">
508
+ <p>
509
+ Put a generic resource (e.g. from a data stream) into the bucket.
510
+ </p>
511
+ <p><a class="source-toggle" href="#"
512
+ onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
513
+ <div class="method-source-code" id="M000070-source">
514
+ <pre>
515
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 93</span>
516
+ 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_stream</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>={})
517
+ 94: <span class="ruby-identifier">put_resource</span>(<span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
518
+ 95: <span class="ruby-keyword kw">end</span>
519
+ </pre>
520
+ </div>
521
+ </div>
522
+ </div>
523
+
524
+ <div id="method-M000068" class="method-detail">
525
+ <a name="M000068"></a>
526
+
527
+ <div class="method-heading">
528
+ <a href="#M000068" class="method-signature">
529
+ <span class="method-name">put_text</span><span class="method-args">(string, resource_key, headers={})</span>
530
+ </a>
531
+ </div>
532
+
533
+ <div class="method-description">
534
+ <p>
535
+ Put a string into a key inside the bucket.
536
+ </p>
537
+ <p><a class="source-toggle" href="#"
538
+ onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
539
+ <div class="method-source-code" id="M000068-source">
540
+ <pre>
541
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 83</span>
542
+ 83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_text</span>(<span class="ruby-identifier">string</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>={})
543
+ 84: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">string</span>, <span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>)
544
+ 85: <span class="ruby-keyword kw">end</span>
545
+ </pre>
546
+ </div>
547
+ </div>
548
+ </div>
549
+
550
+ <div id="method-M000073" class="method-detail">
551
+ <a name="M000073"></a>
552
+
553
+ <div class="method-heading">
554
+ <a href="#M000073" class="method-signature">
555
+ <span class="method-name">s3_authenticated_url</span><span class="method-args">(resource_key, expires=(Time.now.to_i + DEFAULT_EXPIRY_SECS))</span>
556
+ </a>
557
+ </div>
558
+
559
+ <div class="method-description">
560
+ <p>
561
+ Generate an authenticated URL (see <a
562
+ href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01">docs.amazonwebservices.com/AmazonS3/2006-03-01</a>/)
563
+ for an object inside this bucket.
564
+ </p>
565
+ <p>
566
+ <tt>expires</tt>: time in secs since the epoch when the link should become
567
+ invalid.
568
+ </p>
569
+ <p><a class="source-toggle" href="#"
570
+ onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
571
+ <div class="method-source-code" id="M000073-source">
572
+ <pre>
573
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 115</span>
574
+ 115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">s3_authenticated_url</span>(<span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">expires</span>=(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-constant">DEFAULT_EXPIRY_SECS</span>))
575
+ 116: <span class="ruby-keyword kw">super</span>(<span class="ruby-ivar">@aws_access_key</span>, <span class="ruby-ivar">@aws_secret_access_key</span>, <span class="ruby-ivar">@bucket_name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">expires</span>)
576
+ 117: <span class="ruby-keyword kw">end</span>
577
+ </pre>
578
+ </div>
579
+ </div>
580
+ </div>
581
+
582
+ <div id="method-M000062" class="method-detail">
583
+ <a name="M000062"></a>
584
+
585
+ <div class="method-heading">
586
+ <a href="#M000062" class="method-signature">
587
+ <span class="method-name">strict?</span><span class="method-args">()</span>
588
+ </a>
589
+ </div>
590
+
591
+ <div class="method-description">
592
+ <p>
593
+ Is this a strict bucket (i.e. the target bucket must exist on S3)?
594
+ </p>
595
+ <p><a class="source-toggle" href="#"
596
+ onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
597
+ <div class="method-source-code" id="M000062-source">
598
+ <pre>
599
+ <span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 51</span>
600
+ 51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strict?</span>
601
+ 52: <span class="ruby-ivar">@strict</span>
602
+ 53: <span class="ruby-keyword kw">end</span>
603
+ </pre>
604
+ </div>
605
+ </div>
606
+ </div>
607
+
608
+
609
+ </div>
610
+
611
+
612
+ </div>
613
+
614
+
615
+ <div id="validator-badges">
616
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
617
+ </div>
618
+
619
+ </body>
620
+ </html>