aws-sdk-resources 2.1.30 → 2.1.31
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/lib/aws-sdk-resources/documenter.rb +0 -24
- data/lib/aws-sdk-resources/services/s3/bucket.rb +1 -4
- data/lib/aws-sdk-resources/services/s3/object.rb +22 -0
- data/lib/aws-sdk-resources/services/s3/object_copier.rb +20 -5
- data/lib/aws-sdk-resources/services/s3/presigned_post.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1eea8fc30ff11dca63249ab169a4c32aa7e60c7
|
4
|
+
data.tar.gz: 0f857bd86d5edfeffe6493e0e36a0b953f3a8cfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7cc8ee0360dcb205cfa051a7f4d2cecea5b742cf5b5b2421b781cd427801a62bd50cab39e8b7f50271f3981defacaf6da1cc10c5b6870383370674100495a7c
|
7
|
+
data.tar.gz: ecf6d473cb099861317c90fc9431a910d24d69b42c9fdaafabf2def5c3e8720f51c5685ff1445f331fbaaf7b47e61f04cbc44a60d242508c5dd6ed997149fe1b
|
@@ -52,36 +52,12 @@ module Aws
|
|
52
52
|
copy_from = YARD::Registry['Aws::S3::Object#copy_from']
|
53
53
|
copy_to = YARD::Registry['Aws::S3::Object#copy_to']
|
54
54
|
existing_tags = copy_from.tags
|
55
|
-
copy_from.docstring = 'Copies another object to this object. Use `multipart_copy: true` for large objects. This is required for objects that exceed 5GB.'
|
56
55
|
existing_tags.each do |tag|
|
57
56
|
if tag.tag_name == 'option' && tag.pair.name != ":copy_source"
|
58
57
|
copy_from.add_tag(tag)
|
59
58
|
copy_to.add_tag(tag)
|
60
59
|
end
|
61
60
|
end
|
62
|
-
copy_from.add_tag(tag(<<-EXAMPLE))
|
63
|
-
@example Basic object copy
|
64
|
-
|
65
|
-
bucket = Aws::S3::Bucket.new('target-bucket')
|
66
|
-
object = bucket.object('target-key')
|
67
|
-
|
68
|
-
# source as String
|
69
|
-
object.copy_from('source-bucket/source-key')
|
70
|
-
|
71
|
-
# source as Hash
|
72
|
-
object.copy_from(bucket:'source-bucket', key:'source-key')
|
73
|
-
|
74
|
-
# source as Aws::S3::Object
|
75
|
-
object.copy_from(bucket.object('source-key'))
|
76
|
-
EXAMPLE
|
77
|
-
|
78
|
-
copy_from.add_tag(tag(<<-EXAMPLE))
|
79
|
-
@example Managed copy of large objects
|
80
|
-
|
81
|
-
# uses multipart upload APIs to copy object
|
82
|
-
object.copy_from('src-bucket/src-key', multipart_copy: true)
|
83
|
-
EXAMPLE
|
84
|
-
|
85
61
|
end
|
86
62
|
|
87
63
|
def tag(string)
|
@@ -87,7 +87,7 @@ module Aws
|
|
87
87
|
url.host = "#{name}.#{url.host}"
|
88
88
|
else
|
89
89
|
url.path += '/' unless url.path[-1] == '/'
|
90
|
-
url.path +=
|
90
|
+
url.path += Seahorse::Util.uri_escape(name)
|
91
91
|
end
|
92
92
|
url.to_s
|
93
93
|
end
|
@@ -97,9 +97,6 @@ module Aws
|
|
97
97
|
!client.config.force_path_style
|
98
98
|
end
|
99
99
|
|
100
|
-
def path_escape(name)
|
101
|
-
name.gsub(/[^\/]+/) {|part| Seahorse::Util.uri_escape(part) }
|
102
|
-
end
|
103
100
|
end
|
104
101
|
end
|
105
102
|
end
|
@@ -4,6 +4,9 @@ module Aws
|
|
4
4
|
|
5
5
|
alias size content_length
|
6
6
|
|
7
|
+
# Copies another object to this object. Use `multipart_copy: true`
|
8
|
+
# for large objects. This is required for objects that exceed 5GB.'
|
9
|
+
#
|
7
10
|
# @param [S3::Object, String, Hash] source Where to copy object
|
8
11
|
# data from. `source` must be one of the following:
|
9
12
|
#
|
@@ -17,6 +20,25 @@ module Aws
|
|
17
20
|
# performance improvements on large objects. Amazon S3 does
|
18
21
|
# not accept multipart copies for objects smaller than 5MB.
|
19
22
|
#
|
23
|
+
# @example Basic object copy
|
24
|
+
#
|
25
|
+
# bucket = Aws::S3::Bucket.new('target-bucket')
|
26
|
+
# object = bucket.object('target-key')
|
27
|
+
#
|
28
|
+
# # source as String
|
29
|
+
# object.copy_from('source-bucket/source-key')
|
30
|
+
#
|
31
|
+
# # source as Hash
|
32
|
+
# object.copy_from(bucket:'source-bucket', key:'source-key')
|
33
|
+
#
|
34
|
+
# # source as Aws::S3::Object
|
35
|
+
# object.copy_from(bucket.object('source-key'))
|
36
|
+
#
|
37
|
+
# @example Managed copy of large objects
|
38
|
+
#
|
39
|
+
# # uses multipart upload APIs to copy object
|
40
|
+
# object.copy_from('src-bucket/src-key', multipart_copy: true)
|
41
|
+
#
|
20
42
|
# @see #copy_to
|
21
43
|
#
|
22
44
|
def copy_from(source, options = {})
|
@@ -12,12 +12,12 @@ module Aws
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def copy_from(source, options = {})
|
15
|
-
copy_object(source, @object, options)
|
15
|
+
copy_object(source, @object, merge_options(source, options))
|
16
16
|
end
|
17
17
|
|
18
18
|
|
19
19
|
def copy_to(target, options = {})
|
20
|
-
copy_object(@object, target, options)
|
20
|
+
copy_object(@object, target, merge_options(target, options))
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -36,9 +36,9 @@ module Aws
|
|
36
36
|
|
37
37
|
def copy_source(source)
|
38
38
|
case source
|
39
|
-
when String then source
|
40
|
-
when Hash then "#{source[:bucket]}/#{source[:key]}"
|
41
|
-
when S3::Object then "#{source.bucket_name}/#{source.key}"
|
39
|
+
when String then escape(source)
|
40
|
+
when Hash then "#{source[:bucket]}/#{escape(source[:key])}"
|
41
|
+
when S3::Object then "#{source.bucket_name}/#{escape(source.key)}"
|
42
42
|
else
|
43
43
|
msg = "expected source to be an Aws::S3::Object, Hash, or String"
|
44
44
|
raise ArgumentError, msg
|
@@ -56,6 +56,21 @@ module Aws
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
def merge_options(source_or_target, options)
|
60
|
+
if Hash === source_or_target
|
61
|
+
source_or_target.inject(options.dup) do |opts, (key, value)|
|
62
|
+
opts[key] = value unless [:bucket, :key].include?(key)
|
63
|
+
opts
|
64
|
+
end
|
65
|
+
else
|
66
|
+
options.dup
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def escape(str)
|
71
|
+
Seahorse::Util.uri_path_escape(str)
|
72
|
+
end
|
73
|
+
|
59
74
|
end
|
60
75
|
end
|
61
76
|
end
|
@@ -385,7 +385,7 @@ module Aws
|
|
385
385
|
end
|
386
386
|
|
387
387
|
# The minimum and maximum allowable size for the uploaded content.
|
388
|
-
# @param [Range<
|
388
|
+
# @param [Range<Integer>] byte_range
|
389
389
|
# @return [self]
|
390
390
|
def content_length_range(byte_range)
|
391
391
|
min = byte_range.begin
|
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.
|
4
|
+
version: 2.1.31
|
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-10-
|
11
|
+
date: 2015-10-22 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
|
+
version: 2.1.31
|
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.
|
26
|
+
version: 2.1.31
|
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:
|