google-gax 1.0.0 → 1.0.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
  SHA1:
3
- metadata.gz: 87b2e27818073928a99f7edc7a49ab31a1ff05a6
4
- data.tar.gz: bbe86ff3f6584127ace5d22509c59bb1be0b7e60
3
+ metadata.gz: 8cd0a10641a7e1420289be043083df9265950f90
4
+ data.tar.gz: 59814b61241779e9dad2d71dbca9ddaa3f303518
5
5
  SHA512:
6
- metadata.gz: 108eb512cbf772cb7b0fd1196b9676ef594bb7ecbdab2038f4e307e9e1d20289b7a108d4031a28545c8110468adc23c2ffbccdafa57e311a00f152a6afe32db6
7
- data.tar.gz: 37fb30807ae24551812160303d18ead970587dacb30c53e1a01708eee42ac77e6b4ff5c68b322470c34f0e8a0f04ac98505c4ecb1aab00632bdd31a274cbdd08
6
+ metadata.gz: c7f3f07f30bf2382ff4bf38c2a6c2142dc7a72070ccbe14071b9193ebe53ba281b9fac525669179f5dd3fbc845a1b781c7659768d968b549398cbdf2948033ac
7
+ data.tar.gz: 683d0a62441eabaf25a7c1c87962ffcc86bc8ee5ff3936daa3a8cc78ec20b6c4daadfb5e85d546854676604e8879eb27a4d9f359a327a3b9c9cc2844d7aeafa1
@@ -388,8 +388,19 @@ module Google
388
388
  RetryOptions.new(codes, backoff_settings)
389
389
  end
390
390
 
391
- def upper_camel_to_lower_underscore(string)
392
- string.scan(/[[:upper:]][^[:upper:]]*/).map(&:downcase).join('_')
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.
@@ -29,6 +29,6 @@
29
29
 
30
30
  module Google
31
31
  module Gax
32
- VERSION = '1.0.0'.freeze
32
+ VERSION = '1.0.1'.freeze
33
33
  end
34
34
  end
@@ -60,7 +60,7 @@ A_CONFIG = {
60
60
  'element_count_limit' => 10
61
61
  }
62
62
  },
63
- 'PageStreamingMethod' => {
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
- 'page_streaming_method' => Google::Gax::PageDescriptor.new(
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['page_streaming_method']
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
- 'PageStreamingMethod' => nil,
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['page_streaming_method']
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
- # page_streaming_method is unaffected because it's not specified in
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['page_streaming_method']
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.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-15 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: googleauth