oj 2.9.2 → 2.9.3

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: b407855f298c79a1a5aa4533773acb82bfbf8506
4
- data.tar.gz: 7f4c484232b2fd3af6c124e7e773b8a11ce91ea5
3
+ metadata.gz: 48a00c99e1a81e8db2d4d074dd75c207d35dba89
4
+ data.tar.gz: a7945af118f56ce1b883ee8df51fac93c692714b
5
5
  SHA512:
6
- metadata.gz: 939e9faafb18e2012621e4aad5fda45c2f2e832139c150d7d01f87fc2d891c0cc7df362d9b9aa1f9cf746efa4db7524aeea8626f91b6379eab0c07a374b27ff6
7
- data.tar.gz: 68da1860ac19fc5304f0c4fd9ef3e9afe8677c3715765a3039f82d36c9678e02c41701bf2f27302e847cf9bff6adbdb64901318cbfa78bd7fd3132a5ef3a8ef3
6
+ metadata.gz: 7a31a3c396f291fd4c9c851b2a3d2d6ad85582abd30046251757e44f73e3146319daa543d23f707226d32507bbe55695274a08706c8a2d2546f3c1b328a69a7a
7
+ data.tar.gz: 1f8979189385a752ec69bde1611728bc9d382608c251d3e59252268e6622f2dd9b6d3f37335663d041790e036802fb8871739275d247d3ba41873f3d3db378f2
data/README.md CHANGED
@@ -26,21 +26,10 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
26
26
 
27
27
  [![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
28
28
 
29
- ### Current Release 2.9.2
29
+ ### Current Release 2.9.3
30
30
 
31
- - Fixed link error with Windows.
32
-
33
- ### Current Release 2.9.1
34
-
35
- - Fixed mimic load when given a block to evalate. It conflicted with the new
36
- load option.
37
-
38
- - Added a true stream that is used when the input argument to load is an IO
39
- object such as a stream or file. This is slightly slower for smaller files
40
- but allows reading of huge files that will not fit in memory and is more
41
- efficient on even larger files that would fit into memory. The load_file()
42
- method uses the new stream parser so multiple GB files can be processed
43
- without used execessive memory.
31
+ - Fixed IO read error that showed up in IO objects that return nil instead of
32
+ raising an EOF error when read is done.
44
33
 
45
34
  [Older release notes](http://www.ohler.com/dev/oj_misc/release_notes.html).
46
35
 
@@ -163,11 +163,7 @@ oj_reader_read(Reader reader) {
163
163
 
164
164
  static VALUE
165
165
  rescue_cb(VALUE rbuf, VALUE err) {
166
- #if (defined(RUBINIUS_RUBY) || (1 == RUBY_VERSION_MAJOR && 8 == RUBY_VERSION_MINOR))
167
- if (rb_obj_class(err) != rb_eTypeError) {
168
- #else
169
- if (rb_obj_class(err) != rb_eEOFError) {
170
- #endif
166
+ if (rb_eTypeError != rb_obj_class(err)) {
171
167
  Reader reader = (Reader)rbuf;
172
168
 
173
169
  rb_raise(err, "at line %d, column %d\n", reader->line, reader->col);
@@ -185,8 +181,11 @@ partial_io_cb(VALUE rbuf) {
185
181
 
186
182
  args[0] = ULONG2NUM(reader->end - reader->tail);
187
183
  rstr = rb_funcall2(reader->io, oj_readpartial_id, 1, args);
184
+ if (Qnil == rstr) {
185
+ return Qfalse;
186
+ }
188
187
  str = StringValuePtr(rstr);
189
- cnt = strlen(str);
188
+ cnt = RSTRING_LEN(rstr);
190
189
  //printf("*** read %lu bytes, str: '%s'\n", cnt, str);
191
190
  strcpy(reader->tail, str);
192
191
  reader->read_end = reader->tail + cnt;
@@ -204,8 +203,11 @@ io_cb(VALUE rbuf) {
204
203
 
205
204
  args[0] = ULONG2NUM(reader->end - reader->tail);
206
205
  rstr = rb_funcall2(reader->io, oj_read_id, 1, args);
206
+ if (Qnil == rstr) {
207
+ return Qfalse;
208
+ }
207
209
  str = StringValuePtr(rstr);
208
- cnt = strlen(str);
210
+ cnt = RSTRING_LEN(rstr);
209
211
  //printf("*** read %lu bytes, str: '%s'\n", cnt, str);
210
212
  strcpy(reader->tail, str);
211
213
  reader->read_end = reader->tail + cnt;
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.9.2'
4
+ VERSION = '2.9.3'
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.9.2
4
+ version: 2.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'The fastest JSON parser and object serializer. '
14
14
  email: peter@ohler.com
@@ -136,4 +136,3 @@ signing_key:
136
136
  specification_version: 4
137
137
  summary: A fast JSON parser and serializer.
138
138
  test_files: []
139
- has_rdoc: true