gapic-common 0.9.0 → 0.10.0

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: 4187157fccf115d742dc9e5b074feccf9b65a5dc241bab8214810b4c257288a8
4
- data.tar.gz: 7160ec37659fd5bbffc3e517bd40a65295da42fad7743b38869b58d59a34b09f
3
+ metadata.gz: 5962314c78d1864ee6b768003c887d15af76619c8644a96392f0931ad6f2712c
4
+ data.tar.gz: 89920288c50070f089949eb11ff94010a52b69d1919b5e4ab6eb50cd9a3610ad
5
5
  SHA512:
6
- metadata.gz: 71cdc0f8c19c10a51dee060c3048b8b13b8223c0e527e103629058504b60013180e24232ae729014943e1d4b66ba98563796f35558d0d2b5fd955a49f0abf720
7
- data.tar.gz: 31b53d85d36746f58b17e778f8fd4b5469a782ae9a68c3847eee309dcb5b2b4ae068785e295763ac17d081518656427408142426cfa7b0f128287599df3e2c47
6
+ metadata.gz: 02c0113ca2287b79558c698393b3315b85c4359b15b90bf54929ea7e7f04a5189769559a69d22f35cebcedb99d62d1a02b2a7ca16739ea724565ace848a89279
7
+ data.tar.gz: cf43e6bedb320bc4f91f22e4b0354c87583b92e5734ea4d5d40d280bd9ffeaf0d272eda97e1e9bae2ce7e507e8a56a76c4a5c26ca5156326e7edd1bc88dfc5d9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Release History
2
2
 
3
+ ### 0.10.0 (2022-06-20)
4
+
5
+ #### Features
6
+
7
+ * Require at least Ruby 2.6
8
+ * Support faraday 2.0
9
+ #### Bug Fixes
10
+
11
+ * Fix precision issues in protobuf timestamp conversion
12
+ * Fix some Ruby 3.0 keyword argument usage errors
13
+
3
14
  ### 0.9.0 (2022-05-18)
4
15
 
5
16
  #### Features
data/README.md CHANGED
@@ -15,11 +15,11 @@ convenient and idiomatic API surface to callers.
15
15
 
16
16
  ## Supported Ruby Versions
17
17
 
18
- This library is supported on Ruby 2.4+.
18
+ This library is supported on Ruby 2.6+.
19
19
 
20
20
  Google provides official support for Ruby versions that are actively supported
21
21
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or in
22
- security maintenance, and not end of life. Currently, this means Ruby 2.4 and
22
+ security maintenance, and not end of life. Currently, this means Ruby 2.6 and
23
23
  later. Older versions of Ruby _may_ still work, but are unsupported and not
24
24
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
25
25
  about the Ruby support schedule.
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Gapic
16
16
  module Common
17
- VERSION = "0.9.0".freeze
17
+ VERSION = "0.10.0".freeze
18
18
  end
19
19
  end
@@ -198,7 +198,7 @@ module Gapic
198
198
  # @yield operation [Gapic::GenericLRO::Operation] Yields the finished Operation.
199
199
  #
200
200
  def wait_until_done! retry_policy: nil
201
- retry_policy = ::Gapic::Operation::RetryPolicy.new retry_policy if retry_policy.is_a? Hash
201
+ retry_policy = ::Gapic::Operation::RetryPolicy.new(**retry_policy) if retry_policy.is_a? Hash
202
202
  retry_policy ||= ::Gapic::Operation::RetryPolicy.new
203
203
 
204
204
  until done?
@@ -253,7 +253,7 @@ module Gapic
253
253
  # @yield operation [Gapic::Operation] Yields the finished Operation.
254
254
  #
255
255
  def wait_until_done! retry_policy: nil
256
- retry_policy = RetryPolicy.new retry_policy if retry_policy.is_a? Hash
256
+ retry_policy = RetryPolicy.new(**retry_policy) if retry_policy.is_a? Hash
257
257
  retry_policy ||= RetryPolicy.new
258
258
 
259
259
  until done?
@@ -181,8 +181,7 @@ module Gapic
181
181
 
182
182
  min_repeated_field_number = fields.map(&:number).min
183
183
  if min_repeated_field_number != repeated_field.number
184
- raise ArgumentError, "#{@response.class} must have one primary repeated field " \
185
- "by both position and number"
184
+ raise ArgumentError, "#{@response.class} must have one primary repeated field by both position and number"
186
185
  end
187
186
 
188
187
  # We have the correct repeated field, save the field's name
@@ -134,7 +134,7 @@ module Gapic
134
134
  #
135
135
  # @return [Time] The converted Time.
136
136
  def self.timestamp_to_time timestamp
137
- Time.at timestamp.nanos * 10**-9 + timestamp.seconds
137
+ Time.at timestamp.seconds, timestamp.nanos, :nanosecond
138
138
  end
139
139
 
140
140
  ##
@@ -14,6 +14,7 @@
14
14
 
15
15
  require "googleauth"
16
16
  require "gapic/rest/faraday_middleware"
17
+ require "faraday/retry"
17
18
 
18
19
  module Gapic
19
20
  module Rest
@@ -140,7 +140,7 @@ module Gapic
140
140
  # Name to value hash of the variables for the uri template expansion.
141
141
  # The values are percent-escaped with slashes potentially preserved.
142
142
  def bind_uri_values! http_binding, request_hash
143
- http_binding.field_bindings.map do |field_binding|
143
+ http_binding.field_bindings.to_h do |field_binding|
144
144
  field_path_camel = field_binding.field_path.split(".").map { |part| camel_name_for part }.join(".")
