oj 1.2.7 → 1.2.8

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.

data/README.md CHANGED
@@ -24,13 +24,11 @@ A fast JSON parser and Object marshaller as a Ruby gem.
24
24
 
25
25
  ## <a name="release">Release Notes</a>
26
26
 
27
- ### Release 1.2.7
27
+ ### Release 1.2.8
28
28
 
29
- - Fixed bug where a float with too many characters would generate an error. It is not parsed as accuractly as Ruby will support.
29
+ - Included a contribution by nevans to fix a math.h issue with an old fedora linux machine.
30
30
 
31
- - Cleaned up documentation errors.
32
-
33
- - Added support for OS X Ruby 1.8.7.
31
+ - Included a fix to the documentation found by mat.
34
32
 
35
33
  ## <a name="description">Description</a>
36
34
 
@@ -40,7 +38,7 @@ other the common Ruby JSON parsers. So far is has achieved that at about 2
40
38
  time faster than Yajl for parsing and 3 or more times faster writing JSON.
41
39
 
42
40
  Oj has several dump or serialization modes which control how Objects are
43
- converted to JSON. These modes are set with the :effort option in either the
41
+ converted to JSON. These modes are set with the :mode option in either the
44
42
  default options or as one of the options to the dump() method.
45
43
 
46
44
  - :strict mode will only allow the 7 basic JSON types to be serialized. Any other Object
@@ -16,12 +16,13 @@ dflags = {
16
16
  'RUBY_VERSION_MAJOR' => version[0],
17
17
  'RUBY_VERSION_MINOR' => version[1],
18
18
  'RUBY_VERSION_MICRO' => version[2],
19
- 'HAS_RB_TIME_TIMESPEC' => ('ruby' == type && '1.9.3' == RUBY_VERSION) ? 1 : 0,
20
- 'HAS_ENCODING_SUPPORT' => (('ruby' == type || 'rubinius' == type) && '1' == version[0] && '9' == version[1]) ? 1 : 0,
21
- 'HAS_NANO_TIME' => ('ruby' == type && '1' == version[0] && '9' == version[1]) ? 1 : 0,
19
+ 'HAS_RB_TIME_TIMESPEC' => ('ruby' == type && ('1.9.3' == RUBY_VERSION || '2' <= version[0])) ? 1 : 0,
20
+ 'HAS_ENCODING_SUPPORT' => (('ruby' == type || 'rubinius' == type) &&
21
+ (('1' == version[0] && '9' == version[1]) || '2' <= version[0])) ? 1 : 0,
22
+ 'HAS_NANO_TIME' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
22
23
  'HAS_RSTRUCT' => ('ruby' == type || 'ree' == type) ? 1 : 0,
23
- 'HAS_IVAR_HELPERS' => ('ruby' == type && '1' == version[0] && '9' == version[1] && '2' <= version[2]) ? 1 : 0,
24
- 'HAS_PROC_WITH_BLOCK' => ('ruby' == type && '1' == version[0] && '9' == version[1]) ? 1 : 0,
24
+ 'HAS_IVAR_HELPERS' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
25
+ 'HAS_PROC_WITH_BLOCK' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
25
26
  'HAS_TOP_LEVEL_ST_H' => ('ree' == type || ('ruby' == type && '1' == version[0] && '8' == version[1])) ? 1 : 0,
26
27
  }
27
28
  # This is a monster hack to get around issues with 1.9.3-p0 on CentOS 5.4. SO
@@ -33,6 +33,11 @@
33
33
  #include <string.h>
34
34
  #include <math.h>
35
35
 
36
+ //Workaround:
37
+ #ifndef INFINITY
38
+ #define INFINITY (1.0/0.0)
39
+ #endif
40
+
36
41
  #include "oj.h"
37
42
 
38
43
  enum {
@@ -727,6 +727,9 @@ define_mimic_json(VALUE self) {
727
727
  VALUE ext;
728
728
  VALUE dummy;
729
729
 
730
+ if (rb_const_defined_at(rb_cObject, rb_intern("JSON"))) {
731
+ rb_raise(rb_eTypeError, "JSON module already exists. Can not mimic. Do not require 'json' before calling mimic_JSON.");
732
+ }
730
733
  mimic = rb_define_module("JSON");
731
734
  ext = rb_define_module_under(mimic, "Ext");
732
735
  dummy = rb_define_class_under(ext, "Parser", rb_cObject);
data/lib/oj.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # optimized JSON handling.
3
3
  #
4
4
  # Oj has several dump or serialization modes which control how Objects are
5
- # converted to JSON. These modes are set with the :effort option in either the
5
+ # converted to JSON. These modes are set with the :mode option in either the
6
6
  # default options or as one of the options to the dump() method.
7
7
  #
8
8
  # - :strict mode will only allow the 7 basic JSON types to be serialized. Any other Object
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '1.2.7'
4
+ VERSION = '1.2.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-22 00:00:00.000000000 Z
12
+ date: 2012-05-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'The fastest JSON parser and object serializer. '
15
15
  email: peter@ohler.com
@@ -83,9 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project: oj
86
- rubygems_version: 1.8.11
86
+ rubygems_version: 1.8.23
87
87
  signing_key:
88
88
  specification_version: 3
89
89
  summary: A fast JSON parser and serializer.
90
90
  test_files: []
91
- has_rdoc: true