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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bec8df6a55ce34bd8b34ffb5eaa161d4bad478cc6a3276b48fb7348c80f5b819
4
- data.tar.gz: e0c588f13d959ed54c4b70f0773796a2c8b0a34650b5196b8ddd09ddd0ab8ea0
3
+ metadata.gz: 7ba25f766c9a47418e68db380346e3049b745fe7a84f7347eb747e1e78fcde68
4
+ data.tar.gz: 4c0b5d9c78c2aef12ab964fde407e8b50a7666135b2b8c59f0781d55b49f6f39
5
5
  SHA512:
6
- metadata.gz: 99166b4812d71dda9d90b209765772c5d730b51820a57277588b34bd16f84251490f28abdc212c604e8ea90941fb311f0e86060fe021354d8936bf96f40ed07a
7
- data.tar.gz: 194812a60a88b0a705ab21180bb61961f841571c85a8fa58823d14d9539be772f0fefc812c864ccfcc18bf928ddc83815c92fa039d52c79da1b348442c70a394
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
@@ -828,7 +828,7 @@ rails_mimic_json(VALUE self) {
828
828
  json = rb_define_module("JSON");
829
829
  }
830
830
  oj_mimic_json_methods(json);
831
- // oj_default_options.mode = RailsMode;
831
+ oj_default_options.mode = RailsMode;
832
832
 
833
833
  return Qnil;
834
834
  }
data/lib/oj/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '3.11.6'
4
+ VERSION = '3.11.7'
5
5
  end
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
- class Foo
12
- def initialize
13
- @x = 123
14
- end
12
+ Oj.default_options = {trace: true}
15
13
 
16
- def xto_json(opt=nil, options=nil)
17
- "---to_json---"
18
- end
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.6
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-14 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler