aws 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/s3/bucket.rb +18 -6
- metadata +2 -2
data/lib/s3/bucket.rb
CHANGED
@@ -33,9 +33,9 @@ module Aws
|
|
33
33
|
# not be called directly.
|
34
34
|
# Use Aws::S3::Bucket.create or Aws::S3.bucket instead.
|
35
35
|
def initialize(s3, name, creation_date=nil, owner=nil)
|
36
|
-
@s3
|
37
|
-
@name
|
38
|
-
@owner
|
36
|
+
@s3 = s3
|
37
|
+
@name = name
|
38
|
+
@owner = owner
|
39
39
|
@creation_date = creation_date
|
40
40
|
if @creation_date && !@creation_date.is_a?(Time)
|
41
41
|
@creation_date = Time.parse(@creation_date)
|
@@ -120,12 +120,12 @@ module Aws
|
|
120
120
|
opt = {}; options.each { |key, value| opt[key.to_s] = value }
|
121
121
|
service_data = {}
|
122
122
|
service_list = {}
|
123
|
-
list
|
123
|
+
list = []
|
124
124
|
@s3.interface.incrementally_list_bucket(@name, opt) do |thislist|
|
125
125
|
service_list = thislist
|
126
126
|
thislist[:contents].each do |entry|
|
127
127
|
owner = S3::Owner.new(entry[:owner_id], entry[:owner_display_name])
|
128
|
-
key
|
128
|
+
key = S3::Key.new(self, entry[:key], nil, {}, {}, entry[:last_modified], entry[:e_tag], entry[:size], entry[:storage_class], owner)
|
129
129
|
key.head if head
|
130
130
|
list << key
|
131
131
|
end
|
@@ -176,12 +176,24 @@ module Aws
|
|
176
176
|
|
177
177
|
# Retrieve object data from Amazon.
|
178
178
|
# The +key+ is a +String+ or Key.
|
179
|
+
# Returns data.
|
180
|
+
#
|
181
|
+
# data = bucket.get('logs/today/1.log') #=>
|
182
|
+
# puts data #=> 'sasfasfasdf'
|
183
|
+
#
|
184
|
+
def get(key, headers={})
|
185
|
+
key = S3::Key.create(self, key.to_s) unless key.is_a?(S3::Key)
|
186
|
+
key.get(headers)
|
187
|
+
end
|
188
|
+
|
189
|
+
# Retrieve object data from Amazon.
|
190
|
+
# The +key+ is a +String+ or Key.
|
179
191
|
# Returns Key instance.
|
180
192
|
#
|
181
193
|
# key = bucket.get('logs/today/1.log') #=>
|
182
194
|
# puts key.data #=> 'sasfasfasdf'
|
183
195
|
#
|
184
|
-
def
|
196
|
+
def get_key(key, headers={})
|
185
197
|
key = S3::Key.create(self, key.to_s, headers) unless key.is_a?(S3::Key)
|
186
198
|
return key
|
187
199
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.5.
|
5
|
+
version: 2.5.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Travis Reeder
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-05-
|
15
|
+
date: 2011-05-18 00:00:00 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: uuidtools
|