multi_json 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ module MultiJson
4
4
 
5
5
  def load(string, options={})
6
6
  string = string.read if string.respond_to?(:read)
7
- ::JSON.parse(string, :symbolize_names => options[:symbolize_keys], :quirks_mode => true)
7
+ ::JSON.parse(string, :symbolize_names => options[:symbolize_keys], :quirks_mode => true, :create_additions => false)
8
8
  end
9
9
 
10
10
  def dump(object, options={})
@@ -14,6 +14,7 @@ module MultiJson
14
14
 
15
15
  def self.load(string, options={}) #:nodoc:
16
16
  options.merge!(:symbol_keys => options[:symbolize_keys])
17
+ options[:mode] = :strict
17
18
  ::Oj.load(string, options)
18
19
  end
19
20
 
@@ -1,3 +1,3 @@
1
1
  module MultiJson
2
- VERSION = "1.5.0" unless defined?(MultiJson::VERSION)
2
+ VERSION = "1.5.1" unless defined?(MultiJson::VERSION)
3
3
  end
@@ -89,6 +89,24 @@ describe 'MultiJson' do
89
89
  expect(MultiJson.adapter.name).to eq 'MultiJson::Adapters::OkJson'
90
90
  end
91
91
 
92
+ it 'does not create symbols on parse' do
93
+ MultiJson.with_engine(:json_gem) do
94
+ before = Symbol.all_symbols
95
+ MultiJson.load('{"json_class":"OMGOMG"}') rescue nil
96
+ after = Symbol.all_symbols - before
97
+ expect(after).to eq []
98
+ end
99
+ end
100
+
101
+ it 'oj does not create symbols on parse' do
102
+ MultiJson.with_engine(:oj) do
103
+ before = Symbol.all_symbols
104
+ MultiJson.load('{"json_class":"OMGOMG"}') rescue nil
105
+ after = Symbol.all_symbols - before
106
+ expect(after).to eq []
107
+ end
108
+ end
109
+
92
110
  %w(json_gem json_pure nsjsonserialization oj ok_json yajl).each do |adapter|
93
111
  next if !macruby? && adapter == 'nsjsonserialization'
94
112
  next if jruby? && (adapter == 'oj' || adapter == 'yajl')
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_json
3
3
  version: !ruby/object:Gem::Version
4
+ version: 1.5.1
4
5
  prerelease:
5
- version: 1.5.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Bleigh
@@ -11,72 +11,72 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-12-10 00:00:00.000000000 Z
14
+ date: 2013-02-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- version_requirements: !ruby/object:Gem::Requirement
17
+ name: rake
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
21
  - - ! '>='
20
22
  - !ruby/object:Gem::Version
21
23
  version: '0.9'
22
- none: false
23
- name: rake
24
24
  type: :development
25
25
  prerelease: false
26
- requirement: !ruby/object:Gem::Requirement
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
27
28
  requirements:
28
29
  - - ! '>='
29
30
  - !ruby/object:Gem::Version
30
31
  version: '0.9'
31
- none: false
32
32
  - !ruby/object:Gem::Dependency
33
- version_requirements: !ruby/object:Gem::Requirement
33
+ name: rdoc
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
34
36
  requirements:
35
37
  - - ! '>='
36
38
  - !ruby/object:Gem::Version
37
39
  version: '3.9'
38
- none: false
39
- name: rdoc
40
40
  type: :development
41
41
  prerelease: false
42
- requirement: !ruby/object:Gem::Requirement
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
43
44
  requirements:
44
45
  - - ! '>='
45
46
  - !ruby/object:Gem::Version
46
47
  version: '3.9'
47
- none: false
48
48
  - !ruby/object:Gem::Dependency
49
- version_requirements: !ruby/object:Gem::Requirement
49
+ name: rspec
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
50
52
  requirements:
51
53
  - - ! '>='
52
54
  - !ruby/object:Gem::Version
53
55
  version: '2.6'
54
- none: false
55
- name: rspec
56
56
  type: :development
57
57
  prerelease: false
58
- requirement: !ruby/object:Gem::Requirement
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
59
60
  requirements:
60
61
  - - ! '>='
61
62
  - !ruby/object:Gem::Version
62
63
  version: '2.6'
63
- none: false
64
64
  - !ruby/object:Gem::Dependency
65
- version_requirements: !ruby/object:Gem::Requirement
65
+ name: simplecov
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
66
68
  requirements:
67
69
  - - ! '>='
68
70
  - !ruby/object:Gem::Version
69
71
  version: '0.4'
70
- none: false
71
- name: simplecov
72
72
  type: :development
73
73
  prerelease: false
74
- requirement: !ruby/object:Gem::Requirement
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
75
76
  requirements:
76
77
  - - ! '>='
77
78
  - !ruby/object:Gem::Version
78
79
  version: '0.4'
79
- none: false
80
80
  description: A gem to provide easy switching between different JSON backends, including
81
81
  Oj, Yajl, the JSON gem (with C-extensions), the pure-Ruby JSON gem, and OkJson.
82
82
  email:
@@ -119,17 +119,17 @@ rdoc_options:
119
119
  require_paths:
120
120
  - lib
121
121
  required_ruby_version: !ruby/object:Gem::Requirement
122
+ none: false
122
123
  requirements:
123
124
  - - ! '>='
124
125
  - !ruby/object:Gem::Version
125
126
  version: '0'
126
- none: false
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
+ none: false
128
129
  requirements:
129
130
  - - ! '>='
130
131
  - !ruby/object:Gem::Version
131
132
  version: 1.3.6
132
- none: false
133
133
  requirements: []
134
134
  rubyforge_project:
135
135
  rubygems_version: 1.8.23