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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39e8c0ee69956045fad35dd99b60187bee9a559e66c31141784f69c938b828da
4
- data.tar.gz: 2bc2f65430050943360436b018b2149f876bdb190d8d637e42d1ac5c908aee41
3
+ metadata.gz: 583273506a9fe0af61d3973c3f3a12e1dd12bc1058285a3f6a841b8c18e8394b
4
+ data.tar.gz: c6df64e6173b2e6c1b9917b9f7f9a5a9ac5c76ff523f4e4ea69c4a0e88db6d2c
5
5
  SHA512:
6
- metadata.gz: 26a81d876d54cd42e9e84a4c057297ccd77a1cfebe481de646504f8e30d08496b72141581532dfeae03d3dcb9ff955330b7e94c81bc9bb555130e501fc2879f2
7
- data.tar.gz: 2c1242fd64e8e66e82b04aa2a4f4c0fb0979e7a0a53f8162836a90a58242f1d46d4b8660101a15c9e82b6b6e48819cdffe5053f90894a9cf1dd5040de2c21db0
6
+ metadata.gz: 84d0d6629c7c901f486e8b77382598efd3c1327a3a01bab7fd8d85e38ec767749615391b8edf00dab555721d1634dc3870190d86c33f486aa3c5aa9ad60b1d52
7
+ data.tar.gz: 2a2999bd411dd62b51c1c6a0528dd3e453e06d4bf88a58448fa3b2d0831187c5c5f708de1dd1f18da941a023e0586d3bac2a9dd68ea9a6b945737b39a76816c2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.9.1 (2022-10-18)
4
+
5
+ #### Bug Fixes
6
+
7
+ * Storage upload to handle empty string/file cases ([#12306](https://github.com/googleapis/google-api-ruby-client/issues/12306))
8
+
3
9
  ### 0.9.0 (2022-09-18)
4
10
 
5
11
  #### Features
@@ -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] = sprintf('bytes %d-%d/%d', @offset, @offset+current_chunk_size-1, upload_io.size)
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
@@ -16,7 +16,7 @@ module Google
16
16
  module Apis
17
17
  module Core
18
18
  # Core version
19
- VERSION = "0.9.0".freeze
19
+ VERSION = "0.9.1".freeze
20
20
  end
21
21
  end
22
22
  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.0
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-09-19 00:00:00.000000000 Z
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.0
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: []