protobuf 3.8.5.pre0 → 3.8.5

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: 36aed181d6bcd717ec7f3225b5aa6863b885834e928fb884fa078dc4227623e7
4
- data.tar.gz: 9ec49612c7de625f50acaba9edcd3d912f5e81ba413d895f8176b1f1f98e6258
3
+ metadata.gz: 4a2d88c4a85786eaf517ad597ebfb70b91f1569bbef3e6f84dbae3c133faafb5
4
+ data.tar.gz: cf7ff4963a35ce8d0cf3c8f67320aa8cbc05387f04c378d1d28b3dac49126978
5
5
  SHA512:
6
- metadata.gz: 4851081c3d661dbb4fcdff2bd65435024297b83613dc55ac18f512ad5f25d25d449abdb07f2f2c15213d5b9250cd8c77c3143888c9fecc6540af95d5597fa369
7
- data.tar.gz: 529044b03838d84adfb4cbe10935dea8da89f8f56968a2f117d87f58ff24964dfb548b576a77593ebe0f3dd48b3b4c7197903e9f4da4281c521a70be70f3700d
6
+ metadata.gz: 40d09f68f221fc5d8793904dad243dbcfc7396c8c6618f09c5cceada2f1507aa20042f6fb27c7fa0871c4bfffd7ed03f8e01ade0e0cf5fb7af95279b20b526b5
7
+ data.tar.gz: 4aa8f7c8cb11ad68333d451fae4b1fd85bd9e62a928159491e868ada2be9a30436747a9842f8dffff799026a5480f1da465b915a9fa9dfd50c33a9513a8e98a5
@@ -259,6 +259,20 @@ module Protobuf
259
259
  super(tag)
260
260
  end
261
261
 
262
+ # Custom equality method since otherwise identical values from different
263
+ # enums will be considered equal by Integer's equality method (or
264
+ # Fixnum's on Ruby < 2.4.0).
265
+ #
266
+ def ==(other)
267
+ if other.is_a?(Protobuf::Enum)
268
+ parent_class == other.parent_class && tag == other.tag
269
+ elsif tag.class == other.class
270
+ tag == other
271
+ else
272
+ false
273
+ end
274
+ end
275
+
262
276
  # Overriding the class so ActiveRecord/Arel visitor will visit the enum as an
263
277
  # Integer.
264
278
  #
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.8.5.pre0' # rubocop:disable Style/MutableConstant
2
+ VERSION = '3.8.5' # rubocop:disable Style/MutableConstant
3
3
  end
@@ -21,6 +21,20 @@ RSpec.describe Protobuf::Enum do
21
21
  end
22
22
  end
23
23
 
24
+ describe '.==' do
25
+ it 'is true for identical values' do
26
+ expect(Test::EnumTestType::THREE).to eq(Test::EnumTestType::THREE)
27
+ end
28
+
29
+ it 'is false for different values in the same enum' do
30
+ expect(Test::EnumTestType::TWO).to_not eq(Test::EnumTestType::THREE)
31
+ end
32
+
33
+ it 'is false for values from different enums' do
34
+ expect(Test::EnumTestType::THREE).to_not eq(Test::AliasedEnum::THREE)
35
+ end
36
+ end
37
+
24
38
  describe '.aliases_allowed?' do
25
39
  it 'is false when the option is not set' do
26
40
  expect(Test::EnumTestType.aliases_allowed?).to be false
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.5.pre0
4
+ version: 3.8.5
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-11-09 00:00:00.000000000 Z
14
+ date: 2018-11-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -463,12 +463,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
463
463
  version: '0'
464
464
  required_rubygems_version: !ruby/object:Gem::Requirement
465
465
  requirements:
466
- - - ">"
466
+ - - ">="
467
467
  - !ruby/object:Gem::Version
468
- version: 1.3.1
468
+ version: '0'
469
469
  requirements: []
470
470
  rubyforge_project:
471
- rubygems_version: 2.7.6
471
+ rubygems_version: 2.7.8
472
472
  signing_key:
473
473
  specification_version: 4
474
474
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.