gruf 2.20.1 → 2.21.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/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/gruf.gemspec +5 -1
- data/lib/gruf/autoloaders.rb +4 -4
- data/lib/gruf/client.rb +6 -2
- data/lib/gruf/configuration.rb +2 -2
- data/lib/gruf/controllers/base.rb +2 -2
- data/lib/gruf/hooks/registry.rb +1 -1
- data/lib/gruf/interceptors/registry.rb +1 -1
- data/lib/gruf/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bd7ab055cde1666c63a704faa4daf2b0f9fcc1c75bb7c356a48b430f370760a
|
4
|
+
data.tar.gz: 0d8a0f0568a8d0c69d46b4712ea58145067389f429e4824bc76e16552572a7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdc8a4fd0cdba2adbd0b68a98df59cd14ac0739d1d7c3fb75db8f14e88a6cd5cde7401394a44d8f00de8cf777bbced1afdb6856eaab25cea400632029bdbdc17
|
7
|
+
data.tar.gz: afe884659c424ec25b67cdf65470e7aa104b83357df403632101d0cc1d79f1fc97bb748d7db8b730a3dfbb6b77f87b33199c31f991c1e04aa84c3998556b1646
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@ Changelog for the gruf gem. This includes internal history before the gem was ma
|
|
2
2
|
|
3
3
|
### Pending release
|
4
4
|
|
5
|
+
### 2.21.1
|
6
|
+
|
7
|
+
* [#230] Add fix for load order issues with reloader in some non-Rails environments
|
8
|
+
|
9
|
+
### 2.21.0
|
10
|
+
|
11
|
+
* [#221] Add support for Ruby 3.4
|
12
|
+
|
5
13
|
### 2.20.1
|
6
14
|
|
7
15
|
* [#208] Fix rails `clear_active_connections!` deprecation warning
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ up fast and efficiently at scale. Some of its features include:
|
|
17
17
|
still preserving gRPC BadStatus codes
|
18
18
|
* Server and client execution timings in responses
|
19
19
|
|
20
|
-
gruf currently has active support for gRPC 1.10.x+. gruf is compatible and tested with Ruby 3.0-3.
|
20
|
+
gruf currently has active support for gRPC 1.10.x+. gruf is compatible and tested with Ruby 3.0-3.4.
|
21
21
|
gruf is also not [Rails](https://github.com/rails/rails)-specific, and can be used in any Ruby framework
|
22
22
|
(such as [Grape](https://github.com/ruby-grape/grape) or [dry-rb](https://dry-rb.org/), for instance).
|
23
23
|
|
data/gruf.gemspec
CHANGED
@@ -32,7 +32,11 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.executables << 'gruf'
|
33
33
|
spec.require_paths = ['lib']
|
34
34
|
|
35
|
-
|
35
|
+
# The range of supported Ruby major versions is intentionally capped to ensure that the latest Ruby major version is
|
36
|
+
# supported by grpc gem before bumping the maximum Ruby major version that this gem officially supports.
|
37
|
+
# grpc gem has a history of lagging behind the latest Ruby version support post-new-year every year.
|
38
|
+
# See: https://github.com/bigcommerce/gruf/pull/221#issuecomment-2573428792
|
39
|
+
spec.required_ruby_version = '>= 3.0', '< 3.5'
|
36
40
|
|
37
41
|
spec.metadata = {
|
38
42
|
'bug_tracker_uri' => 'https://github.com/bigcommerce/gruf/issues',
|
data/lib/gruf/autoloaders.rb
CHANGED
@@ -51,18 +51,18 @@ module Gruf
|
|
51
51
|
#
|
52
52
|
# @return [::Gruf::Controllers::Autoloader]
|
53
53
|
#
|
54
|
-
# rubocop:disable ThreadSafety/
|
54
|
+
# rubocop:disable ThreadSafety/ClassInstanceVariable
|
55
55
|
def controllers(controllers_path: nil)
|
56
56
|
controllers_mutex do
|
57
57
|
@controllers ||= ::Gruf::Controllers::Autoloader.new(path: controllers_path || ::Gruf.controllers_path)
|
58
58
|
end
|
59
59
|
end
|
60
|
-
# rubocop:enable ThreadSafety/
|
60
|
+
# rubocop:enable ThreadSafety/ClassInstanceVariable
|
61
61
|
|
62
62
|
##
|
63
63
|
# Handle mutations to the controllers autoloader in a thread-safe manner
|
64
64
|
#
|
65
|
-
# rubocop:disable ThreadSafety/
|
65
|
+
# rubocop:disable ThreadSafety/ClassInstanceVariable
|
66
66
|
def controllers_mutex(&block)
|
67
67
|
@controllers_mutex ||= begin
|
68
68
|
require 'monitor'
|
@@ -70,7 +70,7 @@ module Gruf
|
|
70
70
|
end
|
71
71
|
@controllers_mutex.synchronize(&block)
|
72
72
|
end
|
73
|
-
# rubocop:enable ThreadSafety/
|
73
|
+
# rubocop:enable ThreadSafety/ClassInstanceVariable
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
data/lib/gruf/client.rb
CHANGED
@@ -156,20 +156,24 @@ module Gruf
|
|
156
156
|
# @param [Symbol] request_method The method name being called on the remote service
|
157
157
|
# @param [Hash] params (Optional) A hash of parameters that will populate the request object
|
158
158
|
# @return [Class] The request object that corresponds to the method being called
|
159
|
+
# @return [NilClass] if the descriptor is not found or the input is not defined
|
159
160
|
#
|
160
161
|
def request_object(request_method, params = {})
|
161
162
|
desc = rpc_desc(request_method)
|
162
|
-
desc&.input
|
163
|
+
desc&.input&.new(params)
|
163
164
|
end
|
164
165
|
|
165
166
|
##
|
166
167
|
# Properly find the appropriate call signature for the GRPC::GenericService given the request method name
|
167
168
|
#
|
168
169
|
# @return [Symbol]
|
170
|
+
# @return [NilClass] If the descriptor is not found
|
169
171
|
#
|
170
172
|
def call_signature(request_method)
|
171
173
|
desc = rpc_desc(request_method)
|
172
|
-
|
174
|
+
return nil unless desc
|
175
|
+
|
176
|
+
desc.name.to_s.underscore.to_sym
|
173
177
|
end
|
174
178
|
|
175
179
|
##
|
data/lib/gruf/configuration.rb
CHANGED
@@ -189,8 +189,8 @@ module Gruf
|
|
189
189
|
self.use_default_interceptors = ::ENV.fetch('GRUF_USE_DEFAULT_INTERCEPTORS', 1).to_i.positive?
|
190
190
|
|
191
191
|
if use_default_interceptors
|
192
|
-
if defined?(::Rails)
|
193
|
-
interceptors.use(::Gruf::Interceptors::Rails::Reloader, reloader: Rails.application.reloader)
|
192
|
+
if defined?(::Rails) && ::Rails.respond_to?(:application) && ::Rails.application.respond_to?(:reloader)
|
193
|
+
interceptors.use(::Gruf::Interceptors::Rails::Reloader, reloader: ::Rails.application.reloader)
|
194
194
|
end
|
195
195
|
interceptors.use(::Gruf::Interceptors::ActiveRecord::ConnectionReset)
|
196
196
|
interceptors.use(::Gruf::Interceptors::Instrumentation::OutputMetadataTimer)
|
@@ -66,9 +66,9 @@ module Gruf
|
|
66
66
|
service_class = service.name.constantize
|
67
67
|
::Gruf.logger.debug "[gruf] Binding #{service_class} to #{name}"
|
68
68
|
::Gruf.services << service_class
|
69
|
-
# rubocop:disable ThreadSafety/
|
69
|
+
# rubocop:disable ThreadSafety/ClassInstanceVariable
|
70
70
|
@bound_service = service_class
|
71
|
-
# rubocop:enable ThreadSafety/
|
71
|
+
# rubocop:enable ThreadSafety/ClassInstanceVariable
|
72
72
|
ServiceBinder.bind!(service: service_class, controller: self)
|
73
73
|
end
|
74
74
|
|
data/lib/gruf/hooks/registry.rb
CHANGED
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.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun McCormick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -190,14 +190,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
190
|
version: '3.0'
|
191
191
|
- - "<"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: '3.
|
193
|
+
version: '3.5'
|
194
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
195
|
requirements:
|
196
196
|
- - ">="
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
|
-
rubygems_version: 3.5.
|
200
|
+
rubygems_version: 3.5.22
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: gRPC Ruby Framework
|