protobuf 3.8.3 → 3.8.4

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: c906a5d207f967c1bf49df971175e6e3f702be223e5a28eee2995bfe79f23d5e
4
- data.tar.gz: c8a1b8ab9e6a8fc8bb2442d1c76cd7f926c8b1a4517e19d6933694779acc752f
3
+ metadata.gz: ed05b202c2cfac393096533ca5980e215ed2698043f44e5f1820ea3445ffe8d4
4
+ data.tar.gz: ae0de25bd7bcbe52aaef1df049263f6e64e65702e55e66347aceba9a0b8cca94
5
5
  SHA512:
6
- metadata.gz: db8270d6a319265c66d79d735d477f8079eb1bf13147dc8a8e907b6be3e01bddb987249a2ecbd3e0985c47faf66344eb6b710e593c892ce9aa216f8b87496a5a
7
- data.tar.gz: f40a2fdfff2fe27bb602873785699020f0567fb60fb9cdbfdf88002461e513789e624c644d67cc59d1c80ed4d9c76a76854fdd05e527640265bc3f8bef09f750
6
+ metadata.gz: a14ef672b0099a05ddd9cd7c823a2da550137fe47aae47decbfa136a032bfee1400cd755ee71739d2572dd94eea55617c8169bea373cbc0c57e2c5c7b0e5b320
7
+ data.tar.gz: 2afb6adf6d555daa7da85b09da51723a6da78da680804091a8047c771b0641184bade5d147fee154d92e390b47da964ffea840927bab27bebda2ec3cd3fbaf94
@@ -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
- # render Protobuf enums correctly because to_json is not defined.
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
- to_i
291
+ def to_json(*)
292
+ to_s
292
293
  end
293
294
 
294
295
  def to_s(format = :tag)
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.8.3' # rubocop:disable Style/MutableConstant
2
+ VERSION = '3.8.4' # rubocop:disable Style/MutableConstant
3
3
  end
@@ -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.3
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-08 00:00:00.000000000 Z
14
+ date: 2018-06-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport