oj 2.12.2 → 2.12.3

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: 2a621ea1cf610e5b78949d860fc54f2c6fe43e0c
4
- data.tar.gz: 11cd52b0f0747e95007d678b291560b6271b9235
3
+ metadata.gz: 655072c6be3f9b0fe883178b02266e5f12838157
4
+ data.tar.gz: d37bc3d0333cec27246610451dda289ce4a4fbc2
5
5
  SHA512:
6
- metadata.gz: 76bdb63802a6f728259dd9cb7351d64f38862cf8a522bdb56c208cdc5803cb52a4625493c4c0d7d103d5e6a7a2522bfd847a1942ccb56ce2a59a3b22ae9d969e
7
- data.tar.gz: 5a215c6a81a876ee0f1a777ff90f1d55b1ad5eb809da6b431eb21b79f7bcaab7a552febdcc090f12e17aa0acf0ea885c78d70940b13e298d8524db1c227c0500
6
+ metadata.gz: 604bc05ecad569b0791530e48b142a8cc83d4bd97192222b99f69c709c236ac0ff448ee9d4f766de8ea04ea273eecfe29d654405a4d7d3d781a9830f0f025aea
7
+ data.tar.gz: 4ceefa024654e05eddfa9efa8e98bc06641e06887045da4b7fb4944f3271789a69cc8d2c0b0cec375a3038aa2ff2113f3c698ccabe8d35f4f3b7a89f4c8f58f0
data/README.md CHANGED
@@ -26,11 +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
- ## Current Release 2.12.2
29
+ ## Future Release 2.12.3
30
30
 
31
- - Fixed Oj::Doc bug that causes a crash on local name lookups.
32
-
33
- - Fixed Oj::Doc unicode parsing.
31
+ - Fixed bug when trying to resolve an invalid class path in object mode load.
34
32
 
35
33
  [Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
36
34
 
@@ -271,7 +271,15 @@ hat_cstr(ParseInfo pi, Val parent, Val kval, const char *str, size_t len) {
271
271
  parent->val = oj_encode(parent->val);
272
272
  break;
273
273
  case 'c': // class
274
- parent->val = oj_name2class(pi, str, len, Yes == pi->options.auto_define);
274
+ {
275
+ VALUE clas = oj_name2class(pi, str, len, Yes == pi->options.auto_define);
276
+
277
+ if (Qundef == clas) {
278
+ return 0;
279
+ } else {
280
+ parent->val = clas;
281
+ }
282
+ }
275
283
  break;
276
284
  case 't': // time
277
285
  parent->val = parse_xml_time(str, len);
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.12.2'
4
+ VERSION = '2.12.3'
5
5
  end
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #!/usr/bin/env ruby
4
+ # encoding: UTF-8
5
+
6
+ $: << File.dirname(__FILE__)
7
+ %w(lib ext test).each do |dir|
8
+ $LOAD_PATH.unshift File.expand_path("../../#{dir}", __FILE__)
9
+ end
10
+
11
+ require 'oj'
12
+ require 'stringio'
13
+
14
+ class Parser < Oj::Saj
15
+
16
+ def parse(json)
17
+ Oj.saj_parse(self, StringIO.new(json))
18
+ end
19
+
20
+ def hash_start(key)
21
+ puts "START: #{key}"
22
+ end
23
+
24
+ def error(message, line, column)
25
+ puts "Error callback: #{message}"
26
+ end
27
+
28
+ end
29
+
30
+ parser = Parser.new
31
+
32
+ begin
33
+ # truncated JSON, Oj.saj_parse raises, #error not called
34
+ parser.parse('{"foo{"bar":')
35
+ rescue Exception => e
36
+ puts "*** #{e.class}: #{e.message}"
37
+ end
38
+
39
+ puts "\n\n"
40
+
41
+ begin
42
+ # invalid JSON, doesn't raise an error
43
+ parser.parse('{"foo":{"bar":}')
44
+ rescue Exception => e
45
+ puts "*** #{e.class}: #{e.message}"
46
+ end
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.2
4
+ version: 2.12.3
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-13 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -107,6 +107,7 @@ files:
107
107
  - test/_test_mimic_rails.rb
108
108
  - test/bug.rb
109
109
  - test/bug2.rb
110
+ - test/bug3.rb
110
111
  - test/example.rb
111
112
  - test/files.rb
112
113
  - test/helper.rb
@@ -185,4 +186,3 @@ signing_key:
185
186
  specification_version: 4
186
187
  summary: A fast JSON parser and serializer.
187
188
  test_files: []
188
- has_rdoc: true