oj 3.3.0 → 3.3.1
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/custom.c +7 -3
- data/ext/oj/dump_object.c +5 -0
- data/ext/oj/rails.c +5 -0
- data/lib/oj/version.rb +1 -1
- 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: 63050f31bc0315726a788659128470304b169f26
|
4
|
+
data.tar.gz: fd104a575acd6334e08bf3575da67398a23cd40d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd48c5c1a681efcc47684534d51ca3c4010c4b81ea815dd6d329e90237f422d852449058435132a752ebfea2ae7f77d64deed92df3a06e45c5bbe6c6dfe83f17
|
7
|
+
data.tar.gz: a0c15d440afc5243414d9e29657778b774647ef22d140a56649dff3f48af725be0992c8fb9251bac96d915203b919b27d118a702d0415837445180536a2ecb06
|
data/ext/oj/custom.c
CHANGED
@@ -532,7 +532,11 @@ dump_attr_cb(ID key, VALUE value, Out out) {
|
|
532
532
|
}
|
533
533
|
size = depth * out->indent + 1;
|
534
534
|
attr = rb_id2name(key);
|
535
|
-
|
535
|
+
// Some exceptions such as NoMethodError have an invisible attribute where
|
536
|
+
// the key name is NULL. Not an empty string but NULL.
|
537
|
+
if (NULL == attr) {
|
538
|
+
attr = "";
|
539
|
+
}
|
536
540
|
#if HAS_EXCEPTION_MAGIC
|
537
541
|
if (0 == strcmp("bt", attr) || 0 == strcmp("mesg", attr)) {
|
538
542
|
return ST_CONTINUE;
|
@@ -648,7 +652,7 @@ static void
|
|
648
652
|
dump_obj(VALUE obj, int depth, Out out, bool as_ok) {
|
649
653
|
long id = oj_check_circular(obj, out);
|
650
654
|
VALUE clas;
|
651
|
-
|
655
|
+
|
652
656
|
if (0 > id) {
|
653
657
|
oj_dump_nil(Qnil, depth, out, false);
|
654
658
|
} else if (Qnil != (clas = dump_common(obj, depth, out))) {
|
@@ -861,7 +865,7 @@ static DumpFunc custom_funcs[] = {
|
|
861
865
|
void
|
862
866
|
oj_dump_custom_val(VALUE obj, int depth, Out out, bool as_ok) {
|
863
867
|
int type = rb_type(obj);
|
864
|
-
|
868
|
+
|
865
869
|
if (MAX_DEPTH < depth) {
|
866
870
|
rb_raise(rb_eNoMemError, "Too deeply nested.\n");
|
867
871
|
}
|
data/ext/oj/dump_object.c
CHANGED
@@ -352,6 +352,11 @@ dump_attr_cb(ID key, VALUE value, Out out) {
|
|
352
352
|
if (out->omit_nil && Qnil == value) {
|
353
353
|
return ST_CONTINUE;
|
354
354
|
}
|
355
|
+
// Some exceptions such as NoMethodError have an invisible attribute where
|
356
|
+
// the key name is NULL. Not an empty string but NULL.
|
357
|
+
if (NULL == attr) {
|
358
|
+
attr = "";
|
359
|
+
}
|
355
360
|
#if HAS_EXCEPTION_MAGIC
|
356
361
|
if (0 == strcmp("bt", attr) || 0 == strcmp("mesg", attr)) {
|
357
362
|
return ST_CONTINUE;
|
data/ext/oj/rails.c
CHANGED
@@ -90,6 +90,11 @@ dump_attr_cb(ID key, VALUE value, Out out) {
|
|
90
90
|
size_t size = depth * out->indent + 1;
|
91
91
|
const char *attr = rb_id2name(key);
|
92
92
|
|
93
|
+
// Some exceptions such as NoMethodError have an invisible attribute where
|
94
|
+
// the key name is NULL. Not an empty string but NULL.
|
95
|
+
if (NULL == attr) {
|
96
|
+
attr = "";
|
97
|
+
}
|
93
98
|
#if HAS_EXCEPTION_MAGIC
|
94
99
|
if (0 == strcmp("bt", attr) || 0 == strcmp("mesg", attr)) {
|
95
100
|
return ST_CONTINUE;
|
data/lib/oj/version.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.3.
|
4
|
+
version: 3.3.1
|
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-07-
|
11
|
+
date: 2017-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|