oj 3.7.11 → 3.7.12
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/rails.c +31 -28
- data/lib/oj/mimic.rb +1 -1
- data/lib/oj/version.rb +1 -1
- data/test/big.rb +15 -0
- data/test/foo.rb +26 -14
- data/test/mem.rb +35 -0
- metadata +71 -71
- data/test/bar.rb +0 -25
- data/test/zoo.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 596316b0a9a9e4fa7a82486f0589182f15a1c0c679d2d58f50357a291720cbfa
|
4
|
+
data.tar.gz: 3d58bd1344943d671222f1a7412c77731ecce70ddd3469a03ad15263374c243e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4273557f2d93c634e3a9ffc789a503f80ee5ca80a8031c1406a63a3e926648dd15294faa8820d6f6c63a625b9be4a34dd36bbde954ba8f68fe418f7182a84f55
|
7
|
+
data.tar.gz: ad6468ca75db3d8ebc792fcabbf417490c2cfe2927ab4859ef1c059fe36b8bad1c311fa03608a878350dd8324d3ab75887728a6ec4af1ffb1ea8739027642c69
|
data/ext/oj/rails.c
CHANGED
@@ -117,7 +117,7 @@ dump_attr_cb(ID key, VALUE value, Out out) {
|
|
117
117
|
dump_rails_val(value, depth, out, true);
|
118
118
|
out->depth = depth;
|
119
119
|
*out->cur++ = ',';
|
120
|
-
|
120
|
+
|
121
121
|
return ST_CONTINUE;
|
122
122
|
}
|
123
123
|
|
@@ -230,7 +230,7 @@ dump_sec_nano(VALUE obj, int64_t sec, long nsec, Out out) {
|
|
230
230
|
int tzhour, tzmin;
|
231
231
|
char tzsign = '+';
|
232
232
|
int len;
|
233
|
-
|
233
|
+
|
234
234
|
if (out->end - out->cur <= 36) {
|
235
235
|
assure_size(out, 36);
|
236
236
|
}
|
@@ -353,7 +353,7 @@ columns_array(VALUE rcols, int *ccnt) {
|
|
353
353
|
StrLen cols;
|
354
354
|
int i;
|
355
355
|
int cnt = (int)RARRAY_LEN(rcols);
|
356
|
-
|
356
|
+
|
357
357
|
*ccnt = cnt;
|
358
358
|
cols = ALLOC_N(struct _strLen, cnt);
|
359
359
|
for (i = 0, cp = cols; i < cnt; i++, cp++) {
|
@@ -372,7 +372,7 @@ dump_row(VALUE row, StrLen cols, int ccnt, int depth, Out out) {
|
|
372
372
|
size_t size;
|
373
373
|
int d2 = depth + 1;
|
374
374
|
int i;
|
375
|
-
|
375
|
+
|
376
376
|
assure_size(out, 2);
|
377
377
|
*out->cur++ = '{';
|
378
378
|
size = depth * out->indent + 3;
|
@@ -432,7 +432,7 @@ dump_activerecord_result(VALUE obj, int depth, Out out, bool as_ok) {
|
|
432
432
|
int i, rcnt;
|
433
433
|
size_t size;
|
434
434
|
int d2 = depth + 1;
|
435
|
-
|
435
|
+
|
436
436
|
if (0 == rows_id) {
|
437
437
|
rows_id = rb_intern("@rows");
|
438
438
|
columns_id = rb_intern("@columns");
|
@@ -597,7 +597,7 @@ create_opt(ROptTable rot, VALUE clas) {
|
|
597
597
|
ro = &rot->table[olen];
|
598
598
|
} else {
|
599
599
|
int i;
|
600
|
-
|
600
|
+
|
601
601
|
for (i = 0, ro = rot->table; i < olen; i++, ro++) {
|
602
602
|
if (clas < ro->clas) {
|
603
603
|
memmove(ro + 1, ro, sizeof(struct _rOpt) * (olen - i));
|
@@ -672,7 +672,7 @@ encoder_new(int argc, VALUE *argv, VALUE self) {
|
|
672
672
|
e->opts = oj_default_options;
|
673
673
|
e->arg = Qnil;
|
674
674
|
copy_opts(&ropts, &e->ropts);
|
675
|
-
|
675
|
+
|
676
676
|
if (1 <= argc && Qnil != *argv) {
|
677
677
|
oj_parse_options(*argv, &e->opts);
|
678
678
|
e->arg = *argv;
|
@@ -727,7 +727,7 @@ optimize(int argc, VALUE *argv, ROptTable rot, bool on) {
|
|
727
727
|
int i;
|
728
728
|
NamedFunc nf;
|
729
729
|
VALUE clas;
|
730
|
-
|
730
|
+
|
731
731
|
oj_rails_hash_opt = on;
|
732
732
|
oj_rails_array_opt = on;
|
733
733
|
oj_rails_float_opt = on;
|
@@ -759,14 +759,14 @@ optimize(int argc, VALUE *argv, ROptTable rot, bool on) {
|
|
759
759
|
|
760
760
|
/* Document-method optimize
|
761
761
|
* call-seq: optimize(*classes)
|
762
|
-
*
|
762
|
+
*
|
763
763
|
* Use Oj rails optimized routines to encode the specified classes. This
|
764
764
|
* ignores the as_json() method on the class and uses an internal encoding
|
765
765
|
* instead. Passing in no classes indicates all should use the optimized
|
766
766
|
* version of encoding for all previously optimized classes. Passing in the
|
767
767
|
* Object class set a global switch that will then use the optimized behavior
|
768
768
|
* for all classes.
|
769
|
-
*
|
769
|
+
*
|
770
770
|
* - *classes* [_Class_] a list of classes to optimize
|
771
771
|
*/
|
772
772
|
static VALUE
|
@@ -780,14 +780,14 @@ encoder_optimize(int argc, VALUE *argv, VALUE self) {
|
|
780
780
|
|
781
781
|
/* Document-method: optimize
|
782
782
|
* call-seq: optimize(*classes)
|
783
|
-
*
|
783
|
+
*
|
784
784
|
* Use Oj rails optimized routines to encode the specified classes. This
|
785
785
|
* ignores the as_json() method on the class and uses an internal encoding
|
786
786
|
* instead. Passing in no classes indicates all should use the optimized
|
787
787
|
* version of encoding for all previously optimized classes. Passing in the
|
788
788
|
* Object class set a global switch that will then use the optimized behavior
|
789
789
|
* for all classes.
|
790
|
-
*
|
790
|
+
*
|
791
791
|
* - *classes* [_Class_] a list of classes to optimize
|
792
792
|
*/
|
793
793
|
static VALUE
|
@@ -806,7 +806,7 @@ rails_optimize(int argc, VALUE *argv, VALUE self) {
|
|
806
806
|
VALUE
|
807
807
|
rails_mimic_json(VALUE self) {
|
808
808
|
VALUE json;
|
809
|
-
|
809
|
+
|
810
810
|
if (rb_const_defined_at(rb_cObject, rb_intern("JSON"))) {
|
811
811
|
json = rb_const_get_at(rb_cObject, rb_intern("JSON"));
|
812
812
|
} else {
|
@@ -820,7 +820,7 @@ rails_mimic_json(VALUE self) {
|
|
820
820
|
|
821
821
|
/* Document-method: deoptimize
|
822
822
|
* call-seq: deoptimize(*classes)
|
823
|
-
*
|
823
|
+
*
|
824
824
|
* Turn off Oj rails optimization on the specified classes.
|
825
825
|
*
|
826
826
|
* - *classes* [_Class_] a list of classes to deoptimize
|
@@ -836,7 +836,7 @@ encoder_deoptimize(int argc, VALUE *argv, VALUE self) {
|
|
836
836
|
|
837
837
|
/* Document-method: deoptimize
|
838
838
|
* call-seq: deoptimize(*classes)
|
839
|
-
*
|
839
|
+
*
|
840
840
|
* Turn off Oj rails optimization on the specified classes.
|
841
841
|
*
|
842
842
|
* - *classes* [_Class_] a list of classes to deoptimize
|
@@ -850,7 +850,7 @@ rails_deoptimize(int argc, VALUE *argv, VALUE self) {
|
|
850
850
|
|
851
851
|
/* Document-method:optimized?
|
852
852
|
* call-seq: optimized?(clas)
|
853
|
-
*
|
853
|
+
*
|
854
854
|
* - *clas* [_Class_] Class to check
|
855
855
|
*
|
856
856
|
* @return true if the class is being optimized for rails and false otherwise
|
@@ -868,7 +868,7 @@ encoder_optimized(VALUE self, VALUE clas) {
|
|
868
868
|
|
869
869
|
/* Document-method: optimized?
|
870
870
|
* call-seq: optimized?(clas)
|
871
|
-
*
|
871
|
+
*
|
872
872
|
* Returns true if the specified Class is being optimized.
|
873
873
|
*/
|
874
874
|
static VALUE
|
@@ -966,7 +966,7 @@ encode(VALUE obj, ROptTable ropts, Options opts, int argc, VALUE *argv) {
|
|
966
966
|
|
967
967
|
/* Document-method: encode
|
968
968
|
* call-seq: encode(obj)
|
969
|
-
*
|
969
|
+
*
|
970
970
|
* - *obj* [_Object_] object to encode
|
971
971
|
*
|
972
972
|
* Returns encoded object as a JSON string.
|
@@ -977,7 +977,7 @@ encoder_encode(VALUE self, VALUE obj) {
|
|
977
977
|
|
978
978
|
if (Qnil != e->arg) {
|
979
979
|
VALUE argv[1] = { e->arg };
|
980
|
-
|
980
|
+
|
981
981
|
return encode(obj, &e->ropts, &e->opts, 1, argv);
|
982
982
|
}
|
983
983
|
return encode(obj, &e->ropts, &e->opts, 0, NULL);
|
@@ -985,9 +985,9 @@ encoder_encode(VALUE self, VALUE obj) {
|
|
985
985
|
|
986
986
|
/* Document-method: encode
|
987
987
|
* call-seq: encode(obj, opts=nil)
|
988
|
-
*
|
988
|
+
*
|
989
989
|
* Encode obj as a JSON String.
|
990
|
-
*
|
990
|
+
*
|
991
991
|
* - *obj* [_Object_|Hash|Array] object to convert to a JSON String
|
992
992
|
* - *opts* [_Hash_] options
|
993
993
|
*
|
@@ -1037,7 +1037,7 @@ rails_time_precision(VALUE self, VALUE prec) {
|
|
1037
1037
|
|
1038
1038
|
/* Document-method: set_encoder
|
1039
1039
|
* call-seq: set_encoder()
|
1040
|
-
*
|
1040
|
+
*
|
1041
1041
|
* Sets the ActiveSupport.encoder to Oj::Rails::Encoder and wraps some of the
|
1042
1042
|
* formatting globals used by ActiveSupport to allow the use of those globals
|
1043
1043
|
* in the Oj::Rails optimizations.
|
@@ -1049,7 +1049,7 @@ rails_set_encoder(VALUE self) {
|
|
1049
1049
|
VALUE encoding;
|
1050
1050
|
VALUE pv;
|
1051
1051
|
VALUE verbose;
|
1052
|
-
|
1052
|
+
|
1053
1053
|
if (rb_const_defined_at(rb_cObject, rb_intern("ActiveSupport"))) {
|
1054
1054
|
active = rb_const_get_at(rb_cObject, rb_intern("ActiveSupport"));
|
1055
1055
|
} else {
|
@@ -1090,7 +1090,7 @@ rails_set_decoder(VALUE self) {
|
|
1090
1090
|
VALUE json;
|
1091
1091
|
VALUE json_error;
|
1092
1092
|
VALUE verbose;
|
1093
|
-
|
1093
|
+
|
1094
1094
|
if (rb_const_defined_at(rb_cObject, rb_intern("JSON"))) {
|
1095
1095
|
json = rb_const_get_at(rb_cObject, rb_intern("JSON"));
|
1096
1096
|
} else {
|
@@ -1113,7 +1113,7 @@ rails_set_decoder(VALUE self) {
|
|
1113
1113
|
rb_undef_method(json, "parse");
|
1114
1114
|
rb_define_module_function(json, "parse", oj_mimic_parse, -1);
|
1115
1115
|
rb_gv_set("$VERBOSE", verbose);
|
1116
|
-
|
1116
|
+
|
1117
1117
|
return Qnil;
|
1118
1118
|
}
|
1119
1119
|
|
@@ -1133,7 +1133,7 @@ oj_optimize_rails(VALUE self) {
|
|
1133
1133
|
}
|
1134
1134
|
|
1135
1135
|
/* Document-module: Oj::Rails
|
1136
|
-
*
|
1136
|
+
*
|
1137
1137
|
* Module that provides rails and active support compatibility.
|
1138
1138
|
*/
|
1139
1139
|
/* Document-class: Oj::Rails::Encoder
|
@@ -1143,7 +1143,7 @@ oj_optimize_rails(VALUE self) {
|
|
1143
1143
|
void
|
1144
1144
|
oj_mimic_rails_init() {
|
1145
1145
|
VALUE rails = rb_define_module_under(Oj, "Rails");
|
1146
|
-
|
1146
|
+
|
1147
1147
|
rb_define_module_function(rails, "encode", rails_encode, -1);
|
1148
1148
|
|
1149
1149
|
encoder_class = rb_define_class_under(rails, "Encoder", rb_cObject);
|
@@ -1283,7 +1283,10 @@ hash_cb(VALUE key, VALUE value, Out out) {
|
|
1283
1283
|
int depth = out->depth;
|
1284
1284
|
long size;
|
1285
1285
|
int rtype = rb_type(key);
|
1286
|
-
|
1286
|
+
|
1287
|
+
if (out->omit_nil && Qnil == value) {
|
1288
|
+
return ST_CONTINUE;
|
1289
|
+
}
|
1287
1290
|
if (rtype != T_STRING && rtype != T_SYMBOL) {
|
1288
1291
|
key = rb_funcall(key, oj_to_s_id, 0);
|
1289
1292
|
rtype = rb_type(key);
|
data/lib/oj/mimic.rb
CHANGED
@@ -31,7 +31,7 @@ module Oj
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Loads mimic-ed JSON paths. Used by Oj.mimic_JSON().
|
34
|
-
# @param
|
34
|
+
# @param mimic_paths [Array] additional paths to add to the Ruby loaded features.
|
35
35
|
def self.mimic_loaded(mimic_paths=[])
|
36
36
|
$LOAD_PATH.each do |d|
|
37
37
|
next unless File.exist?(d)
|
data/lib/oj/version.rb
CHANGED
data/test/big.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#require 'active_support'
|
2
|
+
#require 'active_support/core_ext'
|
3
|
+
#require 'active_support/json'
|
4
|
+
require 'oj'
|
5
|
+
|
6
|
+
#Oj.optimize_rails
|
7
|
+
Oj.mimic_JSON
|
8
|
+
|
9
|
+
h = {:type=>:record, :name=>:group, :namespace=>"com.salsify.identity", :fields=>[{:name=>"id", :type=>{:name=>:salsify_uuid, :type=>:fixed, :namespace=>"com.salsify", :size=>38}}, {:name=>"type", :type=>"string", :default=>"groups"}, {:name=>"external_id", :type=>[:null, "string"], :default=>nil}, {:name=>"created_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"updated_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"name", :type=>"string"}, {:name=>"policy", :type=>[:null, {:type=>:record, :name=>:policy, :namespace=>"com.salsify.security", :fields=>[{:name=>"created_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"updated_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"id", :type=>"com.salsify.salsify_uuid"}, {:name=>"type", :type=>"string", :default=>"policies"}, {:name=>"external_id", :type=>[:null, "string"], :default=>nil}, {:name=>"name", :type=>"string"}, {:name=>"statements", :type=>{:type=>:array, :items=>{:type=>:record, :name=>:statement, :namespace=>"com.salsify.security", :fields=>[{:name=>"created_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"updated_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"id", :type=>"com.salsify.salsify_uuid"}, {:name=>"type", :type=>"string", :default=>"statements"}, {:name=>"external_id", :type=>[:null, "string"], :default=>nil}, {:name=>"action", :type=>{:name=>"__statement_action_enum", :type=>:enum, :namespace=>"com.salsify.security", :symbols=>[:manage, :read]}}, {:name=>"resource", :type=>{:name=>"__statement_resource_enum", :type=>:enum, :namespace=>"com.salsify.security", :symbols=>[:product, :digital_asset]}}, {:name=>"conditions", :type=>{:type=>:array, :items=>{:type=>:record, :name=>:condition, :namespace=>"com.salsify.security", :fields=>[{:name=>"created_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"updated_at", :type=>{:type=>"long", :logicalType=>"timestamp-micros"}}, {:name=>"id", :type=>"com.salsify.salsify_uuid"}, {:name=>"type", :type=>"string", :default=>"conditions"}, {:name=>"external_id", :type=>[:null, "string"], :default=>nil}, {:name=>"operator", :type=>{:name=>"__condition_operator_enum", :type=>:enum, :namespace=>"com.salsify.security", :symbols=>[:equals]}}, {:name=>"attribute_type", :type=>{:name=>"__condition_attribute_type_enum", :type=>:enum, :namespace=>"com.salsify.security", :symbols=>[:resource]}}, {:name=>"value", :type=>"string"}, {:name=>"attribute", :type=>[:null, {:type=>:record, :name=>:reference, :namespace=>"com.salsify", :fields=>[{:name=>"id", :type=>"com.salsify.salsify_uuid"}, {:name=>"type", :type=>"string", :doc=>"snake_case, plural name for the resource type"}, {:name=>"external_id", :type=>[:null, "string"], :default=>nil}]}], :default=>nil}, {:name=>"broken", :type=>[:null, "boolean"], :default=>nil}]}}}]}}}]}], :default=>nil}]}
|
10
|
+
|
11
|
+
#Oj.dump(h)
|
12
|
+
puts JSON.pretty_generate(h)
|
13
|
+
#puts JSON.fast_generate(h)
|
14
|
+
#puts JSON.generate(h)
|
15
|
+
|
data/test/foo.rb
CHANGED
@@ -1,21 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
2
|
|
4
|
-
$: <<
|
5
|
-
|
6
|
-
|
7
|
-
$: << File.join($oj_dir, dir)
|
8
|
-
end
|
3
|
+
$: << '.'
|
4
|
+
$: << '../lib'
|
5
|
+
$: << '../ext'
|
9
6
|
|
10
7
|
require 'oj'
|
11
|
-
require 'active_support'
|
12
|
-
require 'active_support/json'
|
13
|
-
#require 'tracer'
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
f = File.open("foo.json", "w")
|
10
|
+
100_000.times do
|
11
|
+
obj = { created_at: DateTime.new(2001,2,3,4,5,6) }
|
12
|
+
Oj.to_stream(f, obj)
|
13
|
+
f.puts
|
14
|
+
f.flush
|
15
|
+
end
|
16
|
+
f.close
|
18
17
|
|
19
|
-
|
18
|
+
def run_test_thread
|
19
|
+
threads = Array.new(3) do
|
20
|
+
Thread.new do
|
21
|
+
counter = 0
|
22
|
+
File.open("foo.json", "r") { |f| Oj.enum_for(:load, f).lazy.each { counter += 1 } }
|
23
|
+
#File.open("odd_file.jsonl", "r") { |f| Oj.enum_for(:load, f).lazy.each { counter += 1 } }
|
24
|
+
puts counter
|
25
|
+
end
|
26
|
+
end
|
27
|
+
threads.each(&:join)
|
28
|
+
end
|
20
29
|
|
21
|
-
|
30
|
+
100.times do |i|
|
31
|
+
puts i
|
32
|
+
run_test_thread
|
33
|
+
end
|
data/test/mem.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$: << '.'
|
4
|
+
$: << '../lib'
|
5
|
+
$: << '../ext'
|
6
|
+
|
7
|
+
require 'objspace'
|
8
|
+
require 'oj'
|
9
|
+
require 'json'
|
10
|
+
require 'get_process_mem'
|
11
|
+
|
12
|
+
def record_allocation
|
13
|
+
GC.start
|
14
|
+
GC.start
|
15
|
+
|
16
|
+
mem = GetProcessMem.new
|
17
|
+
puts "Before - Process Memory: #{mem.mb} mb"
|
18
|
+
puts "Before - Objects count: #{ObjectSpace.each_object.count}"
|
19
|
+
puts "Before - Symbols count: #{Symbol.all_symbols.size}"
|
20
|
+
|
21
|
+
yield
|
22
|
+
|
23
|
+
GC.start
|
24
|
+
GC.start
|
25
|
+
GC.start
|
26
|
+
|
27
|
+
puts "After - Process Memory: #{mem.mb} mb"
|
28
|
+
puts "After - Objects count: #{ObjectSpace.each_object.count}"
|
29
|
+
puts "After - Symbols count: #{Symbol.all_symbols.size}"
|
30
|
+
end
|
31
|
+
|
32
|
+
record_allocation do
|
33
|
+
data = 1_000_000.times.map { |i| "string_number_#{i}".to_sym } # array of symbols
|
34
|
+
Oj.dump(data, mode: :rails)
|
35
|
+
end
|
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.7.
|
4
|
+
version: 3.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -79,16 +79,16 @@ extensions:
|
|
79
79
|
- ext/oj/extconf.rb
|
80
80
|
extra_rdoc_files:
|
81
81
|
- README.md
|
82
|
-
- pages/
|
83
|
-
- pages/JsonGem.md
|
84
|
-
- pages/Encoding.md
|
85
|
-
- pages/WAB.md
|
86
|
-
- pages/Custom.md
|
82
|
+
- pages/Modes.md
|
87
83
|
- pages/Advanced.md
|
88
84
|
- pages/Options.md
|
85
|
+
- pages/Custom.md
|
89
86
|
- pages/Compatibility.md
|
90
|
-
- pages/
|
87
|
+
- pages/WAB.md
|
91
88
|
- pages/Security.md
|
89
|
+
- pages/Encoding.md
|
90
|
+
- pages/JsonGem.md
|
91
|
+
- pages/Rails.md
|
92
92
|
files:
|
93
93
|
- LICENSE
|
94
94
|
- README.md
|
@@ -177,7 +177,7 @@ files:
|
|
177
177
|
- test/activesupport5/encoding_test_cases.rb
|
178
178
|
- test/activesupport5/test_helper.rb
|
179
179
|
- test/activesupport5/time_zone_test_helpers.rb
|
180
|
-
- test/
|
180
|
+
- test/big.rb
|
181
181
|
- test/files.rb
|
182
182
|
- test/foo.rb
|
183
183
|
- test/helper.rb
|
@@ -200,6 +200,7 @@ files:
|
|
200
200
|
- test/json_gem/json_parser_test.rb
|
201
201
|
- test/json_gem/json_string_matching_test.rb
|
202
202
|
- test/json_gem/test_helper.rb
|
203
|
+
- test/mem.rb
|
203
204
|
- test/perf.rb
|
204
205
|
- test/perf_compat.rb
|
205
206
|
- test/perf_fast.rb
|
@@ -243,7 +244,6 @@ files:
|
|
243
244
|
- test/tests.rb
|
244
245
|
- test/tests_mimic.rb
|
245
246
|
- test/tests_mimic_addition.rb
|
246
|
-
- test/zoo.rb
|
247
247
|
homepage: http://www.ohler.com/oj
|
248
248
|
licenses:
|
249
249
|
- MIT
|
@@ -273,87 +273,87 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
rubygems_version: 3.0.
|
276
|
+
rubygems_version: 3.0.3
|
277
277
|
signing_key:
|
278
278
|
specification_version: 4
|
279
279
|
summary: A fast JSON parser and serializer.
|
280
280
|
test_files:
|
281
|
-
- test/foo.rb
|
282
|
-
- test/test_integer_range.rb
|
283
|
-
- test/test_strict.rb
|
284
|
-
- test/perf_strict.rb
|
285
|
-
- test/tests.rb
|
286
|
-
- test/perf_saj.rb
|
287
|
-
- test/test_compat.rb
|
288
|
-
- test/helper.rb
|
289
281
|
- test/perf_file.rb
|
290
|
-
- test/
|
291
|
-
- test/
|
292
|
-
- test/
|
293
|
-
- test/
|
294
|
-
- test/
|
295
|
-
- test/
|
282
|
+
- test/test_hash.rb
|
283
|
+
- test/perf.rb
|
284
|
+
- test/test_object.rb
|
285
|
+
- test/test_null.rb
|
286
|
+
- test/test_compat.rb
|
287
|
+
- test/test_custom.rb
|
288
|
+
- test/perf_scp.rb
|
289
|
+
- test/test_integer_range.rb
|
290
|
+
- test/test_gc.rb
|
291
|
+
- test/sample.rb
|
296
292
|
- test/json_gem/json_string_matching_test.rb
|
297
|
-
- test/json_gem/
|
298
|
-
- test/json_gem/json_generator_test.rb
|
293
|
+
- test/json_gem/json_addition_test.rb
|
299
294
|
- test/json_gem/test_helper.rb
|
300
|
-
- test/json_gem/
|
295
|
+
- test/json_gem/json_generator_test.rb
|
301
296
|
- test/json_gem/json_parser_test.rb
|
302
|
-
- test/
|
303
|
-
- test/
|
304
|
-
- test/
|
305
|
-
- test/
|
306
|
-
- test/
|
307
|
-
- test/
|
308
|
-
- test/
|
309
|
-
- test/bar.rb
|
310
|
-
- test/activesupport4/encoding_test.rb
|
297
|
+
- test/json_gem/json_encoding_test.rb
|
298
|
+
- test/json_gem/json_common_interface_test.rb
|
299
|
+
- test/json_gem/json_generic_object_test.rb
|
300
|
+
- test/json_gem/json_ext_parser_test.rb
|
301
|
+
- test/json_gem/json_fixtures_test.rb
|
302
|
+
- test/tests_mimic_addition.rb
|
303
|
+
- test/test_wab.rb
|
311
304
|
- test/activesupport4/test_helper.rb
|
312
305
|
- test/activesupport4/decoding_test.rb
|
313
|
-
- test/
|
306
|
+
- test/activesupport4/encoding_test.rb
|
307
|
+
- test/activerecord/result_test.rb
|
308
|
+
- test/_test_active.rb
|
309
|
+
- test/test_file.rb
|
314
310
|
- test/activesupport5/encoding_test_cases.rb
|
315
|
-
- test/activesupport5/encoding_test.rb
|
316
311
|
- test/activesupport5/time_zone_test_helpers.rb
|
317
312
|
- test/activesupport5/test_helper.rb
|
318
313
|
- test/activesupport5/decoding_test.rb
|
319
|
-
- test/
|
320
|
-
- test/
|
321
|
-
- test/test_wab.rb
|
322
|
-
- test/test_null.rb
|
323
|
-
- test/_test_active.rb
|
324
|
-
- test/_test_mimic_rails.rb
|
325
|
-
- test/test_fast.rb
|
326
|
-
- test/perf_fast.rb
|
327
|
-
- test/sample/change.rb
|
328
|
-
- test/sample/text.rb
|
329
|
-
- test/sample/doc.rb
|
330
|
-
- test/sample/shape.rb
|
331
|
-
- test/sample/layer.rb
|
332
|
-
- test/sample/group.rb
|
333
|
-
- test/sample/file.rb
|
334
|
-
- test/sample/rect.rb
|
335
|
-
- test/sample/hasprops.rb
|
336
|
-
- test/sample/line.rb
|
337
|
-
- test/sample/dir.rb
|
338
|
-
- test/sample/oval.rb
|
339
|
-
- test/tests_mimic.rb
|
340
|
-
- test/perf_simple.rb
|
341
|
-
- test/zoo.rb
|
342
|
-
- test/activerecord/result_test.rb
|
314
|
+
- test/activesupport5/encoding_test.rb
|
315
|
+
- test/tests.rb
|
343
316
|
- test/_test_active_mimic.rb
|
344
|
-
- test/
|
345
|
-
- test/
|
346
|
-
- test/
|
317
|
+
- test/perf_object.rb
|
318
|
+
- test/test_strict.rb
|
319
|
+
- test/test_scp.rb
|
320
|
+
- test/perf_wab.rb
|
321
|
+
- test/test_saj.rb
|
322
|
+
- test/mem.rb
|
323
|
+
- test/perf_compat.rb
|
324
|
+
- test/helper.rb
|
325
|
+
- test/isolated/test_mimic_alone.rb
|
347
326
|
- test/isolated/test_mimic_define.rb
|
348
|
-
- test/isolated/test_mimic_after.rb
|
349
327
|
- test/isolated/test_mimic_rails_after.rb
|
350
|
-
- test/isolated/
|
328
|
+
- test/isolated/test_mimic_after.rb
|
351
329
|
- test/isolated/test_mimic_rails_before.rb
|
330
|
+
- test/isolated/test_mimic_as_json.rb
|
352
331
|
- test/isolated/test_mimic_redefine.rb
|
353
332
|
- test/isolated/shared.rb
|
354
|
-
- test/isolated/
|
355
|
-
- test/
|
333
|
+
- test/isolated/test_mimic_before.rb
|
334
|
+
- test/sample_json.rb
|
356
335
|
- test/test_debian.rb
|
357
|
-
- test/
|
336
|
+
- test/perf_fast.rb
|
337
|
+
- test/test_writer.rb
|
338
|
+
- test/test_fast.rb
|
339
|
+
- test/sample/line.rb
|
340
|
+
- test/sample/change.rb
|
341
|
+
- test/sample/dir.rb
|
342
|
+
- test/sample/text.rb
|
343
|
+
- test/sample/layer.rb
|
344
|
+
- test/sample/rect.rb
|
345
|
+
- test/sample/group.rb
|
346
|
+
- test/sample/oval.rb
|
347
|
+
- test/sample/doc.rb
|
348
|
+
- test/sample/hasprops.rb
|
349
|
+
- test/sample/shape.rb
|
350
|
+
- test/sample/file.rb
|
358
351
|
- test/files.rb
|
352
|
+
- test/big.rb
|
353
|
+
- test/perf_saj.rb
|
354
|
+
- test/foo.rb
|
355
|
+
- test/tests_mimic.rb
|
356
|
+
- test/perf_strict.rb
|
359
357
|
- test/test_various.rb
|
358
|
+
- test/_test_mimic_rails.rb
|
359
|
+
- test/perf_simple.rb
|
data/test/bar.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
|
4
|
-
$: << File.dirname(__FILE__)
|
5
|
-
$oj_dir = File.dirname(File.expand_path(File.dirname(__FILE__)))
|
6
|
-
%w(lib ext).each do |dir|
|
7
|
-
$: << File.join($oj_dir, dir)
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'oj'
|
11
|
-
|
12
|
-
#Oj.load_file(ARGV[0], mode: :strict) { |obj|
|
13
|
-
# puts Oj.dump(obj, indent: 2)
|
14
|
-
#}
|
15
|
-
|
16
|
-
data = open('invalid_unicode.data').read
|
17
|
-
|
18
|
-
puts data
|
19
|
-
|
20
|
-
puts Oj.dump(data)
|
21
|
-
|
22
|
-
Oj.mimic_JSON
|
23
|
-
puts Oj.dump(data, escape_mode: :json)
|
24
|
-
|
25
|
-
puts Oj.default_options
|