google-apis-core 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/apis/core/storage_upload.rb +10 -1
- data/lib/google/apis/core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 583273506a9fe0af61d3973c3f3a12e1dd12bc1058285a3f6a841b8c18e8394b
|
4
|
+
data.tar.gz: c6df64e6173b2e6c1b9917b9f7f9a5a9ac5c76ff523f4e4ea69c4a0e88db6d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84d0d6629c7c901f486e8b77382598efd3c1327a3a01bab7fd8d85e38ec767749615391b8edf00dab555721d1634dc3870190d86c33f486aa3c5aa9ad60b1d52
|
7
|
+
data.tar.gz: 2a2999bd411dd62b51c1c6a0528dd3e453e06d4bf88a58448fa3b2d0831187c5c5f708de1dd1f18da941a023e0586d3bac2a9dd68ea9a6b945737b39a76816c2
|
data/CHANGELOG.md
CHANGED
@@ -139,7 +139,7 @@ module Google
|
|
139
139
|
current_chunk_size = remaining_content_size < CHUNK_SIZE ? remaining_content_size : CHUNK_SIZE
|
140
140
|
|
141
141
|
request_header = header.dup
|
142
|
-
request_header[CONTENT_RANGE_HEADER] =
|
142
|
+
request_header[CONTENT_RANGE_HEADER] = get_content_range_header current_chunk_size
|
143
143
|
request_header[CONTENT_LENGTH_HEADER] = current_chunk_size
|
144
144
|
chunk_body = upload_io.read(current_chunk_size)
|
145
145
|
|
@@ -175,6 +175,15 @@ module Google
|
|
175
175
|
def streamable?(upload_source)
|
176
176
|
upload_source.is_a?(IO) || upload_source.is_a?(StringIO) || upload_source.is_a?(Tempfile)
|
177
177
|
end
|
178
|
+
|
179
|
+
def get_content_range_header current_chunk_size
|
180
|
+
if upload_io.size == 0
|
181
|
+
numerator = "*"
|
182
|
+
else
|
183
|
+
numerator = sprintf("%d-%d", @offset, @offset+current_chunk_size-1)
|
184
|
+
end
|
185
|
+
sprintf('bytes %s/%d', numerator, upload_io.size)
|
186
|
+
end
|
178
187
|
end
|
179
188
|
end
|
180
189
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|
@@ -186,7 +186,7 @@ licenses:
|
|
186
186
|
metadata:
|
187
187
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
188
188
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
189
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.9.
|
189
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.9.1
|
190
190
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
191
191
|
post_install_message:
|
192
192
|
rdoc_options: []
|