oj 2.12.4 → 2.12.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ext/oj/dump.c +30 -9
- data/lib/oj/version.rb +1 -1
- 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: e34ba8c73f9262974880d2fcf2be2b7d541b636b
|
4
|
+
data.tar.gz: 11828007a4ddd9c8817e0039e86ff7c8e555a0d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f5d1cc476dded1921261dbb4ab1eda551ade35d6f66a97174167fed2b09f05d9c6fa8b1c3a1daa8a6f73238a5b48aad8cd81609aa2c5cf99dd696f71be46ce
|
7
|
+
data.tar.gz: 9e89459bceb129fd3607b938c304ebcd6a7c92fdd1aa055b9cea9086a1cdcfa2768c2015c15128840be049e9dac91c76227d4f3b46a5761339babb397a62f183
|
data/README.md
CHANGED
@@ -26,9 +26,9 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
|
|
26
26
|
|
27
27
|
[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
|
28
28
|
|
29
|
-
##
|
29
|
+
## Release 2.12.5
|
30
30
|
|
31
|
-
-
|
31
|
+
- In :null mode Oj now dumps Infinity and NaN as null.
|
32
32
|
|
33
33
|
[Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
|
34
34
|
|
data/ext/oj/dump.c
CHANGED
@@ -457,23 +457,44 @@ dump_float(VALUE obj, Out out) {
|
|
457
457
|
*b++ = '\0';
|
458
458
|
cnt = 3;
|
459
459
|
} else if (OJ_INFINITY == d) {
|
460
|
-
|
460
|
+
switch (out->opts->mode) {
|
461
|
+
case StrictMode:
|
461
462
|
raise_strict(obj);
|
463
|
+
case NullMode:
|
464
|
+
strcpy(buf, "null");
|
465
|
+
cnt = 4;
|
466
|
+
break;
|
467
|
+
default:
|
468
|
+
strcpy(buf, "Infinity");
|
469
|
+
cnt = 8;
|
470
|
+
break;
|
462
471
|
}
|
463
|
-
strcpy(buf, "Infinity");
|
464
|
-
cnt = 8;
|
465
472
|
} else if (-OJ_INFINITY == d) {
|
466
|
-
|
473
|
+
switch (out->opts->mode) {
|
474
|
+
case StrictMode:
|
467
475
|
raise_strict(obj);
|
476
|
+
case NullMode:
|
477
|
+
strcpy(buf, "null");
|
478
|
+
cnt = 4;
|
479
|
+
break;
|
480
|
+
default:
|
481
|
+
strcpy(buf, "-Infinity");
|
482
|
+
cnt = 9;
|
483
|
+
break;
|
468
484
|
}
|
469
|
-
strcpy(buf, "-Infinity");
|
470
|
-
cnt = 9;
|
471
485
|
} else if (isnan(d)) {
|
472
|
-
|
486
|
+
switch (out->opts->mode) {
|
487
|
+
case StrictMode:
|
473
488
|
raise_strict(obj);
|
489
|
+
case NullMode:
|
490
|
+
strcpy(buf, "null");
|
491
|
+
cnt = 4;
|
492
|
+
break;
|
493
|
+
default:
|
494
|
+
strcpy(buf, "NaN");
|
495
|
+
cnt = 3;
|
496
|
+
break;
|
474
497
|
}
|
475
|
-
strcpy(buf, "NaN");
|
476
|
-
cnt = 3;
|
477
498
|
} else if (d == (double)(long long int)d) {
|
478
499
|
cnt = snprintf(buf, sizeof(buf), "%.1f", d);
|
479
500
|
} else if (0 == out->opts->float_prec) {
|
data/lib/oj/version.rb
CHANGED
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.12.
|
4
|
+
version: 2.12.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|