aws-sdk-resources 2.0.12.pre → 2.0.13.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: 4ca487789f2a39ff784ba8b39432b8a59d94038c
4
- data.tar.gz: ddf5b991bd762e79fc62a542e140a06f4fa10e9f
3
+ metadata.gz: ff2f764f68c866a503270c19514bf242b4792568
4
+ data.tar.gz: 67ab6b0a7031a0a0c3a03419a6f5ca01277bd386
5
5
  SHA512:
6
- metadata.gz: 7ebe4e9108017edfc0d2eac908a5518b3440d584b576f4eec4e53325e60af98390375ef2731e07ced6c065e752effc9ce53fa08f0fdd2452915af063933f0493
7
- data.tar.gz: 7827a636fbfe52562a591c977f62a0ace65bd148fd7a2871e5676218e3c6c3eea31017c83a1cfb118db53cb6a67a93dcf3ab80a8ecc96a9d4b1f7972b91902bc
6
+ metadata.gz: 9361ee57211a9e41cc6aabf7439057e96e58f24f0125eceb51370f84be1207237ad0ba394c3238ef89d5c46f7dbd6fc8eb114397c30975808fce80bf41fca309
7
+ data.tar.gz: ae03b019c1171424808fc8ce56701eff0e03af8f1e515d20e57748be68d2875c26b07d1f718214d629fdd4cf78fa7a92db12e2224634ca4682dae62a7cb544c0
@@ -11,6 +11,40 @@ module Aws
11
11
  autoload :ResourceOperationDocumenter, 'aws-sdk-resources/documenter/resource_operation_documenter'
12
12
  autoload :WaiterOperationDocumenter, 'aws-sdk-resources/documenter/waiter_operation_documenter'
13
13
 
14
+ class << self
15
+
16
+ def apply_customizations
17
+ document_s3_object_upload_file_additional_options
18
+ end
19
+
20
+ private
21
+
22
+ def document_s3_object_upload_file_additional_options
23
+ input = Aws::S3::Client.api.operation(:create_multipart_upload).input
24
+ opts = input.member_names - [:bucket, :key]
25
+ tags = opts.map do |opt|
26
+ shape = input.member(opt)
27
+ type = case shape
28
+ when Seahorse::Model::Shapes::Structure then 'Structure'
29
+ when Seahorse::Model::Shapes::List then 'Array'
30
+ when Seahorse::Model::Shapes::Map then 'Hash'
31
+ when Seahorse::Model::Shapes::String then 'String'
32
+ when Seahorse::Model::Shapes::Integer then 'Integer'
33
+ when Seahorse::Model::Shapes::Float then 'Float'
34
+ when Seahorse::Model::Shapes::Boolean then 'Boolean'
35
+ when Seahorse::Model::Shapes::Timestamp then 'Time'
36
+ when Seahorse::Model::Shapes::Blob then 'IO'
37
+ else
38
+ raise "unhandled shape class `#{shape.class.name}'"
39
+ end
40
+ "@option options [#{type}] :#{opt} #{shape.documentation}"
41
+ end
42
+ tags = YARD::DocstringParser.new.parse(tags).to_docstring.tags
43
+ m = YARD::Registry['Aws::S3::Object#upload_file']
44
+ tags.each { |tag| m.add_tag(tag) }
45
+ end
46
+
47
+ end
14
48
  end
15
49
  end
16
50
  end
@@ -3,7 +3,7 @@ module Aws
3
3
  module Operations
4
4
 
5
5
  # Base class for operations. An operation is any object that responds
6
- # to {#call} receiving a hash of options including:
6
+ # to `#call` receiving a hash of options including:
7
7
  #
8
8
  # * `:resource` - The resource object the operation is invoked against.
9
9
  # * `:args` - An array of arguments given by the caller
@@ -65,12 +65,20 @@ module Aws
65
65
 
66
66
  # Uploads a file from disk to the current object in S3.
67
67
  #
68
- # @example
69
- #
68
+ # # small files are uploaded in a single API call
70
69
  # obj.upload_file('/path/to/file')
71
70
  #
71
+ # Files larger than `:multipart_threshold` are uploaded using the
72
+ # Amazon S3 multipart upload APIs.
73
+ #
74
+ # # large files are automatically split into parts
75
+ # # and the parts are uploaded in parallel
76
+ # obj.upload_file('/path/to/very_large_file')
77
+ #
72
78
  # @param [String,Pathname,File,Tempfile] source A file or path to a file
73
79
  # on the local file system that should be uploaded to this object.
80
+ # If you pass an open file object, then it is your responsibility
81
+ # to close the file object once the upload completes.
74
82
  #
75
83
  # @option options [Integer] :multipart_threshold (15728640) Files larger
76
84
  # than `:multipart_threshold` are uploaded using the S3 multipart APIs.
@@ -82,13 +90,15 @@ module Aws
82
90
  # method that returns the failures that caused the upload to be
83
91
  # aborted.
84
92
  #
85
- # @return [void]
93
+ # @return [Boolean] Returns `true` when the object is uploaded
94
+ # without any errors.
86
95
  #
87
96
  def upload_file(source, options = {})
88
97
  uploader = FileUploader.new(
89
98
  multipart_threshold: options.delete(:multipart_threshold),
90
99
  client: client)
91
100
  uploader.upload(source, options.merge(bucket: bucket_name, key: key))
101
+ true
92
102
  end
93
103
 
94
104
  end
@@ -13,9 +13,9 @@ module Aws
13
13
  # @option options [required, String] :object_key Key of the object
14
14
  # to generate a URL for.
15
15
  #
16
- # @param [Boolean] :force_path_style (false) When `true`, the bucket
17
- # name will always be part of the URI path. When `false`, DNS
18
- # compatible bucket names will be the endpoint host subdomain.
16
+ # @option options [Boolean] :force_path_style (false) When `true`,
17
+ # the bucket name will always be part of the URI path. When `false`,
18
+ # DNS compatible bucket names will be the endpoint host subdomain.
19
19
  #
20
20
  # # path style
21
21
  # "https://s3.amazonaws.com/bucket-name/key"
@@ -56,8 +56,7 @@ module Aws
56
56
 
57
57
  # Recursively lints the resource definition hash against the given
58
58
  # api.
59
- # @param [Hash] definition
60
- # @param [Hash] api
59
+ # @param [Context] context
61
60
  # @return [Array<String>] Returns an array of schema validation errors.
62
61
  # Returns an empty array if there are no errors.
63
62
  def lint(context)
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.12.pre
4
+ version: 2.0.13.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: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-09 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.12
19
+ version: 2.0.13
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.12
26
+ version: 2.0.13
27
27
  description: Provides resource-oriented abstractions for AWS.
28
28
  email:
29
29
  executables: []