gruf 2.17.0 → 2.18.0

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
  SHA256:
3
- metadata.gz: feddcb49d9325078dfb0d7367f5e82dfea0d46a82e56784b10484c873ab375a5
4
- data.tar.gz: b4614f08c2b6d8f62edfc1f34be0dffc7af4825b680e49aaf5c6160315314d32
3
+ metadata.gz: 3de94291c905860137fbeb2be431f470af5929eddd3df869b602944dbe3253ea
4
+ data.tar.gz: 282cd45242df875e8c664a9434bb7364592a5062e4d3d4980972d9a314931996
5
5
  SHA512:
6
- metadata.gz: 3e67b5fdaf175a0c8b839532d6024415f12c1fdbd91f44fdec5cfa1ac0d7c33e821b740a192f251664f6ff09ef5dc96d903c480a474d2f53d4b876189023550c
7
- data.tar.gz: 4061112bf7ea91180fb5ea16d5d135cc3a1a7dab7d94ba479d462f3acca3aa183373f64eb5d8e7d9ad0442a457ed5b25e806e407f27c9d3c6ee0658d153b654c
6
+ metadata.gz: d06b793680ecc5064ec5b4978b83a1a18903f9647b733b3e19ff32979044ab129130019780fafb7f09703f1d7e16ecd5983bf5fa0bd08b1906b4af6597f4c832
7
+ data.tar.gz: 7e37790c465cbbf80e1d02d1e71fc9a5e8276fb21d6fb894ae19f6eef663910e4df956293dc218b8de91d940d2586e65248f4f6aababd4d661fb4fdad10d37ce
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.18.0
6
+
7
+ * Add `GRUF_USE_DEFAULT_INTERCEPTORS` ENV to dynamically enable/disable default interceptors
8
+ * Allow passing of request object directly into `call`
9
+
5
10
  ### 2.17.0
6
11
 
7
12
  * [#179] Add Ruby 3.2 support
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 2.6-3.2.
20
+ gruf currently has active support for gRPC 1.10.x+. gruf is compatible and tested with Ruby 2.7-3.2.
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
@@ -43,20 +43,6 @@ Gem::Specification.new do |spec|
43
43
  'wiki_uri' => 'https://github.com/bigcommerce/gruf/wiki'
44
44
  }
45
45
 
46
- spec.add_development_dependency 'bundler-audit', '>= 0.6'
47
- spec.add_development_dependency 'factory_bot', '>= 6.1'
48
- spec.add_development_dependency 'ffaker', '>= 2.15'
49
- spec.add_development_dependency 'pry', '~> 0.12'
50
- spec.add_development_dependency 'pry-byebug', '>= 3.9'
51
- spec.add_development_dependency 'rake', '>= 10.0'
52
- spec.add_development_dependency 'rspec', '>= 3.8'
53
- spec.add_development_dependency 'rspec_junit_formatter', '>= 0.4'
54
- spec.add_development_dependency 'rubocop', '>= 1.0'
55
- spec.add_development_dependency 'rubocop-performance', '>= 0.0.1'
56
- spec.add_development_dependency 'rubocop-rspec', '>= 2.0'
57
- spec.add_development_dependency 'rubocop-thread_safety', '>= 0.3'
58
- spec.add_development_dependency 'simplecov', '>= 0.16'
59
-
60
46
  spec.add_runtime_dependency 'activesupport', '> 4'
61
47
  spec.add_runtime_dependency 'concurrent-ruby', '> 1'
62
48
  spec.add_runtime_dependency 'e2mmap', '>= 0.1'
data/lib/gruf/client.rb CHANGED
@@ -81,7 +81,11 @@ module Gruf
81
81
  #
82
82
  def call(request_method, params = {}, metadata = {}, opts = {}, &block)
83
83
  request_method = request_method.to_sym
84
- req = streaming_request?(request_method) ? params : request_object(request_method, params)
84
+ req = if params.respond_to?(:to_proto) || streaming_request?(request_method)
85
+ params
86
+ else
87
+ request_object(request_method, params)
88
+ end
85
89
  md = build_metadata(metadata)
86
90
  call_sig = call_signature(request_method)
87
91
 
@@ -186,6 +186,8 @@ module Gruf
186
186
  connect_md_proc: nil,
187
187
  server_args: {}
188
188
  }
189
+ self.use_default_interceptors = ::ENV.fetch('GRUF_USE_DEFAULT_INTERCEPTORS', 1).to_i.positive?
190
+
189
191
  if use_default_interceptors
190
192
  interceptors.use(::Gruf::Interceptors::ActiveRecord::ConnectionReset)
191
193
  interceptors.use(::Gruf::Interceptors::Instrumentation::OutputMetadataTimer)
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.17.0'
19
+ VERSION = '2.18.0'
20
20
  end
metadata CHANGED
@@ -1,197 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.0
4
+ version: 2.18.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: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler-audit
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0.6'
27
- - !ruby/object:Gem::Dependency
28
- name: factory_bot
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '6.1'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '6.1'
41
- - !ruby/object:Gem::Dependency
42
- name: ffaker
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '2.15'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '2.15'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.12'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.12'
69
- - !ruby/object:Gem::Dependency
70
- name: pry-byebug
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '3.9'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '3.9'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '10.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '10.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '3.8'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '3.8'
111
- - !ruby/object:Gem::Dependency
112
- name: rspec_junit_formatter
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0.4'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0.4'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '1.0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '1.0'
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-performance
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: 0.0.1
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: 0.0.1
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop-rspec
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '2.0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '2.0'
167
- - !ruby/object:Gem::Dependency
168
- name: rubocop-thread_safety
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0.3'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0.3'
181
- - !ruby/object:Gem::Dependency
182
- name: simplecov
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0.16'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0.16'
195
13
  - !ruby/object:Gem::Dependency
196
14
  name: activesupport
197
15
  requirement: !ruby/object:Gem::Requirement
@@ -406,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
406
224
  - !ruby/object:Gem::Version
407
225
  version: '0'
408
226
  requirements: []
409
- rubygems_version: 3.4.1
227
+ rubygems_version: 3.4.10
410
228
  signing_key:
411
229
  specification_version: 4
412
230
  summary: gRPC Ruby Framework