protobuf 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: 9f6c3acaf286282c387182a22e85ed017b07689e
4
- data.tar.gz: dfbd232feef940d2fe05f7c2985437c853c2b4c0
3
+ metadata.gz: a25179bb7b98c63e8ef320ebbed6b649244897af
4
+ data.tar.gz: 3df0b7a26092c7e5ac79c75893ec965f4fefd150
5
5
  SHA512:
6
- metadata.gz: 4016076f1cb790f97ac9587cc94785fd896e6c9487a3f5a6ab38548648eb9388a90ad76d00dc94b1bee02691b384d98e8dbd16561b559d66311ded536a5afa3f
7
- data.tar.gz: be1ec665261e4673fef18d6880719cfa7e629cc9ba628fd49527f720b0774cd11012cae1620b2f40ad3601aeedf7efc601b97331fe34016fb749b691922a558a
6
+ metadata.gz: 876507d1ac360749d4cb83c029ecf14632c0a452ce8005e8503f33a1f44d65bf1f6a690566e5d3eb4a2411b1450141200c61109e94dee9a56c18f87b83a1d583
7
+ data.tar.gz: 0b83772263222d04aadaf02f1ef82d3cfaf5363fb45e30615b791cce632beb43ab1c6be5124c3d78ff18083a29032965a96b1b3af31278b3da2830f7a66464d8
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Stable (3.x)
2
2
 
3
+ 3.0.3
4
+ ---------
5
+
6
+ - Fix recursive memory/cpu growth issue when calling class-level `Message.to_json`. [#190]
7
+
3
8
  3.0.2
4
9
  ---------
5
10
 
@@ -14,9 +14,18 @@ module Protobuf
14
14
  extend ::Protobuf::Message::Fields
15
15
  include ::Protobuf::Message::Serialization
16
16
 
17
+ ##
18
+ # Class Methods
19
+ #
20
+
21
+ def self.to_json
22
+ name
23
+ end
24
+
17
25
  ##
18
26
  # Constructor
19
27
  #
28
+
20
29
  def initialize(fields = {})
21
30
  @values = {}
22
31
 
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.0.2'
2
+ VERSION = '3.0.3'
3
3
  end
@@ -289,6 +289,16 @@ describe Protobuf::Message do
289
289
  its(:to_json) { should eq '{"name":"Test Name","active":false}' }
290
290
  end
291
291
 
292
+ describe '.to_json' do
293
+ it 'returns the class name of the message for use in json encoding' do
294
+ expect {
295
+ ::Timeout.timeout(0.1) do
296
+ expect(::Test::Resource.to_json).to eq("Test::Resource")
297
+ end
298
+ }.not_to raise_error
299
+ end
300
+ end
301
+
292
302
  describe "#define_setter" do
293
303
  subject { ::Test::Resource.new }
294
304
 
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.0.2
4
+ version: 3.0.3
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: 2014-03-04 00:00:00.000000000 Z
14
+ date: 2014-03-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport