aws-sdk-resources 2.1.19 → 2.1.20

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: 3046b375470447b9fc609cadc93ae5bea512f862
4
- data.tar.gz: cd56ef5457ec4d301047a140205f9705dc9ebfbe
3
+ metadata.gz: 97c22ba987e7bf8003909c68607298bfd16f42d3
4
+ data.tar.gz: 7d33e93aea99351da13cd9fa82ccfcf1668ed44e
5
5
  SHA512:
6
- metadata.gz: 1c17ba74fa50090c52ea291c10b61f6e1eecea5d1371809635ad5f09ad6b412e5c9ef4caeee7532d275ab78501ad4f373f13455395ce8659cbd7263e158d8488
7
- data.tar.gz: f2b1a4b479cc4c39cb560ea6b274718db649ebee69582b181908986e6797377f0b75c4d93b6467a13181d2b6e7bf2d2988539bcd6de926fda7bed27133a3ee1d
6
+ metadata.gz: 03de55daffd4123b8c163171700299af464a4d0fdd8d0da6587dadaa2b59ef9c5ad95e188ea300fdde6e130f52de6e6f041c798f5bf5762548056c2c82661b33
7
+ data.tar.gz: 157918fb9ab7b17edd847b20c2101543ddec0cf70aa992c86adaf80f95d4eb725e4e6c4ff6ec6235e9ded817f40bac5b85735d07ba9d7273c72f512839a7f10f
@@ -4,6 +4,100 @@ module Aws
4
4
 
5
5
  alias size content_length
6
6
 
7
+ # @param [S3::Object, String, Hash] source Where to copy object
8
+ # data from. `source` must be one of the following:
9
+ #
10
+ # * {Aws::S3::Object}
11
+ # * Hash - with `:bucket` and `:key`
12
+ # * String - formatted like `"source-bucket-name/source-key"`
13
+ #
14
+ # @option options [Boolean] :multipart_copy (false) When `true`,
15
+ # the object will be copied using the multipart APIs. This is
16
+ # necessary for objects larger than 5GB and can provide
17
+ # performance improvements on large objects. Amazon S3 does
18
+ # not accept multipart copies for objects smaller than 5MB.
19
+ #
20
+ # @see #copy_to
21
+ #
22
+ def copy_from(source, options = {})
23
+ if Hash === source && source[:copy_source]
24
+ # for backwards compatibility
25
+ @client.copy_object(source.merge(bucket: bucket_name, key: key))
26
+ else
27
+ ObjectCopier.new(self, options).copy_from(source, options)
28
+ end
29
+ end
30
+
31
+ # Copies this object to another object. Use `multipart_copy: true`
32
+ # for large objects. This is required for objects that exceed 5GB.
33
+ #
34
+ # @note If you need to copy to a bucket in a different region, use
35
+ # #{copy_from}.
36
+ #
37
+ # @param [S3::Object, String, Hash] target Where to copy the object
38
+ # data to. `target` must be one of the following:
39
+ #
40
+ # * {Aws::S3::Object}
41
+ # * Hash - with `:bucket` and `:key`
42
+ # * String - formatted like `"target-bucket-name/target-key"`
43
+ #
44
+ # @example Basic object copy
45
+ #
46
+ # bucket = Aws::S3::Bucket.new('source-bucket')
47
+ # object = bucket.object('source-key')
48
+ #
49
+ # # target as String
50
+ # object.copy_to('target-bucket/target-key')
51
+ #
52
+ # # target as Hash
53
+ # object.copy_to(bucket: 'target-bucket', key: 'target-key')
54
+ #
55
+ # # target as Aws::S3::Object
56
+ # object.copy_to(bucket.object('target-key'))
57
+ #
58
+ # @example Managed copy of large objects
59
+ #
60
+ # # uses multipart upload APIs to copy object
61
+ # object.copy_to('src-bucket/src-key', multipart_copy: true)
62
+ #
63
+ def copy_to(target, options = {})
64
+ ObjectCopier.new(self, options).copy_to(target, options)
65
+ end
66
+
67
+ # Copies and deletes the current object. The object will only be
68
+ # deleted if the copy operation succeeds.
69
+ # @param (see Object#copy_to)
70
+ # @options (see Object#copy_to)
71
+ # @return [void]
72
+ # @see Object#copy_to
73
+ # @see Object#delete
74
+ def move_to(target, options = {})
75
+ copy_to(target, options)
76
+ delete
77
+ end
78
+
79
+ # Creates a {PresignedPost} that makes it easy to upload a file from
80
+ # a web browser direct to Amazon S3 using an HTML post form with
81
+ # a file field.
82
+ #
83
+ # See the {PresignedPost} documentation for more information.
84
+ # @note The `:key` is populated by {#key}. Do not specify
85
+ # the `:key` or `:key_starts_with` options.
86
+ # @option (see PresignedPost#initialize)
87
+ # @return [PresignedPost]
88
+ # @see PresignedPost
89
+ def presigned_post(options = {})
90
+ PresignedPost.new(
91
+ client.config.credentials,
92
+ client.config.region,
93
+ bucket_name,
94
+ {
95
+ key: key,
96
+ url: bucket.url,
97
+ }.merge(options)
98
+ )
99
+ end
100
+
7
101
  # Generates a pre-signed URL for this object.
8
102
  #
9
103
  # @example Pre-signed GET URL, valid for one hour
@@ -117,81 +211,6 @@ module Aws
117
211
  true
118
212
  end
119
213
 
