aws-sdk-resources 2.0.41 → 2.0.42

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1dfdb4bceab421c875e0c974245dc680feeb830e
4
- data.tar.gz: 865f2db04f7dfa8fc3493379319ac99a715ffc2a
3
+ metadata.gz: 2a880bded141118198a6ee6645a59e19e748ecfc
4
+ data.tar.gz: 845e45de69d9b2870ef07a469096c895bb95216f
5
5
  SHA512:
6
- metadata.gz: 51e3f3c05ae2fca55fa72b4ff9ab2411a8f14876a06f2160fdeffd8640c522406fafdae0b6269e9abc42edf978a8057083c7637a1d6adf99f5bc4d6c4675adc8
7
- data.tar.gz: 418f0c2b6026926c54e7f2a9e675fa780fbbf24c791183dd1a587df328b4e63937426424bbfeb5cf287b4d8f2b9db2e8671d85243b5575eb842aa31d0698219d
6
+ metadata.gz: cdf8fbdd8adcb5fd0a8e883b16f117e880c1a1117b3a8957a4e51b7b7a979488a0d70f73e9c578820c8555793dec6539e9ca9ce1d0f52d79a127b83f9f41ee6f
7
+ data.tar.gz: 285af3f02301c43b83431d5f70740f96e7dbd14ca8167b4168dac6228e083be603f9f8cdb20f7b624284ada4308c7ba9c7744612b095ad9a2c89e4d26a613c10
@@ -159,7 +159,9 @@ module Aws
159
159
  # * `:key_provider`
160
160
  # * `:encryption_key`
161
161
  #
162
- # @option opitons [S3::Client] :client A basic S3 client that is used
162
+ # You may also pass any other options accepted by {S3::Client.new}.
163
+ #
164
+ # @option options [S3::Client] :client A basic S3 client that is used
163
165
  # to make api calls. If a `:client` is not provided, a new {S3::Client}
164
166
  # will be constructed.
165
167
  #
@@ -180,7 +182,7 @@ module Aws
180
182
  # instruction file uses the object key with this suffix appended.
181
183
  #
182
184
  def initialize(options = {})
183
- @client = options[:client] || S3::Client.new
185
+ @client = extract_client(options)
184
186
  @key_provider = extract_key_provider(options)
185
187
  @envelope_location = extract_location(options)
186
188
  @instruction_file_suffix = extract_suffix(options)
@@ -230,7 +232,7 @@ module Aws
230
232
  # @return (see S3::Client#get_object)
231
233
  # @see S3::Client#get_object
232
234
  # @note The `:range` request parameter is not yet supported.
233
- def get_object(params = {})
235
+ def get_object(params = {}, &block)
234
236
  if params[:range]
235
237
  raise NotImplementedError, '#get_object with :range not supported yet'
236
238
  end
@@ -242,11 +244,22 @@ module Aws
242
244
  envelope_location: envelope_location,
243
245
  instruction_file_suffix: instruction_file_suffix,
244
246
  }
245
- req.send_request
247
+ req.send_request(target: block)
246
248
  end
247
249
 
248
250
  private
249
251
 
252
+ def extract_client(options)
253
+ options[:client] || begin
254
+ options = options.dup
255
+ options.delete(:key_provider)
256
+ options.delete(:encryption_key)
257
+ options.delete(:envelope_location)
258
+ options.delete(:instruction_file_suffix)
259
+ S3::Client.new(options)
260
+ end
261
+ end
262
+
250
263
  def envelope_options(params)
251
264
  location = params.delete(:envelope_location) || @envelope_location
252
265
  suffix = params.delete(:instruction_file_suffix)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.41
4
+ version: 2.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-27 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.41
19
+ version: 2.0.42
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.41
26
+ version: 2.0.42
27
27
  description: Provides resource oriented interfaces and other higher-level abstractions
28
28
  for many AWS services. This gem is part of the official AWS SDK for Ruby.
29
29
  email:
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.4.5
107
+ rubygems_version: 2.4.6
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: AWS SDK for Ruby - Resources