oj 3.13.20 → 3.13.21

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: 958a558e09c25d5de9548af67dff6586686def4a9073b3cee6ba8403930eda48
4
- data.tar.gz: 2f928e9e849ca695d03ad9a396ec7f2df3508b99d10baa11a8cb538a7b3a0e52
3
+ metadata.gz: ca812104ece12895a17969eea5c870837070875b8c59917220adea228f24cab2
4
+ data.tar.gz: c46bd5d0d161b9e8e0337daf5af42f9fcc37ec41401a2d9fb3c5416e2ce2fccc
5
5
  SHA512:
6
- metadata.gz: 758bb300ed853d161750d100a8fbdd755e37ae8e15ae94f1e7a4cbd613c787002758d4fc5834fd47a7ef8fb78446208f896afee31c0bc023bcdeb381aba1f98c
7
- data.tar.gz: 54127873544ca146a61d7ca4012ff9d2eb4b83bdcbb3f06eea092d4e4ad517c453196a59edc2743b42736ab276e0eb96889045e0d3f2200dcbaf4a2b79353db3
6
+ metadata.gz: 860134683a2d535fc9dfd17eb6ad369855ede35c0474dd386d9a8a3fb80e1a5d9cf2133d04c6ebea84d65ad127b62a2e83adf4f5166db8cbdf0dadf50f9d3984
7
+ data.tar.gz: cac281da136cf4a336245105eb847ec369e36b09ec8f48e80e3e48bacd0aacc6052d88b1cdca3a912f82f329444fa6c74e02e3ee5f9c56b6002afafbd65611ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.13.21 - 2022-08-19
4
+
5
+ - Bug parsing big numbers fixed in the SAJ parser.
6
+
3
7
  ## 3.13.20 - 2022-08-07
4
8
 
5
9
  - SSE4 made optional with a `--with-sse42` flag to the compile.
data/ext/oj/saj2.c CHANGED
@@ -315,7 +315,7 @@ static void add_big_key(ojParser p) {
315
315
  }
316
316
 
317
317
  static void add_big_key_loc(ojParser p) {
318
- rb_funcall((VALUE)p->ctx,
318
+ rb_funcall(((Delegate)p->ctx)->handler,
319
319
  oj_add_value_id,
320
320
  4,
321
321
  rb_funcall(rb_cObject, oj_bigdecimal_id, 1, rb_str_new(buf_str(&p->buf), buf_len(&p->buf))),
data/lib/oj/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '3.13.20'
4
+ VERSION = '3.13.21'
5
5
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Ruby**
4
4
 
5
- Oj is compatible with Ruby 2.0.0, 2.1, 2.2, 2.3, 2.4 and RBX.
5
+ Oj is compatible with Ruby 2.4+ and RBX.
6
6
  Support for JRuby has been removed as JRuby no longer supports C extensions and
7
7
  there are bugs in the older versions that are not being fixed.
8
8
 
@@ -160,6 +160,32 @@ class SajTest < Minitest::Test
160
160
  assert_equal(-118999, (handler.calls[0][1] * 10000).to_i)
161
161
  end
162
162
 
163
+ def test_bignum_loc
164
+ handler = LocSaj.new()
165
+ json = <<~JSON
166
+ {
167
+ "width": 192.33800000000002,
168
+ "xaxis": {
169
+ "anchor": "y"
170
+ }
171
+ }
172
+ JSON
173
+
174
+ p = Oj::Parser.new(:saj)
175
+ p.handler = handler
176
+ p.parse(json)
177
+ assert_equal(6, handler.calls.size)
178
+ assert_equal(1_923_380, (handler.calls[1][1] * 10000).to_i)
179
+ handler.calls[1][1] = 1_923_380
180
+ assert_equal([[:hash_start, nil, 1, 1],
181
+ [:add_value, 1923380, 'width', 2, 30],
182
+ [:hash_start, 'xaxis', 3, 12],
183
+ [:add_value, 'y', 'anchor', 4, 17],
184
+ [:hash_end, 'xaxis', 5, 3],
185
+ [:hash_end, nil, 6, 1]],
186
+ handler.calls)
187
+ end
188
+
163
189
  def test_array_empty
164
190
  handler = AllSaj.new()
165
191
  json = %{[]}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.20
4
+ version: 3.13.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-07 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler