oj 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of oj might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/ext/oj/dump.c +4 -7
- data/ext/oj/load.c +4 -6
- data/ext/oj/saj.c +4 -6
- data/lib/oj/version.rb +1 -1
- data/test/test_saj.rb +1 -3
- 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: 1d381fbfd7fb7f6a4db7b5a0352dc56e247ff558
|
4
|
+
data.tar.gz: f4bc74121936f923cc619bf6bc8a266489eb16e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1635008e3c52a9b9ed5cbe3b926acac6f5391fa0d894d93d68f1d0dcec5e0904e1cd216ec072eca857ae33d8df3fd32fd4068102626ec87bd724c3cfc9302fc
|
7
|
+
data.tar.gz: 68c45999557700cd5e65cf4c55d4d0da0fa227bc8c5c0c838b6430cc37cb2475d3f2f3a548c4abb9b23130cc44bb9f918a1ee6a8b957133ee072eaab36254be0
|
data/README.md
CHANGED
@@ -32,6 +32,10 @@ A fast JSON parser and Object marshaller as a Ruby gem.
|
|
32
32
|
|
33
33
|
## <a name="release">Release Notes</a>
|
34
34
|
|
35
|
+
### Release 2.0.9
|
36
|
+
|
37
|
+
- Fixed problem with INFINITY with CentOS and Ruby 2.0.0. There are some header file conflicts so a different INFINITY was used.
|
38
|
+
|
35
39
|
### Release 2.0.8
|
36
40
|
|
37
41
|
- Added :bigdecimal_load option that forces all decimals in a JSON string to be read as BigDecimals instead of as
|
@@ -43,11 +47,6 @@ A fast JSON parser and Object marshaller as a Ruby gem.
|
|
43
47
|
|
44
48
|
- All tests pass with Ruby 2.0.0-p0. Had to modify Exception encoding slightly.
|
45
49
|
|
46
|
-
### Release 2.0.7
|
47
|
-
|
48
|
-
- Fixed bug where undefined classes specified in a JSON document would freeze Ruby instead of raising an exception when
|
49
|
-
the auto_define option was not set. (It seems that Ruby freezes on trying to add variables to nil.)
|
50
|
-
|
51
50
|
## <a name="description">Description</a>
|
52
51
|
|
53
52
|
Optimized JSON (Oj), as the name implies was written to provide speed
|
data/ext/oj/dump.c
CHANGED
@@ -45,11 +45,8 @@
|
|
45
45
|
#define rb_eEncodingError rb_eException
|
46
46
|
#endif
|
47
47
|
|
48
|
-
//Workaround
|
49
|
-
#
|
50
|
-
#define INFINITY (1.0/0.0)
|
51
|
-
#endif
|
52
|
-
|
48
|
+
// Workaround in case INFINITY is not defined in math.h or if the OS is CentOS
|
49
|
+
#define OJ_INFINITY (1.0/0.0)
|
53
50
|
|
54
51
|
typedef unsigned long ulong;
|
55
52
|
|
@@ -431,10 +428,10 @@ dump_float(VALUE obj, Out out) {
|
|
431
428
|
*b++ = '0';
|
432
429
|
*b++ = '\0';
|
433
430
|
cnt = 3;
|
434
|
-
} else if (
|
431
|
+
} else if (OJ_INFINITY == d) {
|
435
432
|
strcpy(buf, "Infinity");
|
436
433
|
cnt = 8;
|
437
|
-
} else if (-
|
434
|
+
} else if (-OJ_INFINITY == d) {
|
438
435
|
strcpy(buf, "-Infinity");
|
439
436
|
cnt = 9;
|
440
437
|
} else if (d == (double)(long long int)d) {
|
data/ext/oj/load.c
CHANGED
@@ -39,10 +39,8 @@
|
|
39
39
|
#include <string.h>
|
40
40
|
#include <math.h>
|
41
41
|
|
42
|
-
//Workaround
|
43
|
-
#
|
44
|
-
#define INFINITY (1.0/0.0)
|
45
|
-
#endif
|
42
|
+
// Workaround in case INFINITY is not defined in math.h or if the OS is CentOS
|
43
|
+
#define OJ_INFINITY (1.0/0.0)
|
46
44
|
|
47
45
|
#include "oj.h"
|
48
46
|
|
@@ -753,9 +751,9 @@ read_num(ParseInfo pi) {
|
|
753
751
|
return num;
|
754
752
|
} else {
|
755
753
|
if (neg) {
|
756
|
-
return rb_float_new(-
|
754
|
+
return rb_float_new(-OJ_INFINITY);
|
757
755
|
} else {
|
758
|
-
return rb_float_new(
|
756
|
+
return rb_float_new(OJ_INFINITY);
|
759
757
|
}
|
760
758
|
}
|
761
759
|
}
|
data/ext/oj/saj.c
CHANGED
@@ -36,10 +36,8 @@
|
|
36
36
|
#include <string.h>
|
37
37
|
#include <math.h>
|
38
38
|
|
39
|
-
|
40
|
-
#
|
41
|
-
#define INFINITY (1.0/0.0)
|
42
|
-
#endif
|
39
|
+
// Workaround in case INFINITY is not defined in math.h or if the OS is CentOS
|
40
|
+
#define OJ_INFINITY (1.0/0.0)
|
43
41
|
|
44
42
|
#include "oj.h"
|
45
43
|
|
@@ -384,11 +382,11 @@ read_num(ParseInfo pi, const char *key) {
|
|
384
382
|
pi->s += 8;
|
385
383
|
if (neg) {
|
386
384
|
if (pi->has_add_value) {
|
387
|
-
call_add_value(pi->handler, rb_float_new(-
|
385
|
+
call_add_value(pi->handler, rb_float_new(-OJ_INFINITY), key);
|
388
386
|
}
|
389
387
|
} else {
|
390
388
|
if (pi->has_add_value) {
|
391
|
-
call_add_value(pi->handler, rb_float_new(
|
389
|
+
call_add_value(pi->handler, rb_float_new(OJ_INFINITY), key);
|
392
390
|
}
|
393
391
|
}
|
394
392
|
return;
|
data/lib/oj/version.rb
CHANGED
data/test/test_saj.rb
CHANGED
@@ -178,9 +178,7 @@ class SajTest < ::Test::Unit::TestCase
|
|
178
178
|
json = %{12345xyz}
|
179
179
|
Oj.saj_parse(handler, json)
|
180
180
|
assert_equal([[:add_value, 12345, nil],
|
181
|
-
[:error, "invalid format, extra characters at line 1, column 6 [saj.c:
|
181
|
+
[:error, "invalid format, extra characters at line 1, column 6 [saj.c:714]", 1, 6]], handler.calls)
|
182
182
|
end
|
183
183
|
|
184
184
|
end
|
185
|
-
|
186
|
-
|
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: 2.0.
|
4
|
+
version: 2.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'The fastest JSON parser and object serializer. '
|
14
14
|
email: peter@ohler.com
|