oj 2.5.4 → 2.5.5
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 +14 -11
- data/ext/oj/oj.c +1 -1
- data/lib/oj.rb +8 -0
- data/lib/oj/saj.rb +1 -1
- data/lib/oj/schandler.rb +1 -1
- data/lib/oj/version.rb +1 -1
- data/test/test_fast.rb +0 -1
- data/test/test_gc.rb +0 -1
- data/test/test_saj.rb +0 -1
- data/test/test_scp.rb +0 -1
- data/test/test_writer.rb +0 -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: 75e4043274574e794d054c174097302ccb304834
|
4
|
+
data.tar.gz: 3088bfa698221df3861f69b262533c5e177c732b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52c90ff21f5800a96ae30c48eb6fd7c3c4fb1c8c4fd643ae614c66ea94095e742651e716b1ffc7e8e818bc9d8522169dd7c6a50d13fca78e32113bc8be31bf38
|
7
|
+
data.tar.gz: 3d2371fcca9ff478b420292b3f6d6b4739dff8e45e25b8daa4a3d396ded515db17d19b87aa8c555c025d5d1f5437d52555379f2c2e9c66fcd535b1ac1cc26847
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Oj gem
|
2
2
|
A fast JSON parser and Object marshaller as a Ruby gem.
|
3
3
|
|
4
|
-
##
|
4
|
+
## Installation
|
5
5
|
gem install oj
|
6
6
|
|
7
|
-
##
|
7
|
+
## Documentation
|
8
8
|
|
9
9
|
*Documentation*: http://www.ohler.com/oj
|
10
10
|
|
11
|
-
##
|
11
|
+
## Source
|
12
12
|
|
13
13
|
*GitHub* *repo*: https://github.com/ohler55/oj
|
14
14
|
|
@@ -16,17 +16,22 @@ A fast JSON parser and Object marshaller as a Ruby gem.
|
|
16
16
|
|
17
17
|
Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announcements and news about the Oj gem.
|
18
18
|
|
19
|
-
##
|
19
|
+
## Build Status
|
20
20
|
|
21
21
|
[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
|
22
22
|
|
23
|
+
### Current Release 2.5.5
|
24
|
+
|
25
|
+
- Worked around the Rubinius failure to load bigdecimal from a require within
|
26
|
+
the C code.
|
27
|
+
|
23
28
|
### Current Release 2.5.4
|
24
29
|
|
25
30
|
- Fixed bug where unterminated JSON did not raise an exception.
|
26
31
|
|
27
32
|
[Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
|
28
33
|
|
29
|
-
##
|
34
|
+
## Description
|
30
35
|
|
31
36
|
Optimized JSON (Oj), as the name implies was written to provide speed optimized
|
32
37
|
JSON handling. It was designed as a faster alternative to Yajl and other the
|
@@ -73,7 +78,7 @@ possible. The API is simple to use but does require a different approach than
|
|
73
78
|
the conventional parse followed by access approach used by conventional JSON
|
74
79
|
parsing.
|
75
80
|
|
76
|
-
##
|
81
|
+
## Proper Use
|
77
82
|
|
78
83
|
Two settings in Oj are useful for parsing but do expose a vunerability if used from an untrusted source. Symbolizing
|
79
84
|
keys can be used to cause memory to be filled up since Ruby does not garbage collect Symbols. The same is true for auto
|
@@ -88,9 +93,7 @@ methods on the Objects created. As in any system, check your inputs before worki
|
|
88
93
|
from a user and evaluating it is never a good idea from an unsecure source. The same is true for Object attributes as
|
89
94
|
they are not more than Strings. Always check inputs from untrusted sources.
|
90
95
|
|
91
|
-
##
|
92
|
-
|
93
|
-
### Simple JSON Writing and Parsing:
|
96
|
+
## Simple JSON Writing and Parsing:
|
94
97
|
|
95
98
|
```ruby
|
96
99
|
require 'oj'
|
@@ -114,7 +117,7 @@ puts "Same? #{h == h2}"
|
|
114
117
|
|
115
118
|
# Links
|
116
119
|
|
117
|
-
##
|
120
|
+
## Performance Comparisons
|
118
121
|
|
119
122
|
[Oj Strict Mode Performance](http://www.ohler.com/dev/oj_misc/performance_strict.html) compares Oj strict mode parser performance to other JSON parsers.
|
120
123
|
|
@@ -124,7 +127,7 @@ puts "Same? #{h == h2}"
|
|
124
127
|
|
125
128
|
[Oj Callback Performance](http://www.ohler.com/dev/oj_misc/performance_callback.html) compares Oj callback parser performance to other JSON parsers.
|
126
129
|
|
127
|
-
##
|
130
|
+
## Links of Interest
|
128
131
|
|
129
132
|
*Fast XML parser and marshaller on RubyGems*: https://rubygems.org/gems/ox
|
130
133
|
|
data/ext/oj/oj.c
CHANGED
@@ -519,7 +519,7 @@ oj_parse_options(VALUE ropts, Options copts) {
|
|
519
519
|
* true, false, or nil. It parses using a mode that is strict in that it maps
|
520
520
|
* each primitive JSON type to a similar Ruby type. The :create_id is not
|
521
521
|
* honored in this mode. Note that a Ruby Hash is used to represent the JSON
|
522
|
-
* Object type. These two are not the same since
|
522
|
+
* Object type. These two are not the same since the JSON Object type can have
|
523
523
|
* repeating entries with the same key and Ruby Hash can not.
|
524
524
|
*
|
525
525
|
* Raises an exception if the JSON is malformed or the classes specified are not
|
data/lib/oj.rb
CHANGED
@@ -24,6 +24,14 @@
|
|
24
24
|
module Oj
|
25
25
|
end
|
26
26
|
|
27
|
+
begin
|
28
|
+
# This require exists to get around Rubinius failing to load bigdecimal from
|
29
|
+
# the C extension.
|
30
|
+
require 'bigdecimal'
|
31
|
+
rescue Exception
|
32
|
+
# ignore
|
33
|
+
end
|
34
|
+
|
27
35
|
require 'oj/version'
|
28
36
|
require 'oj/bag'
|
29
37
|
require 'oj/error'
|
data/lib/oj/saj.rb
CHANGED
data/lib/oj/schandler.rb
CHANGED
data/lib/oj/version.rb
CHANGED
data/test/test_fast.rb
CHANGED
data/test/test_gc.rb
CHANGED
data/test/test_saj.rb
CHANGED
data/test/test_scp.rb
CHANGED
data/test/test_writer.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.5.
|
4
|
+
version: 2.5.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: 2014-
|
11
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'The fastest JSON parser and object serializer. '
|
14
14
|
email: peter@ohler.com
|