oj 2.12.2 → 2.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of oj might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/ext/oj/object.c +9 -1
- data/lib/oj/version.rb +1 -1
- data/test/bug3.rb +46 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 655072c6be3f9b0fe883178b02266e5f12838157
|
4
|
+
data.tar.gz: d37bc3d0333cec27246610451dda289ce4a4fbc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
[](http://travis-ci.org/ohler55/oj)
|
28
28
|
|
29
|
-
##
|
29
|
+
## Future Release 2.12.3
|
30
30
|
|
31
|
-
- Fixed
|
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
|
|
data/ext/oj/object.c
CHANGED
@@ -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
|
-
|
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);
|
data/lib/oj/version.rb
CHANGED
data/test/bug3.rb
ADDED
@@ -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.
|
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-
|
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
|