google-cloud-storage 1.44.0 → 1.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -26
- data/CHANGELOG.md +70 -0
- data/lib/google/cloud/storage/bucket/cors.rb +2 -2
- data/lib/google/cloud/storage/bucket.rb +261 -12
- data/lib/google/cloud/storage/file/list.rb +10 -3
- data/lib/google/cloud/storage/file/signer_v2.rb +5 -4
- data/lib/google/cloud/storage/file/signer_v4.rb +5 -5
- data/lib/google/cloud/storage/file.rb +141 -10
- data/lib/google/cloud/storage/project.rb +63 -3
- data/lib/google/cloud/storage/service.rb +74 -7
- data/lib/google/cloud/storage/version.rb +1 -1
- data/lib/google/cloud/storage.rb +23 -8
- data/lib/google-cloud-storage.rb +24 -16
- metadata +28 -20
data/lib/google-cloud-storage.rb
CHANGED
@@ -55,6 +55,9 @@ module Google
|
|
55
55
|
# @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
|
56
56
|
# @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
|
57
57
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
58
|
+
# @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
|
59
|
+
# The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
|
60
|
+
# the complete file regardless of size, pass 0 as the chunk size.
|
58
61
|
#
|
59
62
|
# @return [Google::Cloud::Storage::Project]
|
60
63
|
#
|
@@ -74,17 +77,18 @@ module Google
|
|
74
77
|
# readonly_storage = gcloud.storage scope: readonly_scope
|
75
78
|
#
|
76
79
|
def storage scope: nil, retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
|
77
|
-
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil
|
80
|
+
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil, upload_chunk_size: nil
|
78
81
|
Google::Cloud.storage @project, @keyfile, scope: scope,
|
79
|
-
retries:
|
80
|
-
timeout:
|
81
|
-
open_timeout:
|
82
|
-
read_timeout:
|
83
|
-
send_timeout:
|
82
|
+
retries: retries || @retries,
|
83
|
+
timeout: timeout || @timeout,
|
84
|
+
open_timeout: open_timeout || timeout,
|
85
|
+
read_timeout: read_timeout || timeout,
|
86
|
+
send_timeout: send_timeout || timeout,
|
84
87
|
max_elapsed_time: max_elapsed_time,
|
85
88
|
base_interval: base_interval,
|
86
89
|
max_interval: max_interval,
|
87
|
-
multiplier: multiplier
|
90
|
+
multiplier: multiplier,
|
91
|
+
upload_chunk_size: upload_chunk_size
|
88
92
|
end
|
89
93
|
|
90
94
|
##
|
@@ -120,6 +124,9 @@ module Google
|
|
120
124
|
# @param [Integer] open_timeout How long, in seconds, before failed connections time out. Optional.
|
121
125
|
# @param [Integer] read_timeout How long, in seconds, before requests time out. Optional.
|
122
126
|
# @param [Integer] send_timeout How long, in seconds, before receiving response from server times out. Optional.
|
127
|
+
# @param [Integer] upload_chunk_size The chunk size of storage upload, in bytes.
|
128
|
+
# The default value is 100 MB, i.e. 104_857_600 bytes. To disable chunking and upload
|
129
|
+
# the complete file regardless of size, pass 0 as the chunk size.
|
123
130
|
#
|
124
131
|
# @return [Google::Cloud::Storage::Project]
|
125
132
|
#
|
@@ -134,26 +141,27 @@ module Google
|
|
134
141
|
#
|
135
142
|
def self.storage project_id = nil, credentials = nil, scope: nil,
|
136
143
|
retries: nil, timeout: nil, open_timeout: nil, read_timeout: nil, send_timeout: nil,
|
137
|
-
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil
|
144
|
+
max_elapsed_time: nil, base_interval: nil, max_interval: nil, multiplier: nil,
|
145
|
+
upload_chunk_size: nil
|
138
146
|
require "google/cloud/storage"
|
139
147
|
Google::Cloud::Storage.new project_id: project_id,
|
140
148
|
credentials: credentials,
|
141
149
|
scope: scope,
|
142
150
|
retries: retries,
|
143
151
|
timeout: timeout,
|
144
|
-
open_timeout:
|
145
|
-
read_timeout:
|
146
|
-
send_timeout:
|
152
|
+
open_timeout: open_timeout || timeout,
|
153
|
+
read_timeout: read_timeout || timeout,
|
154
|
+
send_timeout: send_timeout || timeout,
|
147
155
|
max_elapsed_time: max_elapsed_time,
|
148
156
|
base_interval: base_interval,
|
149
157
|
max_interval: max_interval,
|
150
|
-
multiplier: multiplier
|
158
|
+
multiplier: multiplier,
|
159
|
+
upload_chunk_size: upload_chunk_size
|
151
160
|
end
|
152
161
|
end
|
153
162
|
end
|
154
163
|
|
155
164
|
# Set the default storage configuration
|
156
|
-
# rubocop:disable Metrics/BlockLength
|
157
165
|
Google::Cloud.configure.add_config! :storage do |config|
|
158
166
|
default_project = Google::Cloud::Config.deferred do
|
159
167
|
ENV["STORAGE_PROJECT"]
|
@@ -182,7 +190,7 @@ Google::Cloud.configure.add_config! :storage do |config|
|
|
182
190
|
config.add_field! :open_timeout, nil, match: Integer
|
183
191
|
config.add_field! :read_timeout, nil, match: Integer
|
184
192
|
config.add_field! :send_timeout, nil, match: Integer
|
185
|
-
|
186
|
-
config.add_field! :endpoint,
|
193
|
+
config.add_field! :upload_chunk_size, nil, match: Integer
|
194
|
+
config.add_field! :endpoint, nil, match: String, allow_nil: true
|
195
|
+
config.add_field! :universe_domain, nil, match: String, allow_nil: true
|
187
196
|
end
|
188
|
-
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -25,54 +25,62 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: google-apis-core
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.13'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0.13'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: google-apis-iamcredentials_v1
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
46
|
- - "~>"
|
33
47
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0.
|
48
|
+
version: '0.18'
|
35
49
|
type: :runtime
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
53
|
- - "~>"
|
40
54
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
55
|
+
version: '0.18'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: google-apis-storage_v1
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
60
|
- - "~>"
|
47
61
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.
|
62
|
+
version: '0.38'
|
49
63
|
type: :runtime
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
67
|
- - "~>"
|
54
68
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
69
|
+
version: '0.38'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: googleauth
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
|
-
- - "
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.16.2
|
63
|
-
- - "<"
|
74
|
+
- - "~>"
|
64
75
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
76
|
+
version: '1.9'
|
66
77
|
type: :runtime
|
67
78
|
prerelease: false
|
68
79
|
version_requirements: !ruby/object:Gem::Requirement
|
69
80
|
requirements:
|
70
|
-
- - "
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 0.16.2
|
73
|
-
- - "<"
|
81
|
+
- - "~>"
|
74
82
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
83
|
+
version: '1.9'
|
76
84
|
- !ruby/object:Gem::Dependency
|
77
85
|
name: digest-crc
|
78
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,14 +129,14 @@ dependencies:
|
|
121
129
|
requirements:
|
122
130
|
- - "~>"
|
123
131
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
132
|
+
version: 1.30.0
|
125
133
|
type: :development
|
126
134
|
prerelease: false
|
127
135
|
version_requirements: !ruby/object:Gem::Requirement
|
128
136
|
requirements:
|
129
137
|
- - "~>"
|
130
138
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
139
|
+
version: 1.30.0
|
132
140
|
- !ruby/object:Gem::Dependency
|
133
141
|
name: minitest
|
134
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -325,14 +333,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
333
|
requirements:
|
326
334
|
- - ">="
|
327
335
|
- !ruby/object:Gem::Version
|
328
|
-
version:
|
336
|
+
version: 3.0.0
|
329
337
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
330
338
|
requirements:
|
331
339
|
- - ">="
|
332
340
|
- !ruby/object:Gem::Version
|
333
341
|
version: '0'
|
334
342
|
requirements: []
|
335
|
-
rubygems_version: 3.
|
343
|
+
rubygems_version: 3.5.23
|
336
344
|
signing_key:
|
337
345
|
specification_version: 4
|
338
346
|
summary: API Client library for Google Cloud Storage
|