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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 177a1133df5753c9fd378e44bcf2647c91f2cccf
4
- data.tar.gz: d272392dbc1711664cb0aa7127a132ae46e76362
3
+ metadata.gz: 1d381fbfd7fb7f6a4db7b5a0352dc56e247ff558
4
+ data.tar.gz: f4bc74121936f923cc619bf6bc8a266489eb16e1
5
5
  SHA512:
6
- metadata.gz: 5fbd4a3a406b90741f32a2b326035ebbcae1b92183bca17f2a3bf98b54bf14ea225e8c62139de84607a5505beb2e7d1450b1da91bd76d1d743d4aff52cef4ee5
7
- data.tar.gz: 907088bc2d7a21f2624d23a317a21deeee6adb1bcf070d904652be25a103d4ad8a6952d2e458ec30666aaf1ccff05608845cc64a9076a6c812dfc0450a6569cc
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
@@ -45,11 +45,8 @@
45
45
  #define rb_eEncodingError rb_eException
46
46
  #endif
47
47
 
48
- //Workaround:
49
- #ifndef INFINITY
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 (INFINITY == d) {
431
+ } else if (OJ_INFINITY == d) {
435
432
  strcpy(buf, "Infinity");
436
433
  cnt = 8;
437
- } else if (-INFINITY == d) {
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) {
@@ -39,10 +39,8 @@
39
39
  #include <string.h>
40
40
  #include <math.h>
41
41
 
42
- //Workaround:
43
- #ifndef INFINITY
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(-INFINITY);
754
+ return rb_float_new(-OJ_INFINITY);
757
755
  } else {
758
- return rb_float_new(INFINITY);
756
+ return rb_float_new(OJ_INFINITY);
759
757
  }
760
758
  }
761
759
  }
@@ -36,10 +36,8 @@
36
36
  #include <string.h>
37
37
  #include <math.h>
38
38
 
39
- /* Workaround: */
40
- #ifndef INFINITY
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(-INFINITY), key);
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(INFINITY), key);
389
+ call_add_value(pi->handler, rb_float_new(OJ_INFINITY), key);
392
390
  }
393
391
  }
394
392
  return;
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.0.8'
4
+ VERSION = '2.0.9'
5
5
  end
@@ -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:716]", 1, 6]], handler.calls)
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.8
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-01 00:00:00.000000000 Z
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