oj 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of oj might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +2 -18
- data/ext/oj/dump.c +7 -7
- data/ext/oj/oj.c +6 -4
- 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: 9262e646eacc8cec4f6eceb06d4f5c84370d62a1
|
4
|
+
data.tar.gz: 1de9d17fe6bcfa76e5da8d61d239853f7948421c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95c811b68202c376bee344ad7c6aa10571cd4efec48a7b85f3e9057163643fc77e81c6780be85eaca0ad4f9eca1c1d2c66da6497e18235107bee6b133699eb09
|
7
|
+
data.tar.gz: 9c65680e52c0154dfeab3c712bbf29bd2f12f30bb720b084f7f4ddd5a6e75dad789fd4101a31d351a6613ff9258a545ff1aa8dcf2d77705244c29c0fdf5ec692
|
data/README.md
CHANGED
@@ -21,25 +21,9 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
|
|
21
21
|
[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
|
22
22
|
|
23
23
|
|
24
|
-
### Current Release 2.4.
|
24
|
+
### Current Release 2.4.1
|
25
25
|
|
26
|
-
-
|
27
|
-
|
28
|
-
- Implemented StreamWriter to compliment the StringWriter.
|
29
|
-
|
30
|
-
- Fixed bug in the class cache hash function that showed up with the sparc compiler.
|
31
|
-
|
32
|
-
### Current Release 2.3.0
|
33
|
-
|
34
|
-
- JRuby is no longer supported.
|
35
|
-
|
36
|
-
- Thanks to Stefan Kaes the support for structs has been optimized.
|
37
|
-
|
38
|
-
- Better support for Rubinous
|
39
|
-
|
40
|
-
- Added option to disable GG during parsing.
|
41
|
-
|
42
|
-
- Added StringWriter that allows building a JSON document one element at a time.
|
26
|
+
- Fixed Windows version by removing class cache test.
|
43
27
|
|
44
28
|
[Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
|
45
29
|
|
data/ext/oj/dump.c
CHANGED
@@ -1774,7 +1774,9 @@ oj_write_obj_to_stream(VALUE obj, VALUE stream, Options copts) {
|
|
1774
1774
|
struct _Out out;
|
1775
1775
|
ssize_t size;
|
1776
1776
|
VALUE clas = rb_obj_class(stream);
|
1777
|
+
#if !IS_WINDOWS
|
1777
1778
|
VALUE s;
|
1779
|
+
#endif
|
1778
1780
|
|
1779
1781
|
out.buf = buf;
|
1780
1782
|
out.end = buf + sizeof(buf) - 10;
|
@@ -1783,7 +1785,6 @@ oj_write_obj_to_stream(VALUE obj, VALUE stream, Options copts) {
|
|
1783
1785
|
size = out.cur - out.buf;
|
1784
1786
|
if (oj_stringio_class == clas) {
|
1785
1787
|
rb_funcall(stream, oj_write_id, 1, rb_str_new(out.buf, size));
|
1786
|
-
#ifndef JRUBY_RUBY
|
1787
1788
|
#if !IS_WINDOWS
|
1788
1789
|
} else if (rb_respond_to(stream, oj_fileno_id) && Qnil != (s = rb_funcall(stream, oj_fileno_id, 0))) {
|
1789
1790
|
int fd = FIX2INT(s);
|
@@ -1794,7 +1795,6 @@ oj_write_obj_to_stream(VALUE obj, VALUE stream, Options copts) {
|
|
1794
1795
|
}
|
1795
1796
|
rb_raise(rb_eIOError, "Write failed. [%d:%s]\n", errno, strerror(errno));
|
1796
1797
|
}
|
1797
|
-
#endif
|
1798
1798
|
#endif
|
1799
1799
|
} else if (rb_respond_to(stream, oj_write_id)) {
|
1800
1800
|
rb_funcall(stream, oj_write_id, 1, rb_str_new(out.buf, size));
|
@@ -2067,11 +2067,11 @@ maybe_comma(StrWriter sw) {
|
|
2067
2067
|
|
2068
2068
|
void
|
2069
2069
|
oj_str_writer_push_object(StrWriter sw, const char *key) {
|
2070
|
-
|
2070
|
+
long size;
|
2071
2071
|
|
2072
2072
|
key_check(sw, key);
|
2073
2073
|
size = sw->depth * sw->out.indent + 3;
|
2074
|
-
if (sw->out.end - sw->out.cur <= size) {
|
2074
|
+
if (sw->out.end - sw->out.cur <= (long)size) {
|
2075
2075
|
grow(&sw->out, size);
|
2076
2076
|
}
|
2077
2077
|
maybe_comma(sw);
|
@@ -2086,7 +2086,7 @@ oj_str_writer_push_object(StrWriter sw, const char *key) {
|
|
2086
2086
|
|
2087
2087
|
void
|
2088
2088
|
oj_str_writer_push_array(StrWriter sw, const char *key) {
|
2089
|
-
|
2089
|
+
long size;
|
2090
2090
|
|
2091
2091
|
key_check(sw, key);
|
2092
2092
|
size = sw->depth * sw->out.indent + 3;
|
@@ -2104,7 +2104,7 @@ oj_str_writer_push_array(StrWriter sw, const char *key) {
|
|
2104
2104
|
|
2105
2105
|
void
|
2106
2106
|
oj_str_writer_push_value(StrWriter sw, VALUE val, const char *key) {
|
2107
|
-
|
2107
|
+
long size;
|
2108
2108
|
|
2109
2109
|
key_check(sw, key);
|
2110
2110
|
size = sw->depth * sw->out.indent + 3;
|
@@ -2121,7 +2121,7 @@ oj_str_writer_push_value(StrWriter sw, VALUE val, const char *key) {
|
|
2121
2121
|
|
2122
2122
|
void
|
2123
2123
|
oj_str_writer_pop(StrWriter sw) {
|
2124
|
-
|
2124
|
+
long size;
|
2125
2125
|
DumpType type = sw->types[sw->depth];
|
2126
2126
|
|
2127
2127
|
sw->depth--;
|
data/ext/oj/oj.c
CHANGED
@@ -1074,17 +1074,17 @@ stream_writer_new(int argc, VALUE *argv, VALUE self) {
|
|
1074
1074
|
int fd = 0;
|
1075
1075
|
VALUE stream = argv[0];
|
1076
1076
|
VALUE clas = rb_obj_class(stream);
|
1077
|
-
VALUE s;
|
1078
1077
|
StreamWriter sw;
|
1078
|
+
#if !IS_WINDOWS
|
1079
|
+
VALUE s;
|
1080
|
+
#endif
|
1079
1081
|
|
1080
1082
|
if (oj_stringio_class == clas) {
|
1081
1083
|
type = STRING_IO;
|
1082
|
-
#ifndef JRUBY_RUBY
|
1083
1084
|
#if !IS_WINDOWS
|
1084
1085
|
} else if (rb_respond_to(stream, oj_fileno_id) && Qnil != (s = rb_funcall(stream, oj_fileno_id, 0))) {
|
1085
1086
|
type = FILE_IO;
|
1086
1087
|
fd = FIX2INT(s);
|
1087
|
-
#endif
|
1088
1088
|
#endif
|
1089
1089
|
} else if (rb_respond_to(stream, oj_write_id)) {
|
1090
1090
|
type = STREAM_IO;
|
@@ -1578,6 +1578,7 @@ define_mimic_json(int argc, VALUE *argv, VALUE self) {
|
|
1578
1578
|
return mimic;
|
1579
1579
|
}
|
1580
1580
|
|
1581
|
+
/*
|
1581
1582
|
extern void oj_hash_test();
|
1582
1583
|
|
1583
1584
|
static VALUE
|
@@ -1585,6 +1586,7 @@ hash_test(VALUE self) {
|
|
1585
1586
|
oj_hash_test();
|
1586
1587
|
return Qnil;
|
1587
1588
|
}
|
1589
|
+
*/
|
1588
1590
|
|
1589
1591
|
#if !HAS_ENCODING_SUPPORT
|
1590
1592
|
static VALUE
|
@@ -1650,7 +1652,7 @@ void Init_oj() {
|
|
1650
1652
|
oj_utf8_encoding = Qnil;
|
1651
1653
|
#endif
|
1652
1654
|
|
1653
|
-
rb_define_module_function(Oj, "hash_test", hash_test, 0);
|
1655
|
+
//rb_define_module_function(Oj, "hash_test", hash_test, 0);
|
1654
1656
|
|
1655
1657
|
rb_define_module_function(Oj, "default_options", get_def_opts, 0);
|
1656
1658
|
rb_define_module_function(Oj, "default_options=", set_def_opts, 1);
|
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: 2.4.
|
4
|
+
version: 2.4.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: 2013-12-
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'The fastest JSON parser and object serializer. '
|
14
14
|
email: peter@ohler.com
|