upfluence-thrift 2.7.7 → 2.7.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e31952e8e892fc4b82c5a19ac4145bf6c8d439474b83b8162119a11cedc5b0d
4
- data.tar.gz: '049b17f3c6bba2b2ce85aff58417785465614992435667036fcda62bf4f43fa9'
3
+ metadata.gz: e1ad8a5f11304e43fab021263148da53661940e25c9d233d4c311a75823d0efa
4
+ data.tar.gz: e0c681d79a74693ce3b588cec1030a2efa6f5e4a3c0fd966df37c444d521695f
5
5
  SHA512:
6
- metadata.gz: b5a53855250a59549aaab99463b1fd8512c9d2379f6dfbee1407357f3270b8717ed009319923a64d023402ff50c01d7d62fb413c064d9e31cf94656529555f83
7
- data.tar.gz: 98d79404c6044387670b06ceef345acdfa70d618d645da24d02b1ff191eef1cdf8a22723ce06b13de8a4b59653a9a6daec6b4639fb5b538ad283229458743887
6
+ metadata.gz: 460a10b66ea3a48f207e5fdb7c869f1b76a25fa719450d2032ef9ef2694fb2313ed882df85e2378c96086253c2a7cc8a8ea199c30a77f30d13f288236b2681ce
7
+ data.tar.gz: 36772ab77d63f4085c068d88b0b6825daf2bf9c8cfeeea11336d892d3c82a8038b5f432349f8e00f0e9760bcefe4366dbd4f24062ab7fe78492346b05f8e45f5
data/ext/struct.c CHANGED
@@ -676,8 +676,9 @@ static VALUE rb_thrift_union_write(VALUE self, VALUE protocol) {
676
676
 
677
677
  VALUE ttype_value = rb_hash_aref(field_info, type_sym);
678
678
  int ttype = FIX2INT(ttype_value);
679
+ VALUE field_name = rb_hash_aref(field_info, name_sym);
679
680
 
680
- default_write_field_begin(protocol, setfield, ttype_value, field_id);
681
+ default_write_field_begin(protocol, field_name, ttype_value, field_id);
681
682
 
682
683
  write_anything(ttype, setvalue, protocol, field_info);
683
684
 
data/lib/thrift/union.rb CHANGED
@@ -75,11 +75,11 @@ module Thrift
75
75
  field_info = struct_fields[fid]
76
76
  type = field_info[:type]
77
77
  if is_container? type
78
- oprot.write_field_begin(@setfield, type, fid)
78
+ oprot.write_field_begin(field_info[:name], type, fid)
79
79
  write_container(oprot, @value, field_info)
80
80
  oprot.write_field_end
81
81
  else
82
- oprot.write_field(@setfield, type, fid, @value)
82
+ oprot.write_field(field_info[:name], type, fid, @value)
83
83
  end
84
84
 
85
85
  oprot.write_field_stop
@@ -33,6 +33,18 @@ describe 'JsonProtocol' do
33
33
  @trans.read(@trans.available).should == '{"greeting":"hello world"}'
34
34
  end
35
35
 
36
+ it 'should pretty print union' do
37
+ SpecNamespace::My_union.new(:integer32, 25).write(@prot)
38
+
39
+ @trans.read(@trans.available).should == '{"integer32":25}'
40
+ end
41
+
42
+ it 'should pretty print union with a container field' do
43
+ SpecNamespace::My_union.new(:my_map, { SpecNamespace::SomeEnum::ONE => [] }).write(@prot)
44
+
45
+ @trans.read(@trans.available).should == '{"my_map":{"0":[]}}'
46
+ end
47
+
36
48
  it 'shound not be able to read message' do
37
49
  @trans.write('{"greeting":"hello world"}')
38
50
  expect {@prot.read_message_begin}.to raise_error(Thrift::ProtocolException)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upfluence-thrift
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.7
4
+ version: 2.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thrift Developers
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-08-13 00:00:00.000000000 Z
10
+ date: 2026-09-15 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rspec