yajl-ruby 0.7.0 → 0.7.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.
Potentially problematic release.
This version of yajl-ruby might be problematic. Click here for more details.
- data/.gitignore +2 -1
- data/CHANGELOG.md +3 -0
- data/VERSION.yml +1 -1
- data/ext/api/yajl_gen.h +2 -3
- data/ext/yajl_ext.c +2 -4
- data/ext/yajl_gen.c +4 -12
- data/lib/yajl.rb +1 -1
- data/spec/encoding/encoding_spec.rb +1 -1
- data/yajl-ruby.gemspec +2 -2
- metadata +2 -2
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.7.1 (February 17th, 2010)
|
4
|
+
* revert a patch made to bundled Yajl enabling optional quoting of strings that broke binary API compatibility
|
5
|
+
|
3
6
|
## 0.7.0 (February 5th, 2010)
|
4
7
|
* ensure utf8 encoding is set on relevant strings during parse/encode in 1.9
|
5
8
|
|
data/VERSION.yml
CHANGED
data/ext/api/yajl_gen.h
CHANGED
@@ -132,10 +132,9 @@ extern "C" {
|
|
132
132
|
unsigned int len);
|
133
133
|
yajl_gen_status YAJL_API yajl_gen_string(yajl_gen hand,
|
134
134
|
const unsigned char * str,
|
135
|
-
unsigned int len
|
136
|
-
int quote);
|
135
|
+
unsigned int len);
|
137
136
|
yajl_gen_status YAJL_API yajl_gen_null(yajl_gen hand);
|
138
|
-
yajl_gen_status YAJL_API yajl_gen_bool(yajl_gen hand, int boolean);
|
137
|
+
yajl_gen_status YAJL_API yajl_gen_bool(yajl_gen hand, int boolean);
|
139
138
|
yajl_gen_status YAJL_API yajl_gen_map_open(yajl_gen hand);
|
140
139
|
yajl_gen_status YAJL_API yajl_gen_map_close(yajl_gen hand);
|
141
140
|
yajl_gen_status YAJL_API yajl_gen_array_open(yajl_gen hand);
|
data/ext/yajl_ext.c
CHANGED
@@ -132,7 +132,6 @@ void yajl_encode_part(void * wrapper, VALUE obj, VALUE io) {
|
|
132
132
|
const unsigned char * buffer;
|
133
133
|
const char * cptr;
|
134
134
|
unsigned int len;
|
135
|
-
int quote_strings = 1;
|
136
135
|
|
137
136
|
if (io != Qnil || w->on_progress_callback != Qnil) {
|
138
137
|
status = yajl_gen_get_buf(w->encoder, &buffer, &len);
|
@@ -194,17 +193,16 @@ void yajl_encode_part(void * wrapper, VALUE obj, VALUE io) {
|
|
194
193
|
break;
|
195
194
|
case T_STRING:
|
196
195
|
cptr = RSTRING_PTR(obj);
|
197
|
-
status = yajl_gen_string(w->encoder, (const unsigned char *)cptr, (unsigned int)strlen(cptr)
|
196
|
+
status = yajl_gen_string(w->encoder, (const unsigned char *)cptr, (unsigned int)strlen(cptr));
|
198
197
|
break;
|
199
198
|
default:
|
200
199
|
if (rb_respond_to(obj, intern_to_json)) {
|
201
200
|
str = rb_funcall(obj, intern_to_json, 0);
|
202
|
-
quote_strings = 0; /* this lets us append on to the buffer without Yajl quoting it again */
|
203
201
|
} else {
|
204
202
|
str = rb_funcall(obj, intern_to_s, 0);
|
205
203
|
}
|
206
204
|
cptr = RSTRING_PTR(str);
|
207
|
-
status = yajl_gen_string(w->encoder, (const unsigned char *)cptr, (unsigned int)strlen(cptr)
|
205
|
+
status = yajl_gen_string(w->encoder, (const unsigned char *)cptr, (unsigned int)strlen(cptr));
|
208
206
|
break;
|
209
207
|
}
|
210
208
|
}
|
data/ext/yajl_gen.c
CHANGED
@@ -216,21 +216,13 @@ yajl_gen_number(yajl_gen g, const char * s, unsigned int l)
|
|
216
216
|
|
217
217
|
yajl_gen_status
|
218
218
|
yajl_gen_string(yajl_gen g, const unsigned char * str,
|
219
|
-
unsigned int len
|
219
|
+
unsigned int len)
|
220
220
|
{
|
221
221
|
ENSURE_VALID_STATE; INSERT_SEP; INSERT_WHITESPACE;
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
g->print(g->ctx, "\"", 1);
|
226
|
-
} else {
|
227
|
-
g->print(g->ctx, (const char *)str, len);
|
228
|
-
}
|
229
|
-
|
222
|
+
g->print(g->ctx, "\"", 1);
|
223
|
+
yajl_string_encode2(g->print, g->ctx, str, len);
|
224
|
+
g->print(g->ctx, "\"", 1);
|
230
225
|
|
231
|
-
APPENDED_ATOM;
|
232
|
-
FINAL_NEWLINE;
|
233
|
-
return yajl_gen_status_ok;
|
234
226
|
|
235
227
|
APPENDED_ATOM;
|
236
228
|
FINAL_NEWLINE;
|
data/lib/yajl.rb
CHANGED
@@ -13,7 +13,7 @@ require 'yajl_ext'
|
|
13
13
|
#
|
14
14
|
# Ruby bindings to the excellent Yajl (Yet Another JSON Parser) ANSI C library.
|
15
15
|
module Yajl
|
16
|
-
VERSION = "0.7.
|
16
|
+
VERSION = "0.7.1"
|
17
17
|
|
18
18
|
# For compatibility, has the same signature of Yajl::Parser.parse
|
19
19
|
def self.load(str_or_io, options={}, read_bufsize=nil, &block)
|
data/yajl-ruby.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{yajl-ruby}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Lopez", "Lloyd Hilaiel"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-17}
|
13
13
|
s.email = %q{seniorlopez@gmail.com}
|
14
14
|
s.extensions = ["ext/extconf.rb"]
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yajl-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-02-
|
13
|
+
date: 2010-02-17 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|