yajl-ruby 0.5.8 → 0.5.9
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/CHANGELOG.md +3 -0
- data/README.rdoc +1 -1
- data/VERSION.yml +1 -1
- data/ext/yajl_ext.c +4 -0
- data/lib/yajl.rb +1 -1
- data/spec/encoding/encoding_spec.rb +4 -0
- data/yajl-ruby.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.9 (July 9th, 2009)
|
4
|
+
* Bugfix for Yajl::Encoder where encoding a hash like {:a => :b} would get stuck in an infinite loop
|
5
|
+
|
3
6
|
## 0.5.8 (July 6th, 2009)
|
4
7
|
* Bugfix in Yajl::HttpStream for proper handling of the Content-type header (Rob Sharp)
|
5
8
|
* Yajl::Encoder now has an on_progress callback setter, which can be used to harness the encoder's streaming ability.
|
data/README.rdoc
CHANGED
@@ -49,7 +49,7 @@ or maybe a StringIO
|
|
49
49
|
|
50
50
|
or maybe STDIN
|
51
51
|
|
52
|
-
cat someJsonFile.json | ruby -ryajl -e "puts Yajl::Parser.
|
52
|
+
cat someJsonFile.json | ruby -ryajl -e "puts Yajl::Parser.parse(STDIN).inspect"
|
53
53
|
|
54
54
|
|
55
55
|
Or lets say you didn't have access to the IO object that contained JSON data, but instead
|
data/VERSION.yml
CHANGED
data/ext/yajl_ext.c
CHANGED
@@ -136,6 +136,10 @@ void yajl_encode_part(void * wrapper, VALUE obj, VALUE io) {
|
|
136
136
|
case T_STRING:
|
137
137
|
status = yajl_gen_string(w->encoder, (const unsigned char *)RSTRING_PTR(obj), (unsigned int)RSTRING_LEN(obj));
|
138
138
|
break;
|
139
|
+
case T_SYMBOL:
|
140
|
+
str = rb_funcall(obj, intern_to_s, 0);
|
141
|
+
status = yajl_gen_string(w->encoder, (const unsigned char *)RSTRING_PTR(str), (unsigned int)RSTRING_LEN(str));
|
142
|
+
break;
|
139
143
|
default:
|
140
144
|
if (rb_respond_to(obj, intern_to_json)) {
|
141
145
|
str = rb_funcall(obj, intern_to_json, 0);
|
data/lib/yajl.rb
CHANGED
@@ -183,4 +183,8 @@ describe "Yajl JSON encoder" do
|
|
183
183
|
d = Dummy2.new
|
184
184
|
Yajl::Encoder.encode({:foo => d}).should eql('{"foo":"hawtness"}')
|
185
185
|
end
|
186
|
+
|
187
|
+
it "should encode a hash where the key and value can be symbols" do
|
188
|
+
Yajl::Encoder.encode({:foo => :bar}).should eql('{"foo":"bar"}')
|
189
|
+
end
|
186
190
|
end
|
data/yajl-ruby.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{yajl-ruby}
|
5
|
-
s.version = "0.5.
|
5
|
+
s.version = "0.5.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Brian Lopez", "Lloyd Hilaiel"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-09}
|
10
10
|
s.email = %q{seniorlopez@gmail.com}
|
11
11
|
s.extensions = ["ext/extconf.rb"]
|
12
12
|
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.5.
|
4
|
+
version: 0.5.9
|
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: 2009-07-
|
13
|
+
date: 2009-07-09 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|