Commit a0415a7
committed
Remove Fixnum references to support modern Ruby versions
Fixnum type has been deprecated since Ruby 2.4 and removed in Ruby 3.0,
which makes BaseProtocol incompatible with modern Ruby versions.
This change removes the Fixnum reference, as well as a monkey-patch that
introduces Fixnum#ord() to Ruby versions below 1.8.7.
**This change essentially makes it officially required to use Ruby 2.4 or newer.**
Fixes the following test failures:
1) BaseProtocol Thrift::BaseProtocol should write out the different types (deprecated write_type signature)
Failure/Error: if field_info.is_a? Fixnum
NameError:
uninitialized constant Thrift::BaseProtocol::Fixnum
# ./lib/thrift/protocol/base_protocol.rb:256:in 'Thrift::BaseProtocol#write_type'
# ./spec/base_protocol_spec.rb:65:in 'block (3 levels) in <top (required)>'
2) BaseProtocol Thrift::BaseProtocol should write out the different types
Failure/Error: if field_info.is_a? Fixnum
NameError:
uninitialized constant Thrift::BaseProtocol::Fixnum
# ./lib/thrift/protocol/base_protocol.rb:256:in 'Thrift::BaseProtocol#write_type'
# ./spec/base_protocol_spec.rb:90:in 'block (3 levels) in <top (required)>'
3) BaseProtocol Thrift::BaseProtocol should read the different types (deprecated read_type signature)
Failure/Error: if field_info.is_a? Fixnum
NameError:
uninitialized constant Thrift::BaseProtocol::Fixnum
# ./lib/thrift/protocol/base_protocol.rb:296:in 'Thrift::BaseProtocol#read_type'
# ./spec/base_protocol_spec.rb:113:in 'block (3 levels) in <top (required)>'
4) BaseProtocol Thrift::BaseProtocol should read the different types
Failure/Error: if field_info.is_a? Fixnum
NameError:
uninitialized constant Thrift::BaseProtocol::Fixnum
# ./lib/thrift/protocol/base_protocol.rb:296:in 'Thrift::BaseProtocol#read_type'
# ./spec/base_protocol_spec.rb:136:in 'block (3 levels) in <top (required)>'1 parent 10d5a65 commit a0415a7
File tree
10 files changed
+14
-65
lines changed- lib/rb
- lib
- thrift
- core_ext
- protocol
- transport
- spec
- test/rb/integration
10 files changed
+14
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
0 commit comments