aws-sdk-resources 2.0.19.pre → 2.0.20.pre

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: 5343b4a72639e9a6d1d439dff2489d670ed307ce
4
- data.tar.gz: 281a1fc5f17f129f329b080b55cc77e47b259aee
3
+ metadata.gz: 74611ee6c47bd6e6d50be251f12fe89cc0efd3fa
4
+ data.tar.gz: 75b5f0a20ac2a13e89ccf28eb89611c67253c921
5
5
  SHA512:
6
- metadata.gz: 21c4ebe7c7715ef34a2c2d6dec31e3c8a8a4cc64afa3168d9e21147fcf9020156988426d56f625b45d37bc3f39fb06ab61ccc7378301ff3a0df24a6585d347c2
7
- data.tar.gz: 20bc14e715abf9320f02115e4c63e4dbb6339dc5921b6f3c1a98d67d51c26846284a5b78b3290eeba12a0b7ff7ce248f94fb89f4e68cd2dc5c83d7f4c808ea0f
6
+ metadata.gz: 13b72864f2aae0d746e892d16575b7d36a7810db21dc9e4007be603a88319b03ffc4d7feb74a0ba292ec941d5517438d811ec0eddeda02b7b4aa84eb8d77fe9c
7
+ data.tar.gz: a5e9f37666fcb63d913f4ede66d10f487e6c089b383cf25ed8ef90dd319ca060704b0a4b014fb041e1743a08e0e0fb7fc8750d0d0d0560d136b5dcdc9f3cda07
@@ -10,7 +10,6 @@ module Aws
10
10
  def initialize(operation, options)
11
11
  @operation = operation
12
12
  @options = options
13
- reject_limit_param(options)
14
13
  end
15
14
 
16
15
  # @return [Enumerator<Resource>]
@@ -22,6 +21,7 @@ module Aws
22
21
  end
23
22
  end
24
23
 
24
+ # @api private
25
25
  # @return [Enumerator<Batch>]
26
26
  def batches(&block)
27
27
  @operation.batches(@options)
@@ -40,28 +40,6 @@ module Aws
40
40
  self.class.new(@operation, @options.merge(limit: limit))
41
41
  end
42
42
 
43
- # Specifies max size of each batch. Some services may return fewer
44
- # than `size` number of items per request.
45
- #
46
- # @example Enumerate the collection in batches with a max size
47
- #
48
- # collection.batch_size(10).batches.each do |batch|
49
- # # batch has at most 10 items
50
- # end
51
- #
52
- # @param [Integer] size
53
- # @return [Collection]
54
- def batch_size(size)
55
- if limit_key
56
- self.class.new(@operation, @options.merge(batch_size: size))
57
- else
58
- resource = resource_class.name
59
- method_name = @operation.request.method_name
60
- msg = "batch size not supported by #{resource}##{method_name}"
61
- raise NotImplementedError, msg
62
- end
63
- end
64
-
65
43
  # Returns the first resource from the collection.
66
44
  #
67
45
  # resource = collection.first
@@ -107,7 +85,6 @@ module Aws
107
85
  parts = {}
108
86
  parts[:type] = resource_class.name
109
87
  parts[:limit] = @options[:limit]
110
- parts[:batch_size] = @options[:batch_size] if limit_key
111
88
  parts[:params] = @options[:params] || {}
112
89
  parts = parts.inject("") {|s,(k,v)| s << " #{k}=#{v.inspect}" }
113
90
  ['#<', self.class.name, parts, '>'].join
@@ -120,14 +97,6 @@ module Aws
120
97
  @operation.limit_key
121
98
  end
122
99
 
123
- def reject_limit_param(options)
124
- if options[:params] && options[:params][limit_key]
125
- msg = "invalid option :#{limit_key}, call #limit or #batch_size "
126
- msg << "on the returned Aws::Resources::Collection instead"
127
- raise ArgumentError, msg
128
- end
129
- end
130
-
131
100
  def resource_class
132
101
  @operation.builder.resource_class
133
102
  end
@@ -124,7 +124,6 @@ module Aws
124
124
  private
125
125
 
126
126
  def all_batches(options, &block)
127
- options = apply_batch_size(options)
128
127
  @request.call(options).each do |response|
129
128
  yield(@builder.build(options.merge(response:response)))
130
129
  end
@@ -143,15 +142,6 @@ module Aws
143
142
  end
144
143
  end
145
144
 
146
- def apply_batch_size(options)
147
- if batch_size = options[:batch_size]
148
- params = (options[:params] || {}).merge(limit_key => batch_size)
149
- options.merge(params: params)
150
- else
151
- options
152
- end
153
- end
154
-
155
145
  end
156
146
 
157
147
  class HasOperation < Base
@@ -3,6 +3,7 @@ module Aws
3
3
 
4
4
  require 'aws-sdk-resources/services/s3/bucket'
5
5
  require 'aws-sdk-resources/services/s3/object'
6
+ require 'aws-sdk-resources/services/s3/object_summary'
6
7
  require 'aws-sdk-resources/services/s3/multipart_upload'
7
8
  require 'aws-sdk-resources/services/s3/public_url'
8
9
 
@@ -2,6 +2,8 @@ module Aws
2
2
  module S3
3
3
  class Object
4
4
 
5
+ alias size content_length
6
+
5
7
  # Generates a pre-signed URL for this object.
6
8
  #
7
9
  # @example Pre-signed GET URL, valid for one hour
@@ -0,0 +1,17 @@
1
+ module Aws
2
+ module S3
3
+ class ObjectSummary
4
+
5
+ alias content_length size
6
+
7
+ # @param (see Object#upload_file)
8
+ # @options (see Object#upload_file)
9
+ # @return (see Object#upload_file)
10
+ # @see Object#upload_file
11
+ def upload_file(source, options = {})
12
+ object.upload_file(source, options)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
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.19.pre
4
+ version: 2.0.20.pre
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-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-20 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.19
19
+ version: 2.0.20
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.19
26
+ version: 2.0.20
27
27
  description: Provides resource-oriented abstractions for AWS.
28
28
  email:
29
29
  executables: []
@@ -74,6 +74,7 @@ files:
74
74
  - lib/aws-sdk-resources/services/s3/multipart_upload.rb
75
75
  - lib/aws-sdk-resources/services/s3/multipart_upload_error.rb
76
76
  - lib/aws-sdk-resources/services/s3/object.rb
77
+ - lib/aws-sdk-resources/services/s3/object_summary.rb
77
78
  - lib/aws-sdk-resources/services/s3/public_url.rb
78
79
  - lib/aws-sdk-resources/services/sqs.rb
79
80
  - lib/aws-sdk-resources/services/sqs/queue.rb