145
145
  field_value = extract_scalar_value! request_hash, field_path_camel, field_binding.regex
146
146
 
@@ -153,7 +153,7 @@ module Gapic
153
153
  end
154
154
 
155
155
  [field_binding.field_path, field_value]
156
- end.to_h
156
+ end
157
157
  end
158
158
 
159
159
  # Percent-escapes a string.
@@ -289,7 +289,7 @@ module Gapic
289
289
  def camel_name_for attr_name
290
290
  parts = attr_name.split "_"
291
291
  first_part = parts[0]
292
- other_parts = parts[1..-1]
292
+ other_parts = parts[1..]
293
293
  other_parts_pascal = other_parts.map(&:capitalize).join
294
294
  "#{first_part}#{other_parts_pascal}"
295
295
  end
metadata CHANGED
@@ -1,56 +1,62 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-18 00:00:00.000000000 Z
11
+ date: 2022-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '1.3'
22
+ version: 3.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.9'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '1.3'
32
+ version: 3.a
27
33
  - !ruby/object:Gem::Dependency
28
- name: googleapis-common-protos
34
+ name: faraday-retry
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: 1.3.11
39
+ version: '1.0'
34
40
  - - "<"
35
41
  - !ruby/object:Gem::Version
36
- version: 2.a
42
+ version: 3.a
37
43
  type: :runtime
38
44
  prerelease: false
39
45
  version_requirements: !ruby/object:Gem::Requirement
40
46
  requirements:
41
47
  - - ">="
42
48
  - !ruby/object:Gem::Version
43
- version: 1.3.11
49
+ version: '1.0'
44
50
  - - "<"
45
51
  - !ruby/object:Gem::Version
46
- version: 2.a
52
+ version: 3.a
47
53
  - !ruby/object:Gem::Dependency
48
- name: googleapis-common-protos-types
54
+ name: googleapis-common-protos
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
57
  - - ">="
52
58
  - !ruby/object:Gem::Version
53
- version: 1.0.6
59
+ version: 1.3.12
54
60
  - - "<"
55
61
  - !ruby/object:Gem::Version
56
62
  version: 2.a
@@ -60,17 +66,17 @@ dependencies:
60
66
  requirements:
61
67
  - - ">="
62
68
  - !ruby/object:Gem::Version
63
- version: 1.0.6
69
+ version: 1.3.12
64
70
  - - "<"
65
71
  - !ruby/object:Gem::Version
66
72
  version: 2.a
67
73
  - !ruby/object:Gem::Dependency
68
- name: googleauth
74
+ name: googleapis-common-protos-types
69
75
  requirement: !ruby/object:Gem::Requirement
70
76
  requirements:
71
77
  - - ">="
72
78
  - !ruby/object:Gem::Version
73
- version: 0.17.0
79
+ version: 1.3.1
74
80
  - - "<"
75
81
  - !ruby/object:Gem::Version
76
82
  version: 2.a
@@ -80,10 +86,24 @@ dependencies:
80
86
  requirements:
81
87
  - - ">="
82
88
  - !ruby/object:Gem::Version
83
- version: 0.17.0
89
+ version: 1.3.1
84
90
  - - "<"
85
91
  - !ruby/object:Gem::Version
86
92
  version: 2.a
93
+ - !ruby/object:Gem::Dependency
94
+ name: googleauth
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1.0'
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '1.0'
87
107
  - !ruby/object:Gem::Dependency
88
108
  name: google-protobuf
89
109
  requirement: !ruby/object:Gem::Requirement
@@ -132,28 +152,28 @@ dependencies:
132
152
  requirements:
133
153
  - - "~>"
134
154
  - !ruby/object:Gem::Version
135
- version: 1.25.1
155
+ version: 1.26.0
136
156
  type: :development
137
157
  prerelease: false
138
158
  version_requirements: !ruby/object:Gem::Requirement
139
159
  requirements:
140
160
  - - "~>"
141
161
  - !ruby/object:Gem::Version
142
- version: 1.25.1
162
+ version: 1.26.0
143
163
  - !ruby/object:Gem::Dependency
144
164
  name: minitest
145
165
  requirement: !ruby/object:Gem::Requirement
146
166
  requirements:
147
167
  - - "~>"
148
168
  - !ruby/object:Gem::Version
149
- version: '5.14'
169
+ version: '5.16'
150
170
  type: :development
151
171
  prerelease: false
152
172
  version_requirements: !ruby/object:Gem::Requirement
153
173
  requirements:
154
174
  - - "~>"
155
175
  - !ruby/object:Gem::Version
156
- version: '5.14'
176
+ version: '5.16'
157
177
  - !ruby/object:Gem::Dependency
158
178
  name: minitest-autotest
159
179
  requirement: !ruby/object:Gem::Requirement
@@ -306,14 +326,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
306
326
  requirements:
307
327
  - - ">="
308
328
  - !ruby/object:Gem::Version
309
- version: '2.5'
329
+ version: '2.6'
310
330
  required_rubygems_version: !ruby/object:Gem::Requirement
311
331
  requirements:
312
332
  - - ">="
313
333
  - !ruby/object:Gem::Version
314
334
  version: '0'
315
335
  requirements: []
316
- rubygems_version: 3.3.5
336
+ rubygems_version: 3.3.14
317
337
  signing_key:
318
338
  specification_version: 4
319
339
  summary: Common code for GAPIC-generated API clients