google-gax 1.0.0 → 1.0.1
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 +4 -4
- data/lib/google/gax/settings.rb +13 -2
- data/lib/google/gax/version.rb +1 -1
- data/spec/google/gax/settings_spec.rb +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd0a10641a7e1420289be043083df9265950f90
|
4
|
+
data.tar.gz: 59814b61241779e9dad2d71dbca9ddaa3f303518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f3f07f30bf2382ff4bf38c2a6c2142dc7a72070ccbe14071b9193ebe53ba281b9fac525669179f5dd3fbc845a1b781c7659768d968b549398cbdf2948033ac
|
7
|
+
data.tar.gz: 683d0a62441eabaf25a7c1c87962ffcc86bc8ee5ff3936daa3a8cc78ec20b6c4daadfb5e85d546854676604e8879eb27a4d9f359a327a3b9c9cc2844d7aeafa1
|
data/lib/google/gax/settings.rb
CHANGED
@@ -388,8 +388,19 @@ module Google
|
|
388
388
|
RetryOptions.new(codes, backoff_settings)
|
389
389
|
end
|
390
390
|
|
391
|
-
|
392
|
-
|
391
|
+
# Port of GRPC::GenericService.underscore that works on frozen strings.
|
392
|
+
# Note that this function often is used on strings inside Hashes, which
|
393
|
+
# are frozen by default, so the GRPC implementation cannot be used directly.
|
394
|
+
#
|
395
|
+
# TODO(geigerj): Consider whether this logic can be factored out into
|
396
|
+
# a shared location that both gRPC and GAX can depend on in order to remove
|
397
|
+
# the additional dependency on gRPC this introduces.
|
398
|
+
def upper_camel_to_lower_underscore(s)
|
399
|
+
s = s.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
400
|
+
s = s.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
401
|
+
s = s.tr('-', '_')
|
402
|
+
s = s.downcase
|
403
|
+
s
|
393
404
|
end
|
394
405
|
|
395
406
|
# Constructs a dictionary mapping method names to CallSettings.
|
data/lib/google/gax/version.rb
CHANGED
@@ -60,7 +60,7 @@ A_CONFIG = {
|
|
60
60
|
'element_count_limit' => 10
|
61
61
|
}
|
62
62
|
},
|
63
|
-
'
|
63
|
+
'SomeHTTPSPageStreamingMethod' => {
|
64
64
|
'retry_codes_name' => 'bar_retry',
|
65
65
|
'retry_params_name' => 'default'
|
66
66
|
}
|
@@ -70,7 +70,7 @@ A_CONFIG = {
|
|
70
70
|
}.freeze
|
71
71
|
|
72
72
|
PAGE_DESCRIPTORS = {
|
73
|
-
'
|
73
|
+
'some_https_page_streaming_method' => Google::Gax::PageDescriptor.new(
|
74
74
|
'page_token', 'next_page_token', 'page_streams'
|
75
75
|
)
|
76
76
|
}.freeze
|
@@ -107,7 +107,7 @@ describe Google::Gax do
|
|
107
107
|
expect(settings.kwargs).to match('key' => 'value')
|
108
108
|
expect(settings.errors).to match_array([StandardError])
|
109
109
|
|
110
|
-
settings = defaults['
|
110
|
+
settings = defaults['some_https_page_streaming_method']
|
111
111
|
expect(settings.timeout).to be(30)
|
112
112
|
expect(settings.bundler).to be_nil
|
113
113
|
expect(settings.bundle_descriptor).to be_nil
|
@@ -126,7 +126,7 @@ describe Google::Gax do
|
|
126
126
|
'interfaces' => {
|
127
127
|
SERVICE_NAME => {
|
128
128
|
'methods' => {
|
129
|
-
'
|
129
|
+
'SomeHTTPSPageStreamingMethod' => nil,
|
130
130
|
'BundlingMethod' => {
|
131
131
|
'bundling' => nil
|
132
132
|
}
|
@@ -145,7 +145,7 @@ describe Google::Gax do
|
|
145
145
|
expect(settings.bundler).to be_nil
|
146
146
|
expect(settings.page_descriptor).to be_nil
|
147
147
|
|
148
|
-
settings = defaults['
|
148
|
+
settings = defaults['some_https_page_streaming_method']
|
149
149
|
expect(settings.timeout).to be(30)
|
150
150
|
expect(settings.page_descriptor).to be_a(Google::Gax::PageDescriptor)
|
151
151
|
expect(settings.retry_options).to be_nil
|
@@ -194,10 +194,10 @@ describe Google::Gax do
|
|
194
194
|
expect(settings.bundler).to be_nil
|
195
195
|
expect(settings.bundle_descriptor).to be_a(Google::Gax::BundleDescriptor)
|
196
196
|
|
197
|
-
#
|
198
|
-
# overrides. 'bar_retry' or 'default' definitions in overrides should
|
197
|
+
# some_https_page_streaming_method is unaffected because it's not specified
|
198
|
+
# in overrides. 'bar_retry' or 'default' definitions in overrides should
|
199
199
|
# not affect the methods which are not in the overrides.
|
200
|
-
settings = defaults['
|
200
|
+
settings = defaults['some_https_page_streaming_method']
|
201
201
|
backoff = settings.retry_options.backoff_settings
|
202
202
|
expect(backoff.initial_retry_delay_millis).to be(100)
|
203
203
|
expect(backoff.retry_delay_multiplier).to be(1.2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-gax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
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: 2017-12-
|
11
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: googleauth
|