oj 3.11.6 → 3.11.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/oj/parse.c +1 -1
- data/ext/oj/rails.c +1 -1
- data/lib/oj/version.rb +1 -1
- data/test/foo.rb +8 -43
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ba25f766c9a47418e68db380346e3049b745fe7a84f7347eb747e1e78fcde68
|
4
|
+
data.tar.gz: 4c0b5d9c78c2aef12ab964fde407e8b50a7666135b2b8c59f0781d55b49f6f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b950019944966b5a92839092463f45454e4f6f7178ce6e3fd9be6157a1a82891d65f7c058f4e9adcf200e074759ae2c1c679874e780509fd7151c06151c2dc4b
|
7
|
+
data.tar.gz: 28368e1b926b053656357edec71bf595886a61c71c7cdd46f87217587970d3589a71f373ed478db407fa08bd7c79919ae613cd6180dc90b29f4f802c265436f9
|
data/ext/oj/parse.c
CHANGED
@@ -1129,7 +1129,7 @@ CLEANUP:
|
|
1129
1129
|
if (Qnil != pi->err_class) {
|
1130
1130
|
pi->err.clas = pi->err_class;
|
1131
1131
|
}
|
1132
|
-
if (CompatMode == pi->options.mode && Yes != pi->options.safe) {
|
1132
|
+
if ((CompatMode == pi->options.mode || RailsMode == pi->options.mode) && Yes != pi->options.safe) {
|
1133
1133
|
// The json gem requires the error message be UTF-8 encoded. In
|
1134
1134
|
// additional the complete JSON source must be returned. There
|
1135
1135
|
// does not seem to be a size limit.
|
data/ext/oj/rails.c
CHANGED
data/lib/oj/version.rb
CHANGED
data/test/foo.rb
CHANGED
@@ -7,49 +7,14 @@ $oj_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
|
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'oj'
|
10
|
+
require 'active_support'
|
10
11
|
|
11
|
-
|
12
|
-
def initialize
|
13
|
-
@x = 123
|
14
|
-
end
|
12
|
+
Oj.default_options = {trace: true}
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
Oj::Rails.mimic_JSON
|
15
|
+
#Oj.mimic_JSON
|
16
|
+
begin
|
17
|
+
::JSON.load('foo=&bar')
|
18
|
+
rescue Exception => e
|
19
|
+
puts "*** #{e.class}: #{e.message}"
|
19
20
|
end
|
20
|
-
|
21
|
-
class Bar < Foo
|
22
|
-
def initialize
|
23
|
-
@x = 321
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
foo = Foo.new
|
28
|
-
bar = Bar.new
|
29
|
-
|
30
|
-
require 'json'
|
31
|
-
|
32
|
-
puts "JSON: #{JSON.generate(foo)}"
|
33
|
-
puts "to_json: #{foo.to_json}"
|
34
|
-
puts "bar JSON: #{JSON.generate(bar)}"
|
35
|
-
puts "bar to_json: #{bar.to_json}"
|
36
|
-
|
37
|
-
m = bar.method('to_json')
|
38
|
-
puts "*** method: #{m} owner: #{m.owner.name}"
|
39
|
-
|
40
|
-
puts "---- rails"
|
41
|
-
require 'rails'
|
42
|
-
|
43
|
-
m = bar.method('to_json')
|
44
|
-
puts "*** method: #{m} owner: #{m.owner} params: #{m.parameters}"
|
45
|
-
|
46
|
-
puts "JSON: #{JSON.generate(foo)}"
|
47
|
-
puts "to_json: #{foo.to_json}"
|
48
|
-
|
49
|
-
puts "---- Oj.mimic_JSON"
|
50
|
-
Oj.mimic_JSON()
|
51
|
-
puts "Oj JSON: #{JSON.generate(foo)}"
|
52
|
-
puts "Oj to_json: #{foo.to_json}"
|
53
|
-
|
54
|
-
m = bar.method('to_json')
|
55
|
-
puts "*** method: #{m} owner: #{m.owner} params: #{m.parameters}"
|
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: 3.11.
|
4
|
+
version: 3.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|