sparsam 0.2.1 → 0.2.2
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/ext/serializer.cpp +3 -3
- data/spec/sparsam_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80bcbb2225d5e0f24f9a295afd99be378fca3fcc
|
4
|
+
data.tar.gz: cdfd6e2214719008a2482693bcf60ca662a22609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41eff67315ab200edfab3501d6997136fd1a0642e0b1cbe0a46e47e5bccd0f3a4926ffb2ed6a04f97e757736058e0c76d6dc875a7a7bbb58c132c9665d06cef0
|
7
|
+
data.tar.gz: a7d5aef8bd988ec4535f54c7dbd73f3352742ed2574e5cb1c79b51508a2529201121adb9d15726a9508347c458d80142e643b50a8fadc29a16881895849cad86
|
data/ext/serializer.cpp
CHANGED
@@ -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
|
|
data/spec/sparsam_spec.rb
CHANGED
@@ -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.
|
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.
|
164
|
+
rubygems_version: 2.6.11
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Ruby bindings for Apache Thrift
|