s3 0.3.20 → 0.3.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c5d5f7082f9caa8479147358b5585e9d0f04b6e
4
- data.tar.gz: 2aeccffd7eff52ec62871b72c856c9d1fa0e6544
3
+ metadata.gz: 3fb4a11b96fe119fc5b67dd54f1e9418f682c1c4
4
+ data.tar.gz: 24eda3309ae8f62742c696e396e45a5ae40ab3c2
5
5
  SHA512:
6
- metadata.gz: 13a7def06ef1d1f73f74d30dba3908ea5de28a1cf41a76cd20b4040c6f55ae152a1223f58ea3958581656b098986a0add1f04ef98d84d7f9a5bd6f7553ef30d8
7
- data.tar.gz: 4f3b37d58d9dd5c05cfc0db1928cee278333e10224341e88a9978b36f2db66670ddfd67c4aa4066a23073f310743139a712b526fa222725de7987df6c3cfe103
6
+ metadata.gz: 0a36e844ad009eb1602acc425f644beb2b16837f432ee94cfd2b03cbcc717126308817343651b47a3066b7984ed4ab4543391d205c8a79fd6d5020b4383c260a
7
+ data.tar.gz: 4fa122a14e36b4f40d2848c0e32e1140f5e2997f790036d8fcd44ab047b965de354fe83b83eadf3a2c7fd1e382b4ec91ef4be023d24d154e1f8a7626717642b6
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- s3 (0.3.20)
4
+ s3 (0.3.21)
5
5
  proxies (~> 0.2.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- metaclass (0.0.2)
10
+ metaclass (0.0.4)
11
11
  mocha (1.0.0)
12
12
  metaclass (~> 0.0.1)
13
13
  proxies (0.2.1)
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
- def objects(options={})
113
- Proxy.new(lambda { list_bucket(options) }, :owner => self, :extend => ObjectsExtension)
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
- response = bucket_request(:put, :headers => headers, :path => name)
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(options = {})
145
- response = bucket_request(:get, :params => options)
146
- max_keys = options[: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 => options.merge(next_request_options))
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
- response = bucket_request(:head, :params => options)
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
@@ -1,3 +1,3 @@
1
1
  module S3
2
- VERSION = "0.3.20"
2
+ VERSION = "0.3.21"
3
3
  end
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.20
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-01-28 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: proxies