s3 0.3.20 → 0.3.21
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/s3/bucket.rb +12 -8
- data/lib/s3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fb4a11b96fe119fc5b67dd54f1e9418f682c1c4
|
4
|
+
data.tar.gz: 24eda3309ae8f62742c696e396e45a5ae40ab3c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a36e844ad009eb1602acc425f644beb2b16837f432ee94cfd2b03cbcc717126308817343651b47a3066b7984ed4ab4543391d205c8a79fd6d5020b4383c260a
|
7
|
+
data.tar.gz: 4fa122a14e36b4f40d2848c0e32e1140f5e2997f790036d8fcd44ab047b965de354fe83b83eadf3a2c7fd1e382b4ec91ef4be023d24d154e1f8a7626717642b6
|
data/Gemfile.lock
CHANGED
data/lib/s3/bucket.rb
CHANGED
@@ -109,8 +109,12 @@ module S3
|
|
109
109
|
end
|
110
110
|
|
111
111
|
# Returns the objects in the bucket and caches the result
|
112
|
-
|
113
|
-
|
112
|
+
#
|
113
|
+
# ==== Parameters
|
114
|
+
# * <tt>params</tt> - additional params for <tt>list_bucket</tt>
|
115
|
+
# request.
|
116
|
+
def objects(params = {})
|
117
|
+
Proxy.new(lambda { list_bucket(params) }, :owner => self, :extend => ObjectsExtension)
|
114
118
|
end
|
115
119
|
|
116
120
|
# Returns the object with the given key. Does not check whether the
|
@@ -129,7 +133,7 @@ module S3
|
|
129
133
|
headers[:content_length] = 0
|
130
134
|
headers[:x_amz_acl] = options[:acl] || acl || "public-read"
|
131
135
|
|
132
|
-
|
136
|
+
bucket_request(:put, :headers => headers, :path => name)
|
133
137
|
end
|
134
138
|
|
135
139
|
private
|
@@ -141,9 +145,9 @@ module S3
|
|
141
145
|
parse_location_constraint(response.body)
|
142
146
|
end
|
143
147
|
|
144
|
-
def list_bucket(
|
145
|
-
response = bucket_request(:get, :params =>
|
146
|
-
max_keys =
|
148
|
+
def list_bucket(params = {})
|
149
|
+
response = bucket_request(:get, :params => params)
|
150
|
+
max_keys = params[:max_keys]
|
147
151
|
objects_attributes = parse_list_bucket_result(response.body)
|
148
152
|
|
149
153
|
# If there are more than 1000 objects S3 truncates listing and
|
@@ -156,7 +160,7 @@ module S3
|
|
156
160
|
next_request_options[:max_keys] = max_keys - objects_attributes.length
|
157
161
|
end
|
158
162
|
|
159
|
-
response = bucket_request(:get, :params =>
|
163
|
+
response = bucket_request(:get, :params => params.merge(next_request_options))
|
160
164
|
objects_attributes += parse_list_bucket_result(response.body)
|
161
165
|
end
|
162
166
|
|
@@ -164,7 +168,7 @@ module S3
|
|
164
168
|
end
|
165
169
|
|
166
170
|
def bucket_headers(options = {})
|
167
|
-
|
171
|
+
bucket_request(:head, :params => options)
|
168
172
|
rescue Error::ResponseError => e
|
169
173
|
case e.response.code.to_i
|
170
174
|
when 404
|
data/lib/s3/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuba Kuźma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: proxies
|