oj 3.13.23 → 3.16.10
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/CHANGELOG.md +86 -0
- data/README.md +2 -2
- data/ext/oj/buf.h +7 -6
- data/ext/oj/cache.c +29 -26
- data/ext/oj/cache.h +3 -2
- data/ext/oj/cache8.c +10 -9
- data/ext/oj/circarray.c +7 -5
- data/ext/oj/circarray.h +2 -2
- data/ext/oj/code.c +5 -12
- data/ext/oj/code.h +2 -2
- data/ext/oj/compat.c +20 -60
- data/ext/oj/custom.c +26 -59
- data/ext/oj/debug.c +3 -9
- data/ext/oj/dump.c +103 -53
- data/ext/oj/dump.h +1 -4
- data/ext/oj/dump_compat.c +557 -592
- data/ext/oj/dump_leaf.c +3 -5
- data/ext/oj/dump_object.c +42 -48
- data/ext/oj/dump_strict.c +10 -22
- data/ext/oj/encoder.c +1 -1
- data/ext/oj/err.c +2 -13
- data/ext/oj/err.h +9 -12
- data/ext/oj/extconf.rb +16 -7
- data/ext/oj/fast.c +63 -98
- data/ext/oj/intern.c +62 -47
- data/ext/oj/intern.h +3 -7
- data/ext/oj/mem.c +318 -0
- data/ext/oj/mem.h +53 -0
- data/ext/oj/mimic_json.c +54 -38
- data/ext/oj/object.c +33 -43
- data/ext/oj/odd.c +8 -6
- data/ext/oj/odd.h +4 -4
- data/ext/oj/oj.c +245 -216
- data/ext/oj/oj.h +83 -81
- data/ext/oj/parse.c +109 -153
- data/ext/oj/parse.h +21 -24
- data/ext/oj/parser.c +80 -67
- data/ext/oj/parser.h +9 -8
- data/ext/oj/rails.c +71 -94
- data/ext/oj/reader.c +9 -14
- data/ext/oj/reader.h +4 -2
- data/ext/oj/resolve.c +3 -4
- data/ext/oj/rxclass.c +6 -5
- data/ext/oj/rxclass.h +1 -1
- data/ext/oj/saj.c +13 -15
- data/ext/oj/saj2.c +37 -49
- data/ext/oj/saj2.h +1 -1
- data/ext/oj/scp.c +6 -20
- data/ext/oj/sparse.c +22 -70
- data/ext/oj/stream_writer.c +46 -48
- data/ext/oj/strict.c +22 -56
- data/ext/oj/string_writer.c +64 -40
- data/ext/oj/trace.h +31 -4
- data/ext/oj/usual.c +125 -114
- data/ext/oj/usual.h +7 -6
- data/ext/oj/util.h +1 -1
- data/ext/oj/val_stack.c +13 -2
- data/ext/oj/val_stack.h +8 -7
- data/ext/oj/wab.c +25 -57
- data/lib/oj/active_support_helper.rb +1 -3
- data/lib/oj/bag.rb +7 -1
- data/lib/oj/easy_hash.rb +4 -5
- data/lib/oj/error.rb +0 -1
- data/lib/oj/json.rb +162 -150
- data/lib/oj/mimic.rb +7 -7
- data/lib/oj/schandler.rb +5 -4
- data/lib/oj/state.rb +8 -5
- data/lib/oj/version.rb +1 -2
- data/lib/oj.rb +2 -0
- data/pages/InstallOptions.md +20 -0
- data/pages/Options.md +4 -0
- metadata +46 -121
- data/test/_test_active.rb +0 -76
- data/test/_test_active_mimic.rb +0 -96
- data/test/_test_mimic_rails.rb +0 -126
- data/test/activerecord/result_test.rb +0 -32
- data/test/activesupport4/decoding_test.rb +0 -108
- data/test/activesupport4/encoding_test.rb +0 -531
- data/test/activesupport4/test_helper.rb +0 -41
- data/test/activesupport5/abstract_unit.rb +0 -45
- data/test/activesupport5/decoding_test.rb +0 -133
- data/test/activesupport5/encoding_test.rb +0 -500
- data/test/activesupport5/encoding_test_cases.rb +0 -98
- data/test/activesupport5/test_helper.rb +0 -72
- data/test/activesupport5/time_zone_test_helpers.rb +0 -39
- data/test/activesupport6/abstract_unit.rb +0 -44
- data/test/activesupport6/decoding_test.rb +0 -133
- data/test/activesupport6/encoding_test.rb +0 -507
- data/test/activesupport6/encoding_test_cases.rb +0 -98
- data/test/activesupport6/test_common.rb +0 -17
- data/test/activesupport6/test_helper.rb +0 -163
- data/test/activesupport6/time_zone_test_helpers.rb +0 -39
- data/test/activesupport7/abstract_unit.rb +0 -49
- data/test/activesupport7/decoding_test.rb +0 -125
- data/test/activesupport7/encoding_test.rb +0 -486
- data/test/activesupport7/encoding_test_cases.rb +0 -104
- data/test/activesupport7/time_zone_test_helpers.rb +0 -47
- data/test/bar.rb +0 -11
- data/test/baz.rb +0 -16
- data/test/bug.rb +0 -16
- data/test/files.rb +0 -29
- data/test/foo.rb +0 -77
- data/test/helper.rb +0 -42
- data/test/isolated/shared.rb +0 -308
- data/test/isolated/test_mimic_after.rb +0 -13
- data/test/isolated/test_mimic_alone.rb +0 -12
- data/test/isolated/test_mimic_as_json.rb +0 -45
- data/test/isolated/test_mimic_before.rb +0 -13
- data/test/isolated/test_mimic_define.rb +0 -28
- data/test/isolated/test_mimic_rails_after.rb +0 -22
- data/test/isolated/test_mimic_rails_before.rb +0 -21
- data/test/isolated/test_mimic_redefine.rb +0 -15
- data/test/json_gem/json_addition_test.rb +0 -216
- data/test/json_gem/json_common_interface_test.rb +0 -153
- data/test/json_gem/json_encoding_test.rb +0 -107
- data/test/json_gem/json_ext_parser_test.rb +0 -20
- data/test/json_gem/json_fixtures_test.rb +0 -35
- data/test/json_gem/json_generator_test.rb +0 -396
- data/test/json_gem/json_generic_object_test.rb +0 -90
- data/test/json_gem/json_parser_test.rb +0 -477
- data/test/json_gem/json_string_matching_test.rb +0 -42
- data/test/json_gem/test_helper.rb +0 -30
- data/test/mem.rb +0 -33
- data/test/perf.rb +0 -107
- data/test/perf_compat.rb +0 -130
- data/test/perf_dump.rb +0 -50
- data/test/perf_fast.rb +0 -164
- data/test/perf_file.rb +0 -64
- data/test/perf_object.rb +0 -138
- data/test/perf_once.rb +0 -58
- data/test/perf_parser.rb +0 -189
- data/test/perf_saj.rb +0 -109
- data/test/perf_scp.rb +0 -152
- data/test/perf_simple.rb +0 -287
- data/test/perf_strict.rb +0 -139
- data/test/perf_wab.rb +0 -131
- data/test/prec.rb +0 -23
- data/test/sample/change.rb +0 -14
- data/test/sample/dir.rb +0 -19
- data/test/sample/doc.rb +0 -36
- data/test/sample/file.rb +0 -48
- data/test/sample/group.rb +0 -16
- data/test/sample/hasprops.rb +0 -16
- data/test/sample/layer.rb +0 -12
- data/test/sample/line.rb +0 -20
- data/test/sample/oval.rb +0 -10
- data/test/sample/rect.rb +0 -10
- data/test/sample/shape.rb +0 -35
- data/test/sample/text.rb +0 -20
- data/test/sample.rb +0 -54
- data/test/sample_json.rb +0 -37
- data/test/test_compat.rb +0 -540
- data/test/test_custom.rb +0 -544
- data/test/test_debian.rb +0 -53
- data/test/test_fast.rb +0 -530
- data/test/test_file.rb +0 -255
- data/test/test_gc.rb +0 -60
- data/test/test_generate.rb +0 -21
- data/test/test_hash.rb +0 -39
- data/test/test_integer_range.rb +0 -72
- data/test/test_null.rb +0 -376
- data/test/test_object.rb +0 -1025
- data/test/test_parser.rb +0 -11
- data/test/test_parser_debug.rb +0 -27
- data/test/test_parser_saj.rb +0 -335
- data/test/test_parser_usual.rb +0 -217
- data/test/test_rails.rb +0 -35
- data/test/test_saj.rb +0 -186
- data/test/test_scp.rb +0 -431
- data/test/test_strict.rb +0 -435
- data/test/test_various.rb +0 -752
- data/test/test_wab.rb +0 -309
- data/test/test_writer.rb +0 -380
- data/test/tests.rb +0 -33
- data/test/tests_mimic.rb +0 -23
- data/test/tests_mimic_addition.rb +0 -16
- data/test/zoo.rb +0 -13
data/test/sample/group.rb
DELETED
data/test/sample/hasprops.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
module Sample
|
3
|
-
module HasProps
|
4
|
-
|
5
|
-
def add_prop(key, value)
|
6
|
-
@props = { } unless self.instance_variable_defined?(:@props)
|
7
|
-
@props[key] = value
|
8
|
-
end
|
9
|
-
|
10
|
-
def props
|
11
|
-
@props = { } unless self.instance_variable_defined?(:@props)
|
12
|
-
@props
|
13
|
-
end
|
14
|
-
|
15
|
-
end # HasProps
|
16
|
-
end # Sample
|
data/test/sample/layer.rb
DELETED
data/test/sample/line.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Sample
|
2
|
-
|
3
|
-
class Line
|
4
|
-
include HasProps
|
5
|
-
|
6
|
-
attr_accessor :x, :y, :dx, :dy
|
7
|
-
attr_accessor :color
|
8
|
-
attr_accessor :thick
|
9
|
-
|
10
|
-
def initialize(x, y, dx, dy, thick, color)
|
11
|
-
@x = x
|
12
|
-
@y = y
|
13
|
-
@dx = dx
|
14
|
-
@dy = dy
|
15
|
-
@thick = thick
|
16
|
-
@color = color
|
17
|
-
end
|
18
|
-
|
19
|
-
end # Line
|
20
|
-
end # Sample
|
data/test/sample/oval.rb
DELETED
data/test/sample/rect.rb
DELETED
data/test/sample/shape.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
|
2
|
-
module Sample
|
3
|
-
class Shape
|
4
|
-
include HasProps
|
5
|
-
|
6
|
-
attr_accessor :bounds
|
7
|
-
attr_accessor :color
|
8
|
-
attr_accessor :border, :border_color
|
9
|
-
|
10
|
-
def initialize(left, top, wide, high, color=nil)
|
11
|
-
@bounds = [[left, top], [left + wide, top + high]]
|
12
|
-
@color = color
|
13
|
-
@border = 1
|
14
|
-
@border_color = :black
|
15
|
-
end
|
16
|
-
|
17
|
-
def left
|
18
|
-
@bounds[0][0]
|
19
|
-
end
|
20
|
-
|
21
|
-
def top
|
22
|
-
@bounds[0][1]
|
23
|
-
end
|
24
|
-
|
25
|
-
def width
|
26
|
-
@bounds[1][0] - @bounds[0][0]
|
27
|
-
end
|
28
|
-
|
29
|
-
def height
|
30
|
-
@bounds[1][1] - @bounds[0][1]
|
31
|
-
end
|
32
|
-
|
33
|
-
end # Shape
|
34
|
-
end # Sample
|
35
|
-
|
data/test/sample/text.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
|
2
|
-
module Sample
|
3
|
-
class Text < Shape
|
4
|
-
attr_accessor :text
|
5
|
-
attr_accessor :font
|
6
|
-
attr_accessor :font_size
|
7
|
-
attr_accessor :just
|
8
|
-
attr_accessor :text_color
|
9
|
-
|
10
|
-
def initialize(text, left, top, wide, high, color=nil)
|
11
|
-
super(left, top, wide, high, color)
|
12
|
-
@text = text
|
13
|
-
@font = 'helvetica'
|
14
|
-
@font_size = 14
|
15
|
-
@just = 'left'
|
16
|
-
@text_color = 'black'
|
17
|
-
end
|
18
|
-
|
19
|
-
end # Text
|
20
|
-
end # Sample
|
data/test/sample.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby -wW2
|
2
|
-
|
3
|
-
if $0 == __FILE__
|
4
|
-
$: << '.'
|
5
|
-
$: << '..'
|
6
|
-
$: << '../lib'
|
7
|
-
$: << '../ext'
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'pp'
|
11
|
-
require 'sample/doc'
|
12
|
-
|
13
|
-
def sample_doc(size=3)
|
14
|
-
colors = [ :black, :gray, :white, :red, :blue, :yellow, :green, :purple, :orange ]
|
15
|
-
|
16
|
-
d = ::Sample::Doc.new('Sample')
|
17
|
-
|
18
|
-
# add some history
|
19
|
-
(0..size * 10).each do |i|
|
20
|
-
d.add_change("Changed at t+#{i}.")
|
21
|
-
end
|
22
|
-
|
23
|
-
# add some layers
|
24
|
-
(1..size).each do |i|
|
25
|
-
layer = ::Sample::Layer.new("Layer-#{i}")
|
26
|
-
(1..size).each do |j|
|
27
|
-
g = ::Sample::Group.new
|
28
|
-
(1..size).each do |k|
|
29
|
-
g2 = ::Sample::Group.new
|
30
|
-
r = ::Sample::Rect.new(j * 40 + 10.0, i * 10.0,
|
31
|
-
10.123456 / k, 10.0 / k, colors[(i + j + k) % colors.size])
|
32
|
-
r.add_prop(:part_of, layer.name)
|
33
|
-
g2 << r
|
34
|
-
g2 << ::Sample::Text.new("#{k} in #{j}", r.left, r.top, r.width, r.height)
|
35
|
-
g << g2
|
36
|
-
end
|
37
|
-
g2 = ::Sample::Group.new
|
38
|
-
(1..size).each do |k|
|
39
|
-
o = ::Sample::Oval.new(j * 40 + 12.0, i * 10.0 + 2.0,
|
40
|
-
6.0 / k, 6.0 / k, colors[(i + j + k) % colors.size])
|
41
|
-
o.add_prop(:inside, true)
|
42
|
-
g << o
|
43
|
-
end
|
44
|
-
g << g2
|
45
|
-
layer << g
|
46
|
-
end
|
47
|
-
d.layers[layer.name] = layer
|
48
|
-
end
|
49
|
-
|
50
|
-
# some properties
|
51
|
-
d.add_prop(:purpose, 'an example')
|
52
|
-
|
53
|
-
d
|
54
|
-
end
|
data/test/sample_json.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
if $0 == __FILE__
|
4
|
-
$: << '.'
|
5
|
-
$: << '..'
|
6
|
-
$: << '../lib'
|
7
|
-
$: << '../ext'
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'pp'
|
11
|
-
require 'oj'
|
12
|
-
|
13
|
-
def sample_json(size=3)
|
14
|
-
colors = [ :black, :gray, :white, :red, :blue, :yellow, :green, :purple, :orange ]
|
15
|
-
container = []
|
16
|
-
size.times do |i|
|
17
|
-
box = {
|
18
|
-
'color' => colors[i % colors.size],
|
19
|
-
'fragile' => (0 == (i % 2)),
|
20
|
-
'width' => i,
|
21
|
-
'height' => i,
|
22
|
-
'depth' => i,
|
23
|
-
'weight' => i * 1.3,
|
24
|
-
'address' => {
|
25
|
-
'street' => "#{i} Main Street",
|
26
|
-
'city' => 'Sity',
|
27
|
-
'state' => nil
|
28
|
-
}
|
29
|
-
}
|
30
|
-
container << box
|
31
|
-
end
|
32
|
-
container
|
33
|
-
end
|
34
|
-
|
35
|
-
if $0 == __FILE__
|
36
|
-
File.open('sample.json', "w") { |f| f.write(Oj.dump(sample_json(3), :indent => 2)) }
|
37
|
-
end
|