s33r 0.4.1 → 0.4.2
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/examples/cli/simple.rb +17 -0
- data/examples/fores33r/app/controllers/browser_controller.rb +32 -8
- data/examples/fores33r/app/views/browser/_create_bucket.rhtml +6 -0
- data/examples/fores33r/app/views/browser/_upload.rhtml +5 -0
- data/examples/fores33r/app/views/browser/index.rhtml +1 -8
- data/examples/fores33r/app/views/browser/plain_bucket.rhtml +3 -0
- data/examples/fores33r/app/views/browser/s3_index.rhtml +9 -0
- data/examples/fores33r/app/views/browser/show_bucket.rhtml +6 -8
- data/examples/fores33r/app/views/layouts/application.rhtml +2 -0
- data/examples/fores33r/app/views/layouts/s3_layout.rhtml +14 -0
- data/examples/fores33r/config/environment.rb +1 -1
- data/examples/fores33r/config/routes.rb +2 -0
- data/examples/fores33r/public/stylesheets/core.css +2 -2
- data/html/classes/Net/HTTPResponse.html +3 -0
- data/html/classes/S33r.html +127 -116
- data/html/classes/S33r/BucketListing.html +119 -94
- data/html/classes/S33r/Client.html +602 -536
- data/html/classes/S33r/LoggingResource.html +3 -3
- data/html/classes/S33r/NamedBucket.html +235 -191
- data/html/classes/S33r/OrderlyXmlMarkup.html +7 -7
- data/html/classes/S33r/S33rException.html +1 -0
- data/html/classes/S33r/S33rException/TryingToPutEmptyResource.html +117 -0
- data/html/classes/S33r/S3ACL/ACLDoc.html +94 -94
- data/html/classes/S33r/S3ACL/AmazonCustomer.html +5 -5
- data/html/classes/S33r/S3ACL/CanonicalUser.html +12 -12
- data/html/classes/S33r/S3ACL/Grant.html +64 -64
- data/html/classes/S33r/S3ACL/Grantee.html +36 -36
- data/html/classes/S33r/S3ACL/Group.html +8 -8
- data/html/classes/S33r/S3Object.html +387 -79
- data/html/classes/XML.html +15 -15
- data/html/created.rid +1 -1
- data/html/files/CHANGELOG.html +7 -1
- data/html/files/MIT-LICENSE.html +1 -1
- data/html/files/README_txt.html +3 -7
- data/html/files/lib/s33r/bucket_listing_rb.html +1 -9
- data/html/files/lib/s33r/builder_rb.html +1 -1
- data/html/files/lib/s33r/client_rb.html +1 -1
- data/html/files/lib/s33r/core_rb.html +1 -2
- data/html/files/lib/s33r/libxml_extensions_rb.html +1 -7
- data/html/files/lib/s33r/libxml_loader_rb.html +109 -0
- data/html/files/lib/s33r/logging_rb.html +1 -2
- data/html/files/lib/s33r/mimetypes_rb.html +1 -1
- data/html/files/lib/s33r/named_bucket_rb.html +1 -1
- data/html/files/lib/s33r/s33r_exception_rb.html +1 -1
- data/html/files/lib/s33r/s33r_http_rb.html +1 -1
- data/html/files/lib/s33r/s3_acl_rb.html +1 -2
- data/html/files/lib/s33r/s3_obj_rb.html +108 -0
- data/html/files/lib/s33r/sync_rb.html +1 -1
- data/html/files/lib/s33r_rb.html +1 -1
- data/html/fr_class_index.html +1 -0
- data/html/fr_file_index.html +2 -0
- data/html/fr_method_index.html +80 -71
- data/lib/s33r/bucket_listing.rb +30 -55
- data/lib/s33r/client.rb +70 -28
- data/lib/s33r/core.rb +9 -4
- data/lib/s33r/libxml_extensions.rb +2 -0
- data/lib/s33r/libxml_loader.rb +6 -0
- data/lib/s33r/logging.rb +3 -3
- data/lib/s33r/named_bucket.rb +33 -15
- data/lib/s33r/s33r_exception.rb +4 -0
- data/lib/s33r/s33r_http.rb +1 -1
- data/lib/s33r/s3_acl.rb +3 -2
- data/lib/s33r/s3_obj.rb +186 -0
- data/test/cases/spec_bucket_listing.rb +9 -33
- data/test/cases/spec_s3_object.rb +35 -0
- data/test/files/suspect_bucket_listing.xml +19 -0
- metadata +94 -89
- data/examples/fores33r/log/development.log +0 -5960
- data/examples/fores33r/log/production.log +0 -0
- data/examples/fores33r/log/server.log +0 -0
- data/examples/fores33r/log/test.log +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.2ea325f604aa5fb9 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.39d37e054d21d545 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.acf71fc73aa74983 +0 -0
- data/examples/fores33r/tmp/sessions/ruby_sess.c1697b7d6670f3cd +0 -0
@@ -84,9 +84,9 @@ For manipulating logging directives on resources (see <a
|
|
84
84
|
href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/LoggingHowTo.html">docs.amazonwebservices.com/AmazonS3/2006-03-01/LoggingHowTo.html</a>).
|
85
85
|
</p>
|
86
86
|
<p>
|
87
|
-
|
88
|
-
arguments
|
89
|
-
logging
|
87
|
+
Creating a <a href="LoggingResource.html">LoggingResource</a> instance
|
88
|
+
using new and no arguments will generate a "blank" instance; this
|
89
|
+
can be put to the ?logging URL for a resource to remove logging from it.
|
90
90
|
</p>
|
91
91
|
|
92
92
|
</div>
|
@@ -95,22 +95,23 @@ convenient for use with a single bucket.
|
|
95
95
|
<h3 class="section-bar">Methods</h3>
|
96
96
|
|
97
97
|
<div class="name-list">
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
98
|
+
<a href="#M000102">[]</a>
|
99
|
+
<a href="#M000113">delete</a>
|
100
|
+
<a href="#M000106">destroy</a>
|
101
|
+
<a href="#M000108">each_object</a>
|
102
|
+
<a href="#M000105">exists?</a>
|
103
|
+
<a href="#M000103">get_raw</a>
|
104
|
+
<a href="#M000098">init</a>
|
105
|
+
<a href="#M000109">key_exists?</a>
|
106
|
+
<a href="#M000107">keys</a>
|
107
|
+
<a href="#M000104">listing</a>
|
108
|
+
<a href="#M000099">new</a>
|
109
|
+
<a href="#M000100">public_contents?</a>
|
110
|
+
<a href="#M000111">put_file</a>
|
111
|
+
<a href="#M000112">put_stream</a>
|
112
|
+
<a href="#M000110">put_text</a>
|
113
|
+
<a href="#M000114">s3_authenticated_url</a>
|
114
|
+
<a href="#M000101">strict?</a>
|
114
115
|
</div>
|
115
116
|
</div>
|
116
117
|
|
@@ -160,11 +161,11 @@ convenient for use with a single bucket.
|
|
160
161
|
<div id="methods">
|
161
162
|
<h3 class="section-bar">Public Class methods</h3>
|
162
163
|
|
163
|
-
<div id="method-
|
164
|
-
<a name="
|
164
|
+
<div id="method-M000098" class="method-detail">
|
165
|
+
<a name="M000098"></a>
|
165
166
|
|
166
167
|
<div class="method-heading">
|
167
|
-
<a href="#
|
168
|
+
<a href="#M000098" class="method-signature">
|
168
169
|
<span class="method-name">init</span><span class="method-args">(config_file)</span>
|
169
170
|
</a>
|
170
171
|
</div>
|
@@ -175,27 +176,27 @@ Initialize an instance from a config_file. The config. file can include a
|
|
175
176
|
separate <tt>options</tt> section specifying options specific to <a
|
176
177
|
href="NamedBucket.html">NamedBucket</a> instances (see the initialize
|
177
178
|
method for more details). Other options are as for <a
|
178
|
-
href="Client.html#
|
179
|
+
href="Client.html#M000117">S33r::Client.init</a>.
|
179
180
|
</p>
|
180
181
|
<p><a class="source-toggle" href="#"
|
181
|
-
onclick="toggleCode('
|
182
|
-
<div class="method-source-code" id="
|
182
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
183
|
+
<div class="method-source-code" id="M000098-source">
|
183
184
|
<pre>
|
184
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
185
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 17</span>
|
186
|
+
17: <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>)
|
187
|
+
18: <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-keyword kw">super</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">load_config</span>(<span class="ruby-identifier">config_file</span>)
|
188
|
+
19: <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>)
|
189
|
+
20: <span class="ruby-keyword kw">end</span>
|
189
190
|
</pre>
|
190
191
|
</div>
|
191
192
|
</div>
|
192
193
|
</div>
|
193
194
|
|
194
|
-
<div id="method-
|
195
|
-
<a name="
|
195
|
+
<div id="method-M000099" class="method-detail">
|
196
|
+
<a name="M000099"></a>
|
196
197
|
|
197
198
|
<div class="method-heading">
|
198
|
-
<a href="#
|
199
|
+
<a href="#M000099" class="method-signature">
|
199
200
|
<span class="method-name">new</span><span class="method-args">(aws_access_key, aws_secret_access_key, options={}) {|self if block_given?| ...}</span>
|
200
201
|
</a>
|
201
202
|
</div>
|
@@ -223,33 +224,30 @@ exist
|
|
223
224
|
</li>
|
224
225
|
</ul>
|
225
226
|
<p><a class="source-toggle" href="#"
|
226
|
-
onclick="toggleCode('
|
227
|
-
<div class="method-source-code" id="
|
227
|
+
onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
|
228
|
+
<div class="method-source-code" id="M000099-source">
|
228
229
|
<pre>
|
229
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
47:
|
251
|
-
48: <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>
|
252
|
-
49: <span class="ruby-keyword kw">end</span>
|
230
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 29</span>
|
231
|
+
29: <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">&</span><span class="ruby-identifier">block</span>)
|
232
|
+
30: <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>)
|
233
|
+
31:
|
234
|
+
32: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:default_bucket</span>]
|
235
|
+
33: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@name</span>.<span class="ruby-identifier">nil?</span>
|
236
|
+
34: <span class="ruby-identifier">raise</span> <span class="ruby-constant">S33rException</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingBucketName</span>, <span class="ruby-value str">"NamedBucket cannot be initialised without specifying\
|
237
|
+
35: a :default_bucket option"</span>
|
238
|
+
36: <span class="ruby-keyword kw">end</span>
|
239
|
+
37:
|
240
|
+
38: <span class="ruby-comment cmt"># all content inside the bucket should be created as public-read</span>
|
241
|
+
39: <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>])
|
242
|
+
40: <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>
|
243
|
+
41:
|
244
|
+
42: <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>])
|
245
|
+
43: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@strict</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bucket_exists?</span>(<span class="ruby-ivar">@name</span>)
|
246
|
+
44: <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">"Non-existent bucket #{@bucket_name} specified"</span>
|
247
|
+
45: <span class="ruby-keyword kw">end</span>
|
248
|
+
46:
|
249
|
+
47: <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>
|
250
|
+
48: <span class="ruby-keyword kw">end</span>
|
253
251
|
</pre>
|
254
252
|
</div>
|
255
253
|
</div>
|
@@ -257,38 +255,54 @@ exist
|
|
257
255
|
|
258
256
|
<h3 class="section-bar">Public Instance methods</h3>
|
259
257
|
|
260
|
-
<div id="method-
|
261
|
-
<a name="
|
258
|
+
<div id="method-M000102" class="method-detail">
|
259
|
+
<a name="M000102"></a>
|
262
260
|
|
263
261
|
<div class="method-heading">
|
264
|
-
<a href="#
|
265
|
-
<span class="method-name">[]</span><span class="method-args">(key)</span>
|
262
|
+
<a href="#M000102" class="method-signature">
|
263
|
+
<span class="method-name">[]</span><span class="method-args">(key, eager=false)</span>
|
266
264
|
</a>
|
267
265
|
</div>
|
268
266
|
|
269
267
|
<div class="method-description">
|
270
268
|
<p>
|
271
|
-
Get a single object from a bucket as a
|
269
|
+
Get a single object from a bucket as an <a
|
270
|
+
href="S3Object.html">S3Object</a>.
|
271
|
+
</p>
|
272
|
+
<p>
|
273
|
+
To get a bare object (with no content):
|
274
|
+
</p>
|
275
|
+
<pre>
|
276
|
+
bucket['key']
|
277
|
+
</pre>
|
278
|
+
<p>
|
279
|
+
To get the object and load its content:
|
272
280
|
</p>
|
281
|
+
<pre>
|
282
|
+
bucket['key', :load]
|
283
|
+
</pre>
|
273
284
|
<p><a class="source-toggle" href="#"
|
274
|
-
onclick="toggleCode('
|
275
|
-
<div class="method-source-code" id="
|
285
|
+
onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
|
286
|
+
<div class="method-source-code" id="M000102-source">
|
276
287
|
<pre>
|
277
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
278
|
-
|
279
|
-
|
280
|
-
|
288
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 69</span>
|
289
|
+
69: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">eager</span>=<span class="ruby-keyword kw">false</span>)
|
290
|
+
70: <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">listing</span>.<span class="ruby-identifier">contents</span>[<span class="ruby-identifier">key</span>]
|
291
|
+
71: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">named_bucket</span> = <span class="ruby-keyword kw">self</span>
|
292
|
+
72: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">load</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">:load</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">eager</span>
|
293
|
+
73: <span class="ruby-identifier">obj</span>
|
294
|
+
74: <span class="ruby-keyword kw">end</span>
|
281
295
|
</pre>
|
282
296
|
</div>
|
283
297
|
</div>
|
284
298
|
</div>
|
285
299
|
|
286
|
-
<div id="method-
|
287
|
-
<a name="
|
300
|
+
<div id="method-M000113" class="method-detail">
|
301
|
+
<a name="M000113"></a>
|
288
302
|
|
289
303
|
<div class="method-heading">
|
290
|
-
<a href="#
|
291
|
-
<span class="method-name">
|
304
|
+
<a href="#M000113" class="method-signature">
|
305
|
+
<span class="method-name">delete</span><span class="method-args">(key, headers={})</span>
|
292
306
|
</a>
|
293
307
|
</div>
|
294
308
|
|
@@ -297,27 +311,26 @@ Get a single object from a bucket as a blob.
|
|
297
311
|
Delete an object from the bucket. NB S3 doesn’t discriminate between
|
298
312
|
successfully deleting a key and trying to delete a non-existent key (both
|
299
313
|
return a 204). If you want to test for existence first, use <a
|
300
|
-
href="NamedBucket.html#
|
314
|
+
href="NamedBucket.html#M000109">key_exists?</a>.
|
301
315
|
</p>
|
302
316
|
<p><a class="source-toggle" href="#"
|
303
|
-
onclick="toggleCode('
|
304
|
-
<div class="method-source-code" id="
|
317
|
+
onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
|
318
|
+
<div class="method-source-code" id="M000113-source">
|
305
319
|
<pre>
|
306
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
120: <span class="ruby-keyword kw">end</span>
|
320
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 136</span>
|
321
|
+
136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">headers</span>={})
|
322
|
+
137: <span class="ruby-identifier">delete_resource</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">headers</span>)
|
323
|
+
138: <span class="ruby-keyword kw">end</span>
|
311
324
|
</pre>
|
312
325
|
</div>
|
313
326
|
</div>
|
314
327
|
</div>
|
315
328
|
|
316
|
-
<div id="method-
|
317
|
-
<a name="
|
329
|
+
<div id="method-M000106" class="method-detail">
|
330
|
+
<a name="M000106"></a>
|
318
331
|
|
319
332
|
<div class="method-heading">
|
320
|
-
<a href="#
|
333
|
+
<a href="#M000106" class="method-signature">
|
321
334
|
<span class="method-name">destroy</span><span class="method-args">(headers={}, options={})</span>
|
322
335
|
</a>
|
323
336
|
</div>
|
@@ -327,50 +340,53 @@ href="NamedBucket.html#M000101">key_exists?</a>.
|
|
327
340
|
Delete the bucket.
|
328
341
|
</p>
|
329
342
|
<p><a class="source-toggle" href="#"
|
330
|
-
onclick="toggleCode('
|
331
|
-
<div class="method-source-code" id="
|
343
|
+
onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
|
344
|
+
<div class="method-source-code" id="M000106-source">
|
332
345
|
<pre>
|
333
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
334
|
-
|
335
|
-
|
336
|
-
|
346
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 94</span>
|
347
|
+
94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span>(<span class="ruby-identifier">headers</span>={}, <span class="ruby-identifier">options</span>={})
|
348
|
+
95: <span class="ruby-identifier">delete_bucket</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">options</span>)
|
349
|
+
96: <span class="ruby-keyword kw">end</span>
|
337
350
|
</pre>
|
338
351
|
</div>
|
339
352
|
</div>
|
340
353
|
</div>
|
341
354
|
|
342
|
-
<div id="method-
|
343
|
-
<a name="
|
355
|
+
<div id="method-M000108" class="method-detail">
|
356
|
+
<a name="M000108"></a>
|
344
357
|
|
345
358
|
<div class="method-heading">
|
346
|
-
<a href="#
|
347
|
-
<span class="method-name">
|
359
|
+
<a href="#M000108" class="method-signature">
|
360
|
+
<span class="method-name">each_object</span><span class="method-args">() {|obj| ...}</span>
|
348
361
|
</a>
|
349
362
|
</div>
|
350
363
|
|
351
364
|
<div class="method-description">
|
352
365
|
<p>
|
353
|
-
List content of the bucket, and attach each item to this
|
354
|
-
yielded
|
366
|
+
List content of the bucket, and attach each item to this <a
|
367
|
+
href="NamedBucket.html">NamedBucket</a> instance as it is yielded (to
|
368
|
+
enable easier manipulation directly from the <a
|
369
|
+
href="S3Object.html">S3Object</a>). Note that the objects are incomplete,
|
370
|
+
as the data associated with them has not been "got" from S3 yet.
|
355
371
|
</p>
|
356
372
|
<p><a class="source-toggle" href="#"
|
357
|
-
onclick="toggleCode('
|
358
|
-
<div class="method-source-code" id="
|
373
|
+
onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
|
374
|
+
<div class="method-source-code" id="M000108-source">
|
359
375
|
<pre>
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
376
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 107</span>
|
377
|
+
107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_object</span>
|
378
|
+
108: <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">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</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">obj</span> }
|
379
|
+
109: <span class="ruby-keyword kw">end</span>
|
364
380
|
</pre>
|
365
381
|
</div>
|
366
382
|
</div>
|
367
383
|
</div>
|
368
384
|
|
369
|
-
<div id="method-
|
370
|
-
<a name="
|
385
|
+
<div id="method-M000105" class="method-detail">
|
386
|
+
<a name="M000105"></a>
|
371
387
|
|
372
388
|
<div class="method-heading">
|
373
|
-
<a href="#
|
389
|
+
<a href="#M000105" class="method-signature">
|
374
390
|
<span class="method-name">exists?</span><span class="method-args">()</span>
|
375
391
|
</a>
|
376
392
|
</div>
|
@@ -381,23 +397,49 @@ Does this bucket exist? Returns true if the bucket this <a
|
|
381
397
|
href="NamedBucket.html">NamedBucket</a> is mapped to exists.
|
382
398
|
</p>
|
383
399
|
<p><a class="source-toggle" href="#"
|
384
|
-
onclick="toggleCode('
|
385
|
-
<div class="method-source-code" id="
|
400
|
+
onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
|
401
|
+
<div class="method-source-code" id="M000105-source">
|
386
402
|
<pre>
|
387
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
388
|
-
|
389
|
-
|
390
|
-
|
403
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 89</span>
|
404
|
+
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exists?</span>
|
405
|
+
90: <span class="ruby-identifier">bucket_exists?</span>(<span class="ruby-ivar">@name</span>)
|
406
|
+
91: <span class="ruby-keyword kw">end</span>
|
391
407
|
</pre>
|
392
408
|
</div>
|
393
409
|
</div>
|
394
410
|
</div>
|
395
411
|
|
396
|
-
<div id="method-
|
397
|
-
<a name="
|
412
|
+
<div id="method-M000103" class="method-detail">
|
413
|
+
<a name="M000103"></a>
|
398
414
|
|
399
415
|
<div class="method-heading">
|
400
|
-
<a href="#
|
416
|
+
<a href="#M000103" class="method-signature">
|
417
|
+
<span class="method-name">get_raw</span><span class="method-args">(key, headers={})</span>
|
418
|
+
</a>
|
419
|
+
</div>
|
420
|
+
|
421
|
+
<div class="method-description">
|
422
|
+
<p>
|
423
|
+
Get a raw response for a key inside the bucket.
|
424
|
+
</p>
|
425
|
+
<p><a class="source-toggle" href="#"
|
426
|
+
onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
|
427
|
+
<div class="method-source-code" id="M000103-source">
|
428
|
+
<pre>
|
429
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 77</span>
|
430
|
+
77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_raw</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">headers</span>={})
|
431
|
+
78: <span class="ruby-identifier">get_resource</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">headers</span>)
|
432
|
+
79: <span class="ruby-keyword kw">end</span>
|
433
|
+
</pre>
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
<div id="method-M000109" class="method-detail">
|
439
|
+
<a name="M000109"></a>
|
440
|
+
|
441
|
+
<div class="method-heading">
|
442
|
+
<a href="#M000109" class="method-signature">
|
401
443
|
<span class="method-name">key_exists?</span><span class="method-args">(key)</span>
|
402
444
|
</a>
|
403
445
|
</div>
|
@@ -407,23 +449,23 @@ href="NamedBucket.html">NamedBucket</a> is mapped to exists.
|
|
407
449
|
Does the given key exist in the bucket? Returns boolean
|
408
450
|
</p>
|
409
451
|
<p><a class="source-toggle" href="#"
|
410
|
-
onclick="toggleCode('
|
411
|
-
<div class="method-source-code" id="
|
452
|
+
onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
|
453
|
+
<div class="method-source-code" id="M000109-source">
|
412
454
|
<pre>
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
455
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 113</span>
|
456
|
+
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_exists?</span>(<span class="ruby-identifier">key</span>)
|
457
|
+
114: <span class="ruby-identifier">resource_exists?</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">key</span>)
|
458
|
+
115: <span class="ruby-keyword kw">end</span>
|
417
459
|
</pre>
|
418
460
|
</div>
|
419
461
|
</div>
|
420
462
|
</div>
|
421
463
|
|
422
|
-
<div id="method-
|
423
|
-
<a name="
|
464
|
+
<div id="method-M000107" class="method-detail">
|
465
|
+
<a name="M000107"></a>
|
424
466
|
|
425
467
|
<div class="method-heading">
|
426
|
-
<a href="#
|
468
|
+
<a href="#M000107" class="method-signature">
|
427
469
|
<span class="method-name">keys</span><span class="method-args">()</span>
|
428
470
|
</a>
|
429
471
|
</div>
|
@@ -433,23 +475,23 @@ Does the given key exist in the bucket? Returns boolean
|
|
433
475
|
Get a pretty list of the keys in the bucket.
|
434
476
|
</p>
|
435
477
|
<p><a class="source-toggle" href="#"
|
436
|
-
onclick="toggleCode('
|
437
|
-
<div class="method-source-code" id="
|
478
|
+
onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
|
479
|
+
<div class="method-source-code" id="M000107-source">
|
438
480
|
<pre>
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
481
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 99</span>
|
482
|
+
99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>
|
483
|
+
100: <span class="ruby-identifier">listing</span>.<span class="ruby-identifier">pretty</span>
|
484
|
+
101: <span class="ruby-keyword kw">end</span>
|
443
485
|
</pre>
|
444
486
|
</div>
|
445
487
|
</div>
|
446
488
|
</div>
|
447
489
|
|
448
|
-
<div id="method-
|
449
|
-
<a name="
|
490
|
+
<div id="method-M000104" class="method-detail">
|
491
|
+
<a name="M000104"></a>
|
450
492
|
|
451
493
|
<div class="method-heading">
|
452
|
-
<a href="#
|
494
|
+
<a href="#M000104" class="method-signature">
|
453
495
|
<span class="method-name">listing</span><span class="method-args">()</span>
|
454
496
|
</a>
|
455
497
|
</div>
|
@@ -457,26 +499,28 @@ Get a pretty list of the keys in the bucket.
|
|
457
499
|
<div class="method-description">
|
458
500
|
<p>
|
459
501
|
Get a <a href="BucketListing.html">BucketListing</a> instance for the
|
460
|
-
content of this bucket.
|
502
|
+
content of this bucket. Uses the <a
|
503
|
+
href="Client.html#M000123">Client.list_bucket</a> method to get the
|
504
|
+
listing.
|
461
505
|
</p>
|
462
506
|
<p><a class="source-toggle" href="#"
|
463
|
-
onclick="toggleCode('
|
464
|
-
<div class="method-source-code" id="
|
507
|
+
onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
|
508
|
+
<div class="method-source-code" id="M000104-source">
|
465
509
|
<pre>
|
466
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
467
|
-
|
468
|
-
|
469
|
-
|
510
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 83</span>
|
511
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">listing</span>
|
512
|
+
84: <span class="ruby-identifier">list_bucket</span>(<span class="ruby-ivar">@name</span>)[<span class="ruby-value">1</span>]
|
513
|
+
85: <span class="ruby-keyword kw">end</span>
|
470
514
|
</pre>
|
471
515
|
</div>
|
472
516
|
</div>
|
473
517
|
</div>
|
474
518
|
|
475
|
-
<div id="method-
|
476
|
-
<a name="
|
519
|
+
<div id="method-M000100" class="method-detail">
|
520
|
+
<a name="M000100"></a>
|
477
521
|
|
478
522
|
<div class="method-heading">
|
479
|
-
<a href="#
|
523
|
+
<a href="#M000100" class="method-signature">
|
480
524
|
<span class="method-name">public_contents?</span><span class="method-args">()</span>
|
481
525
|
</a>
|
482
526
|
</div>
|
@@ -486,23 +530,23 @@ content of this bucket.
|
|
486
530
|
Are all objects added to this bucket made public by default?
|
487
531
|
</p>
|
488
532
|
<p><a class="source-toggle" href="#"
|
489
|
-
onclick="toggleCode('
|
490
|
-
<div class="method-source-code" id="
|
533
|
+
onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
|
534
|
+
<div class="method-source-code" id="M000100-source">
|
491
535
|
<pre>
|
492
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
493
|
-
|
494
|
-
|
495
|
-
|
536
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 51</span>
|
537
|
+
51: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">public_contents?</span>
|
538
|
+
52: <span class="ruby-ivar">@public_contents</span>
|
539
|
+
53: <span class="ruby-keyword kw">end</span>
|
496
540
|
</pre>
|
497
541
|
</div>
|
498
542
|
</div>
|
499
543
|
</div>
|
500
544
|
|
501
|
-
<div id="method-
|
502
|
-
<a name="
|
545
|
+
<div id="method-M000111" class="method-detail">
|
546
|
+
<a name="M000111"></a>
|
503
547
|
|
504
548
|
<div class="method-heading">
|
505
|
-
<a href="#
|
549
|
+
<a href="#M000111" class="method-signature">
|
506
550
|
<span class="method-name">put_file</span><span class="method-args">(filename, resource_key=nil, headers={}, options={})</span>
|
507
551
|
</a>
|
508
552
|
</div>
|
@@ -512,23 +556,23 @@ Are all objects added to this bucket made public by default?
|
|
512
556
|
Put a file into the bucket.
|
513
557
|
</p>
|
514
558
|
<p><a class="source-toggle" href="#"
|
515
|
-
onclick="toggleCode('
|
516
|
-
<div class="method-source-code" id="
|
559
|
+
onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
|
560
|
+
<div class="method-source-code" id="M000111-source">
|
517
561
|
<pre>
|
518
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
519
|
-
|
520
|
-
|
521
|
-
|
562
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 123</span>
|
563
|
+
123: <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>={})
|
564
|
+
124: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">options</span>)
|
565
|
+
125: <span class="ruby-keyword kw">end</span>
|
522
566
|
</pre>
|
523
567
|
</div>
|
524
568
|
</div>
|
525
569
|
</div>
|
526
570
|
|
527
|
-
<div id="method-
|
528
|
-
<a name="
|
571
|
+
<div id="method-M000112" class="method-detail">
|
572
|
+
<a name="M000112"></a>
|
529
573
|
|
530
574
|
<div class="method-heading">
|
531
|
-
<a href="#
|
575
|
+
<a href="#M000112" class="method-signature">
|
532
576
|
<span class="method-name">put_stream</span><span class="method-args">(data, resource_key, headers={})</span>
|
533
577
|
</a>
|
534
578
|
</div>
|
@@ -538,23 +582,23 @@ Put a file into the bucket.
|
|
538
582
|
Put a generic stream (e.g. from a file handle) into the bucket.
|
539
583
|
</p>
|
540
584
|
<p><a class="source-toggle" href="#"
|
541
|
-
onclick="toggleCode('
|
542
|
-
<div class="method-source-code" id="
|
585
|
+
onclick="toggleCode('M000112-source');return false;">[Source]</a></p>
|
586
|
+
<div class="method-source-code" id="M000112-source">
|
543
587
|
<pre>
|
544
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
545
|
-
|
546
|
-
|
547
|
-
|
588
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 128</span>
|
589
|
+
128: <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>={})
|
590
|
+
129: <span class="ruby-identifier">put_resource</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">headers</span>)
|
591
|
+
130: <span class="ruby-keyword kw">end</span>
|
548
592
|
</pre>
|
549
593
|
</div>
|
550
594
|
</div>
|
551
595
|
</div>
|
552
596
|
|
553
|
-
<div id="method-
|
554
|
-
<a name="
|
597
|
+
<div id="method-M000110" class="method-detail">
|
598
|
+
<a name="M000110"></a>
|
555
599
|
|
556
600
|
<div class="method-heading">
|
557
|
-
<a href="#
|
601
|
+
<a href="#M000110" class="method-signature">
|
558
602
|
<span class="method-name">put_text</span><span class="method-args">(string, resource_key, headers={})</span>
|
559
603
|
</a>
|
560
604
|
</div>
|
@@ -564,23 +608,23 @@ Put a generic stream (e.g. from a file handle) into the bucket.
|
|
564
608
|
Put a string into a key inside the bucket.
|
565
609
|
</p>
|
566
610
|
<p><a class="source-toggle" href="#"
|
567
|
-
onclick="toggleCode('
|
568
|
-
<div class="method-source-code" id="
|
611
|
+
onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
|
612
|
+
<div class="method-source-code" id="M000110-source">
|
569
613
|
<pre>
|
570
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
571
|
-
|
572
|
-
|
573
|
-
|
614
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 118</span>
|
615
|
+
118: <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>={})
|
616
|
+
119: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">string</span>, <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">headers</span>)
|
617
|
+
120: <span class="ruby-keyword kw">end</span>
|
574
618
|
</pre>
|
575
619
|
</div>
|
576
620
|
</div>
|
577
621
|
</div>
|
578
622
|
|
579
|
-
<div id="method-
|
580
|
-
<a name="
|
623
|
+
<div id="method-M000114" class="method-detail">
|
624
|
+
<a name="M000114"></a>
|
581
625
|
|
582
626
|
<div class="method-heading">
|
583
|
-
<a href="#
|
627
|
+
<a href="#M000114" class="method-signature">
|
584
628
|
<span class="method-name">s3_authenticated_url</span><span class="method-args">(resource_key, expires=(Time.now.to_i + DEFAULT_EXPIRY_SECS))</span>
|
585
629
|
</a>
|
586
630
|
</div>
|
@@ -596,23 +640,23 @@ for an object inside this bucket.
|
|
596
640
|
invalid.
|
597
641
|
</p>
|
598
642
|
<p><a class="source-toggle" href="#"
|
599
|
-
onclick="toggleCode('
|
600
|
-
<div class="method-source-code" id="
|
643
|
+
onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
|
644
|
+
<div class="method-source-code" id="M000114-source">
|
601
645
|
<pre>
|
602
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
603
|
-
|
604
|
-
|
605
|
-
|
646
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 144</span>
|
647
|
+
144: <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>))
|
648
|
+
145: <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">@name</span>, <span class="ruby-identifier">resource_key</span>, <span class="ruby-identifier">expires</span>)
|
649
|
+
146: <span class="ruby-keyword kw">end</span>
|
606
650
|
</pre>
|
607
651
|
</div>
|
608
652
|
</div>
|
609
653
|
</div>
|
610
654
|
|
611
|
-
<div id="method-
|
612
|
-
<a name="
|
655
|
+
<div id="method-M000101" class="method-detail">
|
656
|
+
<a name="M000101"></a>
|
613
657
|
|
614
658
|
<div class="method-heading">
|
615
|
-
<a href="#
|
659
|
+
<a href="#M000101" class="method-signature">
|
616
660
|
<span class="method-name">strict?</span><span class="method-args">()</span>
|
617
661
|
</a>
|
618
662
|
</div>
|
@@ -622,13 +666,13 @@ invalid.
|
|
622
666
|
Is this a strict bucket (i.e. the target bucket must exist on S3)?
|
623
667
|
</p>
|
624
668
|
<p><a class="source-toggle" href="#"
|
625
|
-
onclick="toggleCode('
|
626
|
-
<div class="method-source-code" id="
|
669
|
+
onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
|
670
|
+
<div class="method-source-code" id="M000101-source">
|
627
671
|
<pre>
|
628
|
-
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line
|
629
|
-
|
630
|
-
|
631
|
-
|
672
|
+
<span class="ruby-comment cmt"># File lib/s33r/named_bucket.rb, line 56</span>
|
673
|
+
56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">strict?</span>
|
674
|
+
57: <span class="ruby-ivar">@strict</span>
|
675
|
+
58: <span class="ruby-keyword kw">end</span>
|
632
676
|
</pre>
|
633
677
|
</div>
|
634
678
|
</div>
|