aws-sdk-s3 1.197.0 → 1.198.0

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
  SHA256:
3
- metadata.gz: 206194d0b6217c7fd01477cc0407b4d55080bdd269f14d33f3ae072fabfaa2ee
4
- data.tar.gz: e269ddd5c94adc905a49ddf2f8fa80f1446684889d934aefd14d38136f81822b
3
+ metadata.gz: 8f8abf2a326b6ebef3c9c9ceac08c2378c4e0d9bc3e187a4a3dd89bb81fb8154
4
+ data.tar.gz: 6186fe037f7fc5541c2a8e1006c9cb0a34630c69fb4a0bdebc40a63b872c9189
5
5
  SHA512:
6
- metadata.gz: 2d27932019687706da5456a0c7dfa3e4c9bb81e3173105f6572e7a1afd4af96e553e94fedb19ca3c0052fcc4f3b297fcb14fe3719da037d9a9b333701fc35c24
7
- data.tar.gz: bc7d64a072edfe9fc2154fec0834e6d27b19f2fbdca79b39571b1057cd73e5041abb113678d5c03414e664bd9422a8a714c37ec84015865de6566dc5b1a5909c
6
+ metadata.gz: 5aade0fd0688cee874c30704211d6f166ea8aaca4838adcdd2ad139fd0cb51b24f97e6715394c3aa484ac601628204d47c057b11d448f15c5d1bf1e90760d10f
7
+ data.tar.gz: 245ada14810d09437af36e44f02898129f259902281a10cf0b870c6654ad1525c1b74d4f34138cdcfdf1920c4602a4880cc78194d18a8c5912db67d386f1ab99
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.198.0 (2025-08-26)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ * Issue - Fix multipart `download_file` to support `Pathname`, `File` and `Tempfile` objects as download destinations.
10
+
4
11
  1.197.0 (2025-08-19)
5
12
  ------------------
6
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.197.0
1
+ 1.198.0
@@ -21735,7 +21735,7 @@ module Aws::S3
21735
21735
  tracer: tracer
21736
21736
  )
21737
21737
  context[:gem_name] = 'aws-sdk-s3'
21738
- context[:gem_version] = '1.197.0'
21738
+ context[:gem_version] = '1.198.0'
21739
21739
  Seahorse::Client::Request.new(handlers, context)
21740
21740
  end
21741
21741
 
@@ -488,7 +488,10 @@ module Aws
488
488
  # end
489
489
  # obj.download_file('/path/to/file', progress_callback: progress)
490
490
  #
491
- # @param [String] destination Where to download the file to.
491
+ # @param [String, Pathname, File, Tempfile] destination
492
+ # Where to download the file to. This can either be a String or Pathname to the file, an open File object,
493
+ # or an open Tempfile object. If you pass an open File or Tempfile object, then you are responsible for
494
+ # closing it after the download completes.
492
495
  #
493
496
  # @param [Hash] options
494
497
  # Additional options for {Client#get_object} and #{Client#head_object} may be provided.
@@ -20,7 +20,12 @@ module Aws
20
20
  attr_reader :client
21
21
 
22
22
  def download(destination, options = {})
23
- @path = destination
23
+ valid_types = [String, Pathname, File, Tempfile]
24
+ unless valid_types.include?(destination.class)
25
+ raise ArgumentError, "Invalid destination, expected #{valid_types.join(', ')} but got: #{destination.class}"
26
+ end
27
+
28
+ @destination = destination
24
29
  @mode = options.delete(:mode) || 'auto'
25
30
  @thread_count = options.delete(:thread_count) || 10
26
31
  @chunk_size = options.delete(:chunk_size)
@@ -42,7 +47,7 @@ module Aws
42
47
  raise ArgumentError, "Invalid mode #{@mode} provided, :mode should be single_request, get_range or auto"
43
48
  end
44
49
  end
45
- File.rename(@temp_path, @path) if @temp_path
50
+ File.rename(@temp_path, @destination) if @temp_path
46
51
  ensure
47
52
  File.delete(@temp_path) if @temp_path && File.exist?(@temp_path)
48
53
  end
@@ -118,7 +123,9 @@ module Aws
118
123
  def download_in_threads(pending, total_size)
119
124
  threads = []
120
125
  progress = MultipartProgress.new(pending, total_size, @progress_callback) if @progress_callback
121
- @temp_path = "#{@path}.s3tmp.#{SecureRandom.alphanumeric(8)}"
126
+ unless [File, Tempfile].include?(@destination.class)
127
+ @temp_path = "#{@destination}.s3tmp.#{SecureRandom.alphanumeric(8)}"
128
+ end
122
129
  @thread_count.times do
123
130
  thread = Thread.new do
124
131
  begin
@@ -159,11 +166,12 @@ module Aws
159
166
  end
160
167
 
161
168
  def write(body, range)
162
- File.write(@temp_path, body.read, range.split('-').first.to_i)
169
+ path = @temp_path || @destination
170
+ File.write(path, body.read, range.split('-').first.to_i)
163
171
  end
164
172
 
165
173
  def single_request
166
- params = @params.merge(response_target: @path)
174
+ params = @params.merge(response_target: @destination)
167
175
  params[:on_chunk_received] = single_part_progress if @progress_callback
168
176
  resp = @client.get_object(params)
169
177
  return resp unless @on_checksum_validated
@@ -45,8 +45,10 @@ module Aws
45
45
  # end
46
46
  # tm.download_file('/path/to/file', bucket: 'bucket', key: 'key', progress_callback: progress)
47
47
  #
48
- # @param [String] destination
49
- # Where to download the file to.
48
+ # @param [String, Pathname, File, Tempfile] destination
49
+ # Where to download the file to. This can either be a String or Pathname to the file, an open File object,
50
+ # or an open Tempfile object. If you pass an open File or Tempfile object, then you are responsible for
51
+ # closing it after the download completes.
50
52
  #
51
53
  # @param [String] bucket
52
54
  # The name of the S3 bucket to upload to.
data/lib/aws-sdk-s3.rb CHANGED
@@ -75,7 +75,7 @@ module Aws::S3
75
75
  autoload :ObjectVersion, 'aws-sdk-s3/object_version'
76
76
  autoload :EventStreams, 'aws-sdk-s3/event_streams'
77
77
 
78
- GEM_VERSION = '1.197.0'
78
+ GEM_VERSION = '1.198.0'
79
79
 
80
80
  end
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.197.0
4
+ version: 1.198.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '3'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 3.228.0
49
+ version: 3.231.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '3'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 3.228.0
59
+ version: 3.231.0
60
60
  description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
61
61
  This gem is part of the AWS SDK for Ruby.
62
62
  email: