oj 3.0.1 → 3.0.2
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.
- checksums.yaml +4 -4
- data/ext/oj/dump.c +1 -0
- data/lib/oj/json.rb +4 -0
- data/lib/oj/version.rb +1 -1
- data/test/test_custom.rb +6 -3
- data/test/test_fast.rb +12 -3
- data/test/tests.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4567e9da6a54d9e4867e415e0618c17e5108f90
|
4
|
+
data.tar.gz: 66813867faafbab6d5f2eb758abf5b757e73ef58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16d1a220652f96d07f6a4fbaa589185d332b0d067eebdca3426f875e050d5d8307dd96c29e16093b2356f8ce45d7ca9e831c09a0454e5af2a54718bc25b8b8cb
|
7
|
+
data.tar.gz: 4cfd12ba09c4a035776f126e7d7ed719ab62bf515ae1716487a57b92ce919397b0074baade3aec6d66166e0c399ac760c11bf99fcd9b630d795db94f3c345fef
|
data/ext/oj/dump.c
CHANGED
@@ -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
|
}
|
data/lib/oj/json.rb
CHANGED
data/lib/oj/version.rb
CHANGED
data/test/test_custom.rb
CHANGED
@@ -203,14 +203,17 @@ class CustomJuice < Minitest::Test
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def test_bigdecimal
|
206
|
-
|
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
|
-
|
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
|
|
data/test/test_fast.rb
CHANGED
@@ -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
|
-
|
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',
|
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',
|
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))
|
data/test/tests.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|