sparsam 0.2.1 → 0.2.2

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: 321b7965fbbc375a4cc91aa22881aa516674353f
4
- data.tar.gz: 4fca4a60305a3ad495f80e8a5280c13541ece0dc
3
+ metadata.gz: 80bcbb2225d5e0f24f9a295afd99be378fca3fcc
4
+ data.tar.gz: cdfd6e2214719008a2482693bcf60ca662a22609
5
5
  SHA512:
6
- metadata.gz: f2395063ac5bcecdcbd9764006318f08c859344b366b0df8808ef369dacc094bdc1e2c81b5d6506adeb49f645810889d61c589cf4ddd1586f9d7691cbc0c128b
7
- data.tar.gz: a9964ead299058bdd1667a2389da48f0c14d5a60ab0e66fbd357ec8d3e193b02cda5f89752b12f7533359defb88c99045852fb4f1842baa373f7bbb541e5caf9
6
+ metadata.gz: 41eff67315ab200edfab3501d6997136fd1a0642e0b1cbe0a46e47e5bccd0f3a4926ffb2ed6a04f97e757736058e0c76d6dc875a7a7bbb58c132c9665d06cef0
7
+ data.tar.gz: a7d5aef8bd988ec4535f54c7dbd73f3352742ed2574e5cb1c79b51508a2529201121adb9d15726a9508347c458d80142e643b50a8fadc29a16881895849cad86
@@ -518,7 +518,7 @@ void ThriftSerializer::writeAny(TType ttype, FieldInfo *field_info,
518
518
  }
519
519
 
520
520
  case protocol::T_SET: {
521
- if (CLASS_OF(actual) != SetClass) {
521
+ if (rb_class_real(CLASS_OF(actual)) != SetClass) {
522
522
  raise_type_mismatch(outer_struct, field_sym);
523
523
  }
524
524
 
@@ -553,7 +553,7 @@ void ThriftSerializer::writeAny(TType ttype, FieldInfo *field_info,
553
553
  }
554
554
 
555
555
  case protocol::T_STRUCT: {
556
- if (CLASS_OF(actual) != field_info->klass) {
556
+ if (rb_class_real(CLASS_OF(actual)) != field_info->klass) {
557
557
  raise_type_mismatch(outer_struct, field_sym);
558
558
  }
559
559
 
@@ -616,7 +616,7 @@ void ThriftSerializer::writeStruct(VALUE klass, VALUE data) {
616
616
  VALUE serializer_writeStruct(VALUE self, VALUE klass, VALUE data) {
617
617
  watch_for_texcept() get_ts();
618
618
 
619
- if (CLASS_OF(data) != klass) {
619
+ if (rb_class_real(CLASS_OF(data)) != klass) {
620
620
  VALUE expected_name = rb_class_name(klass);
621
621
  VALUE actual_name = rb_class_name(CLASS_OF(data));
622
622
 
@@ -442,5 +442,23 @@ describe 'Sparsam' do
442
442
  end
443
443
  end
444
444
  end
445
+
446
+ it 'handles structs with modified eigenclasses' do
447
+ nested_struct = US.new
448
+
449
+ class << nested_struct
450
+ def foo
451
+ end
452
+ end
453
+
454
+ data = SS.new(us_i: nested_struct)
455
+
456
+ class << data
457
+ def foo
458
+ end
459
+ end
460
+
461
+ expect { data.serialize }.not_to raise_error
462
+ end
445
463
  end
446
464
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparsam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbnb Thrift Developers
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project: thrift
164
- rubygems_version: 2.6.12
164
+ rubygems_version: 2.6.11
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: Ruby bindings for Apache Thrift