yajl-ruby 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yajl-ruby might be problematic. Click here for more details.

data/.gitignore CHANGED
@@ -5,4 +5,5 @@ benchmark/subjects/contacts.*
5
5
  *.dylib
6
6
  *.bundle
7
7
  TODO.txt
8
- tmp/*
8
+ tmp/*
9
+ pkg/*
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
@@ -2,4 +2,4 @@
2
2
  :major: 0
3
3
  :minor: 7
4
4
  :build:
5
- :patch: 0
5
+ :patch: 1
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), 1);
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), quote_strings);
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, int quote)
219
+ unsigned int len)
220
220
  {
221
221
  ENSURE_VALID_STATE; INSERT_SEP; INSERT_WHITESPACE;
222
- if (quote) {
223
- g->print(g->ctx, "\"", 1);
224
- yajl_string_encode2(g->print, g->ctx, str, len);
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.0"
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)
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
3
3
 
4
4
  class Dummy2
5
5
  def to_json
6
- '"hawtness"'
6
+ "hawtness"
7
7
  end
8
8
  end
9
9
 
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.0"
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-05}
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.0
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-05 00:00:00 -08:00
13
+ date: 2010-02-17 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies: []
16
16