oj 3.0.1 → 3.0.2

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
  SHA1:
3
- metadata.gz: f17a28bd292a74d89703b466aa07ccbcf4ff8b1e
4
- data.tar.gz: 5b38dfb5e07d744a9ef61615088a56c2f2d3d097
3
+ metadata.gz: d4567e9da6a54d9e4867e415e0618c17e5108f90
4
+ data.tar.gz: 66813867faafbab6d5f2eb758abf5b757e73ef58
5
5
  SHA512:
6
- metadata.gz: 5f34961546d44387a7dcdab7e033a154e3dbd6660b4679ad83c3b2bbc378f8b2e2e69007042459b38fa5968dfe9253898a0ac1d85845b1522a6a90c9438d098f
7
- data.tar.gz: 9ea1e4b3afc0077240e71b16a111ce1dd238fcaaf2a1e84597c0a60a5d32171c60e4812f2c4164e454fedd6029f85cf66874a76ff021780c28c9bc12d052f678
6
+ metadata.gz: 16d1a220652f96d07f6a4fbaa589185d332b0d067eebdca3426f875e050d5d8307dd96c29e16093b2356f8ce45d7ca9e831c09a0454e5af2a54718bc25b8b8cb
7
+ data.tar.gz: 4cfd12ba09c4a035776f126e7d7ed719ab62bf515ae1716487a57b92ce919397b0074baade3aec6d66166e0c399ac760c11bf99fcd9b630d795db94f3c345fef
@@ -529,6 +529,7 @@ oj_dump_obj_to_json_using_params(VALUE obj, Options copts, Out out, int argc, VA
529
529
  out->indent = copts->indent;
530
530
  out->argc = argc;
531
531
  out->argv = argv;
532
+ out->ropts = NULL;
532
533
  if (Yes == copts->circular) {
533
534
  oj_cache8_new(&out->circ_cache);
534
535
  }
@@ -94,6 +94,10 @@ module JSON
94
94
 
95
95
  State = ::JSON::Ext::Generator::State
96
96
 
97
+ begin
98
+ Object.send(:remove_const, :Parser)
99
+ rescue
100
+ end
97
101
  Parser = ::JSON::Ext::Parser
98
102
  self.parser = ::JSON::Ext::Parser
99
103
  self.generator = ::JSON::Ext::Generator
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.2'
5
5
  end
@@ -203,14 +203,17 @@ class CustomJuice < Minitest::Test
203
203
  end
204
204
 
205
205
  def test_bigdecimal
206
- assert_equal('0.314159265358979323846e1', Oj.dump(BigDecimal.new('3.14159265358979323846'), :bigdecimal_load => true))
206
+ if '2.4.0' <= RUBY_VERSION
207
+ assert_equal('0.314159265358979323846e1', Oj.dump(BigDecimal.new('3.14159265358979323846'), :bigdecimal_load => true))
208
+ else
209
+ assert_equal('0.314159265358979323846E1', Oj.dump(BigDecimal.new('3.14159265358979323846'), :bigdecimal_load => true))
210
+ end
207
211
  dump_and_load(BigDecimal.new('3.14159265358979323846'), false, :bigdecimal_load => true)
208
212
  end
209
213
 
210
214
  def test_object
211
215
  obj = Jeez.new(true, 58)
212
- json = Oj.dump(obj, :create_id => "^o", :use_to_json => false, :use_as_json => false, :use_to_hash => false)
213
- #puts "*** #{json}"
216
+ Oj.dump(obj, :create_id => "^o", :use_to_json => false, :use_as_json => false, :use_to_hash => false)
214
217
  dump_and_load(obj, false, :create_id => "^o", :create_additions => true)
215
218
  end
216
219
 
@@ -80,7 +80,11 @@ class DocTest < Minitest::Test
80
80
  def test_fixnum
81
81
  json = %{12345}
82
82
  Oj::Doc.open(json) do |doc|
83
- assert_equal(Integer, doc.type)
83
+ if '2.4.0' <= RUBY_VERSION
84
+ assert_equal(Integer, doc.type)
85
+ else
86
+ assert_equal(Fixnum, doc.type)
87
+ end
84
88
  assert_equal(12345, doc.fetch())
85
89
  end
86
90
  end
@@ -205,14 +209,19 @@ class DocTest < Minitest::Test
205
209
  end
206
210
 
207
211
  def test_type
212
+ if '2.4.0' <= RUBY_VERSION
213
+ num_class = Integer
214
+ else
215
+ num_class = Fixnum
216
+ end
208
217
  Oj::Doc.open($json1) do |doc|
209
218
  [['/', Hash],
210
219
  ['/array', Array],
211
220
  ['/array/1', Hash],
212
- ['/array/1/num', Integer],
221
+ ['/array/1/num', num_class],
213
222
  ['/array/1/string', String],
214
223
  ['/array/1/hash/h2/a', Array],
215
- ['/array/1/hash/../num', Integer],
224
+ ['/array/1/hash/../num', num_class],
216
225
  ['/array/1/hash/../..', Array],
217
226
  ].each do |path,type|
218
227
  assert_equal(type, doc.type(path))
@@ -19,3 +19,4 @@ require 'test_file'
19
19
  require 'test_gc'
20
20
  require 'test_saj'
21
21
  require 'test_scp'
22
+ require 'test_various'
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.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-25 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler