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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 873b6fade9db8e2c3e82c5a6329c4ceb09215d6d
4
- data.tar.gz: 4f8074a9a5ac20d567c58d002323949fc08828ce
3
+ metadata.gz: 9262e646eacc8cec4f6eceb06d4f5c84370d62a1
4
+ data.tar.gz: 1de9d17fe6bcfa76e5da8d61d239853f7948421c
5
5
  SHA512:
6
- metadata.gz: f82b5aedde38474ca0ddd6826f11ed4fa02bf17fbcf6a56ba14dca772c9e3000119d15d81c092f4dae9000a7dec6ca2c1a7c971a2b854a54d68a50586ab8f2d4
7
- data.tar.gz: 8935ab29251ca82de0c9b770df24a0015bc6e46dc0f1cdfba6868ddc23b685306b8c4c4a1d182559ada38f654a8f9dbd199d4b68f9670a18d65fc7c45370eecf
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.0
24
+ ### Current Release 2.4.1
25
25
 
26
- - Merged in a PR to again allow strings with embedded nulls.
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
 
@@ -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
- size_t size;
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
- size_t size;
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
- size_t size;
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
- size_t size;
2124
+ long size;
2125
2125
  DumpType type = sw->types[sw->depth];
2126
2126
 
2127
2127
  sw->depth--;
@@ -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);
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.4.0'
4
+ VERSION = '2.4.1'
5
5
  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: 2.4.0
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-08 00:00:00.000000000 Z
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