gruf 2.9.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/gruf.gemspec +1 -1
- data/lib/gruf/client.rb +23 -1
- data/lib/gruf/outbound/request_context.rb +1 -1
- data/lib/gruf/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: b132efe87ccf85ffcf897a67f5c268b8696e60e5f2b280c93c52f08fea1aa122
|
4
|
+
data.tar.gz: 6a1d99886e075daac23eadeabd5e347c92d4fdc7659f7dd639d7e79e38c6b6f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5140ea90e6bc018cef228f7bece3096cd389bec36cc4b80f5e1a9b2ebefbab7afe494146c9f4843418f06ffe27d404885d470477c732986befe94b69191297d
|
7
|
+
data.tar.gz: fb3baf2ad10bf606b57c37f45d419e11c41bb34ce56c9801d3367cb471cfe22f097b42bbfa60aa77cbb3eda338c947eee48f909b2866df1bf660953772ac2b64
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@ Changelog for the gruf gem. This includes internal history before the gem was ma
|
|
2
2
|
|
3
3
|
### Pending release
|
4
4
|
|
5
|
+
### 2.10.0
|
6
|
+
|
7
|
+
- Drop support for Ruby 2.4/2.5 to align with Ruby EOL schedule, supporting 2.6+ only
|
8
|
+
- Allow for float/TimeSpec timeout values on clients
|
9
|
+
|
5
10
|
### 2.9.0
|
6
11
|
|
7
12
|
- Change to racially neutral terminology across library
|
data/gruf.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.executables << 'gruf'
|
34
34
|
spec.require_paths = ['lib']
|
35
35
|
|
36
|
-
spec.required_ruby_version = '>= 2.
|
36
|
+
spec.required_ruby_version = '>= 2.6', '< 3.1'
|
37
37
|
|
38
38
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
39
39
|
spec.add_development_dependency 'bundler-audit', '>= 0.6'
|
data/lib/gruf/client.rb
CHANGED
@@ -62,7 +62,7 @@ module Gruf
|
|
62
62
|
@opts[:hostname] = @opts.fetch(:hostname, Gruf.default_client_host)
|
63
63
|
@opts[:channel_credentials] = @opts.fetch(:channel_credentials, Gruf.default_channel_credentials)
|
64
64
|
@error_factory = Gruf::Client::ErrorFactory.new
|
65
|
-
client_options[:timeout] = client_options[:timeout]
|
65
|
+
client_options[:timeout] = parse_timeout(client_options[:timeout]) if client_options.key?(:timeout)
|
66
66
|
client = "#{service}::Stub".constantize.new(@opts[:hostname], build_ssl_credentials, **client_options)
|
67
67
|
super(client)
|
68
68
|
end
|
@@ -216,5 +216,27 @@ module Gruf
|
|
216
216
|
Gruf::Serializers::Errors::Json
|
217
217
|
end
|
218
218
|
end
|
219
|
+
|
220
|
+
##
|
221
|
+
# Handle various timeout values and prevent improper value setting
|
222
|
+
#
|
223
|
+
# @see GRPC::Core::TimeConsts#from_relative_time
|
224
|
+
# @param [mixed] timeout
|
225
|
+
# @return [Float]
|
226
|
+
# @return [GRPC::Core::TimeSpec]
|
227
|
+
#
|
228
|
+
def parse_timeout(timeout)
|
229
|
+
if timeout.nil?
|
230
|
+
GRPC::Core::TimeConsts::ZERO
|
231
|
+
elsif timeout.is_a?(GRPC::Core::TimeSpec)
|
232
|
+
timeout
|
233
|
+
elsif timeout.is_a?(Numeric)
|
234
|
+
timeout
|
235
|
+
elsif timeout.respond_to?(:to_f)
|
236
|
+
timeout.to_f
|
237
|
+
else
|
238
|
+
raise ArgumentError, 'timeout is not a valid value: does not respond to to_f'
|
239
|
+
end
|
240
|
+
end
|
219
241
|
end
|
220
242
|
end
|
data/lib/gruf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gruf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun McCormick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -385,7 +385,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
385
385
|
requirements:
|
386
386
|
- - ">="
|
387
387
|
- !ruby/object:Gem::Version
|
388
|
-
version: '2.
|
388
|
+
version: '2.6'
|
389
389
|
- - "<"
|
390
390
|
- !ruby/object:Gem::Version
|
391
391
|
version: '3.1'
|