gruf 2.21.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b50741eb3c556637beb4f7561de27d922e69ef71e7730e956651efe397fbb4cc
4
- data.tar.gz: a2628665295d095507f7043ac996ae5aa054d3f12b94e40e27bb235ef4f8506e
3
+ metadata.gz: 0bd7ab055cde1666c63a704faa4daf2b0f9fcc1c75bb7c356a48b430f370760a
4
+ data.tar.gz: 0d8a0f0568a8d0c69d46b4712ea58145067389f429e4824bc76e16552572a7c8
5
5
  SHA512:
6
- metadata.gz: 73a86e76db1a1287adb45eb1b5b05d7be83a79d8c26ca43618814f3e6641fd5bdc42f396e5f6721e831573bc0c4bc4784912cab5db3960dd0dcde7cc09b356ca
7
- data.tar.gz: 7623b6481b4ad01f57bf1f088bad8af8d5ff44b54edf03b3140a64dd96d6639e2dbcc54e72200828209d926c3976cf8ddb234eea672cfe0b675035407bdf9a66
6
+ metadata.gz: bdc8a4fd0cdba2adbd0b68a98df59cd14ac0739d1d7c3fb75db8f14e88a6cd5cde7401394a44d8f00de8cf777bbced1afdb6856eaab25cea400632029bdbdc17
7
+ data.tar.gz: afe884659c424ec25b67cdf65470e7aa104b83357df403632101d0cc1d79f1fc97bb748d7db8b730a3dfbb6b77f87b33199c31f991c1e04aa84c3998556b1646
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ 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
+
5
9
  ### 2.21.0
6
10
 
7
11
  * [#221] Add support for Ruby 3.4
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 ? desc.input.new(params) : nil
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
- desc&.name ? desc.name.to_s.underscore.to_sym : nil
174
+ return nil unless desc
175
+
176
+ desc.name.to_s.underscore.to_sym
173
177
  end
174
178
 
175
179
  ##
@@ -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)
@@ -90,7 +90,7 @@ module Gruf
90
90
  raise HookNotFoundError if pos.nil?
91
91
 
92
92
  @registry.insert(
93
- (pos + 1),
93
+ pos + 1,
94
94
  klass: hook_class,
95
95
  options: options
96
96
  )
@@ -90,7 +90,7 @@ module Gruf
90
90
  raise InterceptorNotFoundError if pos.nil?
91
91
 
92
92
  @registry.insert(
93
- (pos + 1),
93
+ pos + 1,
94
94
  klass: interceptor_class,
95
95
  options: options
96
96
  )
data/lib/gruf/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
17
  #
18
18
  module Gruf
19
- VERSION = '2.21.0'
19
+ VERSION = '2.21.1'
20
20
  end
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.21.0
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: 2025-02-06 00:00:00.000000000 Z
11
+ date: 2025-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubygems_version: 3.5.9
200
+ rubygems_version: 3.5.22
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: gRPC Ruby Framework