120
- # Creates a {PresignedPost} that makes it easy to upload a file from
121
- # a web browser direct to Amazon S3 using an HTML post form with
122
- # a file field.
123
- #
124
- # See the {PresignedPost} documentation for more information.
125
- # @note The `:key` is populated by {#key}. Do not specify
126
- # the `:key` or `:key_starts_with` options.
127
- # @option (see PresignedPost#initialize)
128
- # @return [PresignedPost]
129
- # @see PresignedPost
130
- def presigned_post(options = {})
131
- PresignedPost.new(
132
- client.config.credentials,
133
- client.config.region,
134
- bucket_name,
135
- options.merge(key: key))
136
- end
137
-
138
- # @param [S3::Object, String, Hash] source Where to copy object
139
- # data from. `source` must be one of the following:
140
- #
141
- # * {Aws::S3::Object}
142
- # * Hash - with `:bucket` and `:key`
143
- # * String - formatted like `"source-bucket-name/source-key"`
144
- #
145
- # @option options [Boolean] :multipart_copy (false) When `true`,
146
- # the object will be copied using the multipart APIs. This is
147
- # necessary for objects larger than 5GB and can provide
148
- # performance improvements on large objects. Amazon S3 does
149
- # not accept multipart copies for objects smaller than 5MB.
150
- #
151
- # @see #copy_to
152
- #
153
- def copy_from(source, options = {})
154
- if Hash === source && source[:copy_source]
155
- # for backwards compatibility
156
- @client.copy_object(source.merge(bucket: bucket_name, key: key))
157
- else
158
- ObjectCopier.new(self, options).copy_from(source, options)
159
- end
160
- end
161
-
162
- # Copies this object to another object. Use `multipart_copy: true`
163
- # for large objects. This is required for objects that exceed 5GB.
164
- #
165
- # @param [S3::Object, String, Hash] target Where to copy the object
166
- # data to. `target` must be one of the following:
167
- #
168
- # * {Aws::S3::Object}
169
- # * Hash - with `:bucket` and `:key`
170
- # * String - formatted like `"target-bucket-name/target-key"`
171
- #
172
- # @example Basic object copy
173
- #
174
- # bucket = Aws::S3::Bucket.new('source-bucket')
175
- # object = bucket.object('source-key')
176
- #
177
- # # target as String
178
- # object.copy_to('target-bucket/target-key')
179
- #
180
- # # target as Hash
181
- # object.copy_to(bucket: 'target-bucket', key: 'target-key')
182
- #
183
- # # target as Aws::S3::Object
184
- # object.copy_to(bucket.object('target-key'))
185
- #
186
- # @example Managed copy of large objects
187
- #
188
- # # uses multipart upload APIs to copy object
189
- # object.copy_to('src-bucket/src-key', multipart_copy: true)
190
- #
191
- def copy_to(target, options = {})
192
- ObjectCopier.new(self, options).copy_to(target, options)
193
- end
194
-
195
214
  end
196
215
  end
197
216
  end
@@ -4,6 +4,54 @@ module Aws
4
4
 
5
5
  alias content_length size
6
6
 
7
+ # @param (see Object#copy_from)
8
+ # @options (see Object#copy_from)
9
+ # @return (see Object#copy_from)
10
+ # @see Object#copy_from
11
+ def copy_from(source, options = {})
12
+ object.copy_from(source, options)
13
+ end
14
+
15
+ # @param (see Object#copy_to)
16
+ # @options (see Object#copy_to)
17
+ # @return (see Object#copy_to)
18
+ # @see Object#copy_to
19
+ def copy_to(target, options = {})
20
+ object.copy_to(target, options)
21
+ end
22
+
23
+ # @param (see Object#move_to)
24
+ # @options (see Object#move_to)
25
+ # @return (see Object#move_to)
26
+ # @see Object#move_to
27
+ def move_to(target, options = {})
28
+ object.move_to(target, options)
29
+ end
30
+
31
+ # @param (see Object#presigned_post)
32
+ # @options (see Object#presigned_post)
33
+ # @return (see Object#presigned_post)
34
+ # @see Object#presigned_post
35
+ def presigned_post(options = {})
36
+ object.presigned_post(options)
37
+ end
38
+
39
+ # @param (see Object#presigned_url)
40
+ # @options (see Object#presigned_url)
41
+ # @return (see Object#presigned_url)
42
+ # @see Object#presigned_url
43
+ def presigned_url(http_method, params = {})
44
+ object.presigned_url(http_method, params)
45
+ end
46
+
47
+ # @param (see Object#public_url)
48
+ # @options (see Object#public_url)
49
+ # @return (see Object#public_url)
50
+ # @see Object#public_url
51
+ def public_url(options = {})
52
+ object.public_url(options)
53
+ end
54
+
7
55
  # @param (see Object#upload_file)
8
56
  # @options (see Object#upload_file)
9
57
  # @return (see Object#upload_file)
@@ -212,7 +212,7 @@ module Aws
212
212
  @credentials = credentials.credentials
213
213
  @bucket_region = bucket_region
214
214
  @bucket_name = bucket_name
215
- @url = bucket_url
215
+ @url = options.delete(:url) || bucket_url
216
216
  @fields = {}
217
217
  @key_set = false
218
218
  @signature_expiration = Time.now + 3600
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.1.19
4
+ version: 2.1.20
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-09-03 00:00:00.000000000 Z
11
+ date: 2015-09-10 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.1.19
19
+ version: 2.1.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.1.19
26
+ version: 2.1.20
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: