protobuf 3.8.3 → 3.8.4
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/lib/protobuf/enum.rb +5 -4
- data/lib/protobuf/version.rb +1 -1
- data/spec/lib/protobuf/enum_spec.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed05b202c2cfac393096533ca5980e215ed2698043f44e5f1820ea3445ffe8d4
|
4
|
+
data.tar.gz: ae0de25bd7bcbe52aaef1df049263f6e64e65702e55e66347aceba9a0b8cca94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a14ef672b0099a05ddd9cd7c823a2da550137fe47aae47decbfa136a032bfee1400cd755ee71739d2572dd94eea55617c8169bea373cbc0c57e2c5c7b0e5b320
|
7
|
+
data.tar.gz: 2afb6adf6d555daa7da85b09da51723a6da78da680804091a8047c771b0641184bade5d147fee154d92e390b47da964ffea840927bab27bebda2ec3cd3fbaf94
|
data/lib/protobuf/enum.rb
CHANGED
@@ -283,12 +283,13 @@ module Protobuf
|
|
283
283
|
tag.to_int
|
284
284
|
end
|
285
285
|
|
286
|
-
##
|
287
286
|
# This fixes a reflection bug in JrJackson RubyAnySerializer that does not
|
288
|
-
#
|
287
|
+
# render Protobuf enums correctly because to_json is not defined. It takes
|
288
|
+
# any number of arguments to support the JSON gem trying to pass an argument.
|
289
|
+
# NB: This method is required to return a string and not an integer.
|
289
290
|
#
|
290
|
-
def to_json
|
291
|
-
|
291
|
+
def to_json(*)
|
292
|
+
to_s
|
292
293
|
end
|
293
294
|
|
294
295
|
def to_s(format = :tag)
|
data/lib/protobuf/version.rb
CHANGED
@@ -162,8 +162,10 @@ RSpec.describe Protobuf::Enum do
|
|
162
162
|
|
163
163
|
describe '.to_json' do
|
164
164
|
it 'renders the enum value' do
|
165
|
-
expect(Test::EnumTestType::ONE.to_json).to eq(1)
|
165
|
+
expect(Test::EnumTestType::ONE.to_json).to eq("1")
|
166
166
|
expect({ :value => Test::EnumTestType::ONE }.to_json).to eq(%({"value":1}))
|
167
|
+
# JSON.dump passes arguments to the to_json method which broke in the 3.8.3 release.
|
168
|
+
expect(JSON.dump(:value => Test::EnumTestType::ONE)).to eq(%({"value":1}))
|
167
169
|
end
|
168
170
|
end
|
169
171
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BJ Neilsen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-06-
|
14
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|