brianmario-yajl-ruby 0.5.1 → 0.5.2
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.
- data/CHANGELOG.md +141 -0
- data/README.rdoc +10 -0
- data/VERSION.yml +1 -1
- data/benchmark/encode.rb +1 -0
- data/benchmark/encode_json_and_marshal.rb +1 -0
- data/benchmark/encode_json_and_yaml.rb +0 -1
- data/benchmark/http.rb +1 -2
- data/benchmark/parse_stream.rb +1 -1
- data/examples/http/twitter_stream_api.rb +2 -1
- data/ext/yajl_ext.c +5 -3
- data/ext/yajl_ext.h +2 -1
- data/ext/yajl_gen.c +1 -4
- data/lib/yajl.rb +22 -9
- data/spec/encoding/encoding_spec.rb +29 -0
- data/spec/parsing/one_off_spec.rb +5 -0
- data/yajl-ruby.gemspec +4 -5
- metadata +3 -4
- data/CHANGELOG.rdoc +0 -141
data/CHANGELOG.md
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.5.2 (May 30th, 2009)
|
4
|
+
* Added class helper methods Yajl::Encoder.encode(obj, io) and Yajl::Parser.parse(io)
|
5
|
+
* added tests for the above
|
6
|
+
* Updated Twitter streaming example to have a less verbose output
|
7
|
+
* Patch Yajl so encoding can continue as a stream
|
8
|
+
* IE: multiple objects encoded onto the same IO
|
9
|
+
* added a test for the above
|
10
|
+
* Set the internal read buffer size back down to 8kb by default
|
11
|
+
* Added an internal write buffer size (set to 8kb by default) which is used to throttle writes to the output stream
|
12
|
+
* This is to fix a major performance bug/issue with the IO#write C method in ruby 1.9.x (I've opened a bug with them about it)
|
13
|
+
* Fixed a typo in a one-off parsing spec test
|
14
|
+
* Updated benchmarks to work properly in 1.9 (required removal ActiveSupport benchmarking for now)
|
15
|
+
* Updated spec tests to respect ridiculous differences in hash key ordering between 1.8 and 1.9
|
16
|
+
|
17
|
+
|
18
|
+
## 0.5.1 (May 25th, 2009)
|
19
|
+
* added some more tests for the new API
|
20
|
+
* inlined a couple of hot functions used in parsing for a little speedup
|
21
|
+
* updates to readme, reflecting changes in API
|
22
|
+
* version bump to push another gem build
|
23
|
+
|
24
|
+
## 0.5.0 (May 25th, 2009)
|
25
|
+
* Refactored internal API so the caller can specify initialization options for the Parser and Encoder respectively. Two new classes were introduced as a result - Yajl::Parser and Yajl::Encoder. The newly refactored codebase is cleaner, thread-safe and removed all of the hack-code that was trickled around to make things work in the previous implementation. She's much more seaworthy now cap'n!
|
26
|
+
* Yajl::Parser.new accepts two options, :allow_comments and :check_utf8 which both default to true
|
27
|
+
* Yajl::Encoder.new accepts two options, :pretty and :indent which default to false and " " respectively
|
28
|
+
* cleaned up a lot of state code, that to my knowledge prevented yajl-ruby from being used in a thread-safe environment.
|
29
|
+
* added deprecated messaging to Yajl::Stream.parse and Yajl::Stream.encode - these will likely go away before 0.6.0
|
30
|
+
* fixed a bug in the chunked http response parser regarding partially received chunks
|
31
|
+
* added a Twitter Search API example showing off the HttpStream API
|
32
|
+
|
33
|
+
## 0.4.9 (May 20th, 2009)
|
34
|
+
* fixed some parser state bugs surfaced by edge cases
|
35
|
+
* added support for Chunked HTTP response bodies in Yajl::HttpStream
|
36
|
+
* added support for passing a block to Yajl::HttpStream.get that will be used as a callback whenever a JSON object is parsed off the stream (even if there is more than one!)
|
37
|
+
* added an examples folder, and put an example using the Twitter Streaming API in there to start
|
38
|
+
* added some more spec tests, this time around Chunked parsing and continuously parsing multiple JSON strings
|
39
|
+
|
40
|
+
## 0.4.8 (May 18th, 2009)
|
41
|
+
* fixed a totally bone-head compilation problem, I created for myself ;)
|
42
|
+
|
43
|
+
## 0.4.7 (May 18th, 2009)
|
44
|
+
* Bundling Yajl sources to remove the need to install them (and CMake) separately (Thank you Lloyd!!!) This means you can now simply install the gem and be off and running
|
45
|
+
* Added some spec tests for Yajl::HttpStream
|
46
|
+
* Added some spec tests for Yajl::Stream.encode
|
47
|
+
* added some more thank you's, where credit's due - in the readme
|
48
|
+
* updated the unicode.json file to reflect a "real-life" JSON response
|
49
|
+
* reorganized spec tests into their functional areas
|
50
|
+
* added an rcov rake task to generate code coverage output
|
51
|
+
|
52
|
+
## 0.4.6 (May 17th, 2009)
|
53
|
+
* Applied a patch from benburkert (http://github.com/benburkert) to fix HTTP Basic Auth in Yajl::HttpStream.get
|
54
|
+
|
55
|
+
## 0.4.5 (May 17th, 2009)
|
56
|
+
* added Yajl::Stream.encode(hash, io)
|
57
|
+
* generates a JSON string stream, and writes to IO
|
58
|
+
* compressed StreamWriter helpers added as well
|
59
|
+
* fixed a pretty lame segfault in (x86_64 only?) ubuntu/linux
|
60
|
+
* changed the compiled extension to have a more specific name (yajl_ext) for easier loading
|
61
|
+
* removed forced-load of .bundle file, for the rest of the planet aside from OSX users
|
62
|
+
* added some more benchmarks to compare to other forms of serialization in Ruby
|
63
|
+
* various readme updates
|
64
|
+
|
65
|
+
## 0.4.4 (May 12th, 2009)
|
66
|
+
* NOTE: Breaking API change:
|
67
|
+
* renamed Yajl::GzipStreamReader to Yajl::Gzip::StreamReader
|
68
|
+
* added Yajl::Bzip2::StreamReader
|
69
|
+
* depends on the bzip2-ruby gem if you want to use it, if not Yajl::Bzip2 won't be loaded
|
70
|
+
* added Yajl::Deflate::StreamReader
|
71
|
+
* actually uses Zlib::Inflate for stream decompression
|
72
|
+
* added parse(io) class methods to Yajl::Gzip::StreamReader and Yajl::Bzip2::StreamReader as a helper for parsing compressed streams.
|
73
|
+
* updated Yajl::HttpStream to request responses compressed as deflate and bzip2 in addition to gzip
|
74
|
+
* fixed a bug regarding parsing Integers as Floats (so 123456 would have be parsed and returned as 123456.0)
|
75
|
+
* fixed a bug which caused a segfault in ruby's GC during string replacement in Yajl::Gzip and Yajl::Bzip2's StreamReader#read methods
|
76
|
+
* added support for user-specified User-Agent strings in Yajl::HttpStream
|
77
|
+
|
78
|
+
## 0.4.3 (May 2nd, 2009)
|
79
|
+
* adding text/plain as an allowed mime-type for Yajl::HttpStream for webservers that respond with it instead of application/json (ahem...Yelp...)
|
80
|
+
* renamed specs folder to spec for no reason at all
|
81
|
+
|
82
|
+
## 0.4.2 (April 30th, 2009)
|
83
|
+
* Yajl::HttpStream is now sending "proper" http request headers
|
84
|
+
* Yajl::HttpStream will request HTTP-Basic auth if credentials are provided in the passed URI
|
85
|
+
* cleanup requires
|
86
|
+
|
87
|
+
## 0.4.1 (April 30th, 2009)
|
88
|
+
* fixed a typo in the stream.rb benchmark file
|
89
|
+
* fixed a bug in Yajl::Stream.parse that was causing "strange" Ruby malloc errors on large files, with large strings
|
90
|
+
* added Yajl::GzipStreamReader as a wrapper around Zlib::GzipReader to allow for standard IO#read behavior
|
91
|
+
* this allows Yajl::Stream to read off of a Gzip stream directly
|
92
|
+
|
93
|
+
## 0.4.0 (April 29th, 2009)
|
94
|
+
* NOTE: Breaking API change:
|
95
|
+
* refactored Stream parsing methods out of Yajl::Native into Yajl::Stream
|
96
|
+
* removed Yajl::Native namespace/module
|
97
|
+
* Addition of Yajl::HttpStream module
|
98
|
+
* This module is for streaming JSON HTTP responses directly into Yajl (as they're being received) for increased awesomeness
|
99
|
+
* it currently supports basic get requests with Yajl::HttpStream.get(uri)
|
100
|
+
* it also supports (and prefers) output compressed (gzip) responses
|
101
|
+
* Addition Yajl::Chunked module
|
102
|
+
* This module is for feeding Yajl JSON pieces at a time, instead of an entire IO object
|
103
|
+
* This works very well in environments like an EventMachine app where data is received in chunks by design
|
104
|
+
* decreased read buffer for Yajl::Stream from 8kb to 4kb
|
105
|
+
|
106
|
+
## 0.3.4 (April 24th, 2009)
|
107
|
+
* turned Unicode checks back on in the Yajl parser now that it's fixed (thanks Lloyd!)
|
108
|
+
* this also bumps the yajl version dependency requirement to 1.0.4
|
109
|
+
* better guessing of Integer/Float from number found instead of just trying to create a BigNum no matter what
|
110
|
+
* changed extconf.rb to fail Makefile creation if yajl isn't found
|
111
|
+
* added a test to check for parsing Infinity due to a Float overflow
|
112
|
+
|
113
|
+
## 0.3.3 (April 24th, 2009)
|
114
|
+
* 1.9 compatibility
|
115
|
+
|
116
|
+
## 0.3.2 (April 24th, 2009)
|
117
|
+
* version bump: forgot to include yajl.c in the gem
|
118
|
+
|
119
|
+
## 0.3.1 (April 23rd, 2009)
|
120
|
+
* fixed borked gemspec
|
121
|
+
|
122
|
+
## 0.3.0 (April 23rd, 2009)
|
123
|
+
* slight refactor of ActiveSupport tests to better reflect how they actually exist in ActiveSupport
|
124
|
+
* typo correction in the changelog which had the years in 2008
|
125
|
+
* added some initial spec tests
|
126
|
+
* ported some from ActiveSupport to ensure proper compatibility
|
127
|
+
* included 57 JSON fixtures to test against, all of which pass
|
128
|
+
* changed parser config to not check for invalid unicode characters as Ruby is going to do this anyway (?). This resolves the remaining test failures around unicode.
|
129
|
+
* changed how the parser was dealing with numbers to prevent overflows
|
130
|
+
* added an exception class Yajl::ParseError which is now used in place of simply printing to STDERR upon a parsing error
|
131
|
+
* renamed a couple of JSON test files in the benchmark folder to better represent their contents
|
132
|
+
* misc README updates
|
133
|
+
|
134
|
+
## 0.2.1 (April 23rd, 2009)
|
135
|
+
* fixed parsing bug - also fixed failing ActiveSupport test failures (except for the unicode one, which is an issue in Yajl itself)
|
136
|
+
|
137
|
+
## 0.2.0 (April 22nd, 2009)
|
138
|
+
* updated gemspec and README
|
139
|
+
|
140
|
+
## 0.1.0 (April 21st, 2009)
|
141
|
+
* initial release - gemified
|
data/README.rdoc
CHANGED
@@ -123,6 +123,16 @@ Or what if you wanted to compress the stream over the wire?
|
|
123
123
|
hash = {:foo => 12425125, :bar => "some string", ... }
|
124
124
|
Yajl::Gzip::StreamWriter.encode(hash, socket)
|
125
125
|
|
126
|
+
Or what about encoding multiple objects to JSON over the same stream?
|
127
|
+
This example will encode and send 50 JSON objects over the same stream, continuously.
|
128
|
+
|
129
|
+
socket = TCPSocket.new(192.168.1.101, 9000)
|
130
|
+
encoder = Yajl::Encoder.new
|
131
|
+
50.times do
|
132
|
+
hash = {:current_time => Time.now.to_f, :foo => 12425125}
|
133
|
+
encoder.encode(hash, socket)
|
134
|
+
end
|
135
|
+
|
126
136
|
You can also use Yajl::Bzip2::StreamWriter and Yajl::Deflate::StreamWriter. So you can pick whichever fits your CPU/bandwidth sweet-spot.
|
127
137
|
|
128
138
|
There are a lot more possibilities, some of which I'm going to write other gems/plugins for.
|
data/VERSION.yml
CHANGED
data/benchmark/encode.rb
CHANGED
data/benchmark/http.rb
CHANGED
data/benchmark/parse_stream.rb
CHANGED
@@ -13,7 +13,7 @@ json.read
|
|
13
13
|
json.rewind
|
14
14
|
|
15
15
|
times = ARGV[0] ? ARGV[0].to_i : 1
|
16
|
-
puts "Starting benchmark parsing JSON stream (#{File.size(filename)} bytes of JSON data) #{times} times\n\n"
|
16
|
+
puts "Starting benchmark parsing JSON stream (#{File.size(filename)} bytes of JSON data with 430 JSON separate strings) #{times} times\n\n"
|
17
17
|
Benchmark.bm { |x|
|
18
18
|
parser = Yajl::Parser.new
|
19
19
|
parser.on_parse_complete = lambda { |obj|
|
data/ext/yajl_ext.c
CHANGED
@@ -59,9 +59,11 @@ void yajl_encode_part(yajl_gen hand, VALUE obj, VALUE io) {
|
|
59
59
|
unsigned int len;
|
60
60
|
|
61
61
|
yajl_gen_get_buf(hand, &buffer, &len);
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
if (len >= WRITE_BUFSIZE) {
|
63
|
+
outBuff = rb_str_new((const char *)buffer, len);
|
64
|
+
rb_io_write(io, outBuff);
|
65
|
+
yajl_gen_clear(hand);
|
66
|
+
}
|
65
67
|
|
66
68
|
switch (TYPE(obj)) {
|
67
69
|
case T_HASH:
|
data/ext/yajl_ext.h
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
#include "api/yajl_gen.h"
|
3
3
|
#include <ruby.h>
|
4
4
|
|
5
|
-
#define READ_BUFSIZE
|
5
|
+
#define READ_BUFSIZE 8092
|
6
|
+
#define WRITE_BUFSIZE 8092
|
6
7
|
|
7
8
|
static VALUE cParseError, mYajl, cParser, cEncoder;
|
8
9
|
static ID intern_io_read, intern_eof, intern_call, intern_keys, intern_to_s,
|
data/ext/yajl_gen.c
CHANGED
@@ -138,9 +138,6 @@ yajl_gen_free(yajl_gen g)
|
|
138
138
|
|
139
139
|
#define APPENDED_ATOM \
|
140
140
|
switch (g->state[g->depth]) { \
|
141
|
-
case yajl_gen_start: \
|
142
|
-
g->state[g->depth] = yajl_gen_complete; \
|
143
|
-
break; \
|
144
141
|
case yajl_gen_map_start: \
|
145
142
|
case yajl_gen_map_key: \
|
146
143
|
g->state[g->depth] = yajl_gen_map_val; \
|
@@ -156,7 +153,7 @@ yajl_gen_free(yajl_gen g)
|
|
156
153
|
} \
|
157
154
|
|
158
155
|
#define FINAL_NEWLINE \
|
159
|
-
if (g->
|
156
|
+
if (g->state[g->depth] == yajl_gen_start) \
|
160
157
|
yajl_buf_append(g->buf, "\n", 1);
|
161
158
|
|
162
159
|
yajl_gen_status
|
data/lib/yajl.rb
CHANGED
@@ -13,26 +13,39 @@ 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.5.
|
16
|
+
VERSION = "0.5.2"
|
17
17
|
|
18
18
|
# == Yajl::Parser
|
19
19
|
#
|
20
|
-
# This
|
21
|
-
#
|
22
|
-
# The only basic requirment currently is that the IO object respond to #read(len) and eof?
|
23
|
-
#
|
20
|
+
# This class contains methods for parsing JSON directly from an IO object.
|
21
|
+
# The only basic requirment currently is that the IO object respond to #read(len) and #eof?
|
24
22
|
# The IO is parsed until a complete JSON object has been read and a ruby object will be returned.
|
25
|
-
class Parser
|
23
|
+
class Parser
|
24
|
+
def self.parse(io, options={})
|
25
|
+
new(options).parse(io)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# == Yajl::Encoder
|
30
|
+
#
|
31
|
+
# This class contains methods for encoding a Ruby object into JSON, streaming it's output into an IO object.
|
32
|
+
# The IO object need only respond to #write(str)
|
33
|
+
# The JSON stream created is written to the IO in chunks, as it's being created.
|
34
|
+
class Encoder
|
35
|
+
def self.encode(obj, io, options={})
|
36
|
+
new(options).encode(obj, io)
|
37
|
+
end
|
38
|
+
end
|
26
39
|
|
27
|
-
# Deprecated
|
40
|
+
# Deprecated - See Yajl::Parser and Yajl::Encoder
|
28
41
|
module Stream
|
29
|
-
# Deprecated
|
42
|
+
# Deprecated - See Yajl::Parser
|
30
43
|
def self.parse(io)
|
31
44
|
STDERR.puts "WARNING: Yajl::Stream has be deprecated and will most likely be gone in the next release. Use the Yajl::Parser class instead."
|
32
45
|
Parser.new.parse(io)
|
33
46
|
end
|
34
47
|
|
35
|
-
# Deprecated
|
48
|
+
# Deprecated - See Yajl::Encoder
|
36
49
|
def self.encode(obj, io)
|
37
50
|
STDERR.puts "WARNING: Yajl::Stream has be deprecated and will most likely be gone in the next release. Use the Yajl::Encoder class instead."
|
38
51
|
Encoder.new.encode(obj, io)
|
@@ -28,6 +28,9 @@ describe "Yajl JSON encoder" do
|
|
28
28
|
|
29
29
|
it "should encode with :pretty turned on and a single space indent" do
|
30
30
|
output = "{\n \"foo\": {\n \"name\": \"bar\",\n \"id\": 1234\n }\n}\n"
|
31
|
+
if RUBY_VERSION.include?('1.9') # FIXME
|
32
|
+
output = "{\n \"foo\": {\n \"id\": 1234,\n \"name\": \"bar\"\n }\n}\n"
|
33
|
+
end
|
31
34
|
obj = {:foo => {:id => 1234, :name => "bar"}}
|
32
35
|
io = StringIO.new
|
33
36
|
encoder = Yajl::Encoder.new(:pretty => true, :indent => ' ')
|
@@ -38,6 +41,9 @@ describe "Yajl JSON encoder" do
|
|
38
41
|
|
39
42
|
it "should encode with :pretty turned on and a tab character indent" do
|
40
43
|
output = "{\n\t\"foo\": {\n\t\t\"name\": \"bar\",\n\t\t\"id\": 1234\n\t}\n}\n"
|
44
|
+
if RUBY_VERSION.include?('1.9') # FIXME
|
45
|
+
output = "{\n\t\"foo\": {\n\t\t\"id\": 1234,\n\t\t\"name\": \"bar\"\n\t}\n}\n"
|
46
|
+
end
|
41
47
|
obj = {:foo => {:id => 1234, :name => "bar"}}
|
42
48
|
io = StringIO.new
|
43
49
|
encoder = Yajl::Encoder.new(:pretty => true, :indent => "\t")
|
@@ -45,4 +51,27 @@ describe "Yajl JSON encoder" do
|
|
45
51
|
io.rewind
|
46
52
|
io.read.should == output
|
47
53
|
end
|
54
|
+
|
55
|
+
it "should encode with it's class method with :pretty and a tab character indent options set" do
|
56
|
+
output = "{\n\t\"foo\": {\n\t\t\"name\": \"bar\",\n\t\t\"id\": 1234\n\t}\n}\n"
|
57
|
+
if RUBY_VERSION.include?('1.9') # FIXME
|
58
|
+
output = "{\n\t\"foo\": {\n\t\t\"id\": 1234,\n\t\t\"name\": \"bar\"\n\t}\n}\n"
|
59
|
+
end
|
60
|
+
obj = {:foo => {:id => 1234, :name => "bar"}}
|
61
|
+
io = StringIO.new
|
62
|
+
Yajl::Encoder.encode(obj, io, :pretty => true, :indent => "\t")
|
63
|
+
io.rewind
|
64
|
+
io.read.should == output
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should encode multiple objects into a single stream" do
|
68
|
+
io = StringIO.new
|
69
|
+
obj = {:foo => "bar", :baz => 1234}
|
70
|
+
encoder = Yajl::Encoder.new
|
71
|
+
5.times do
|
72
|
+
encoder.encode(obj, io)
|
73
|
+
end
|
74
|
+
io.rewind
|
75
|
+
io.read.should == "{\"foo\":\"bar\",\"baz\":1234}\n{\"foo\":\"bar\",\"baz\":1234}\n{\"foo\":\"bar\",\"baz\":1234}\n{\"foo\":\"bar\",\"baz\":1234}\n{\"foo\":\"bar\",\"baz\":1234}\n"
|
76
|
+
end
|
48
77
|
end
|
data/yajl-ruby.gemspec
CHANGED
@@ -2,20 +2,19 @@
|
|
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.2"
|
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-05-
|
9
|
+
s.date = %q{2009-05-30}
|
10
10
|
s.email = %q{seniorlopez@gmail.com}
|
11
11
|
s.extensions = ["ext/extconf.rb"]
|
12
12
|
s.extra_rdoc_files = [
|
13
|
-
"
|
14
|
-
"README.rdoc"
|
13
|
+
"README.rdoc"
|
15
14
|
]
|
16
15
|
s.files = [
|
17
16
|
".gitignore",
|
18
|
-
"CHANGELOG.
|
17
|
+
"CHANGELOG.md",
|
19
18
|
"MIT-LICENSE",
|
20
19
|
"README.rdoc",
|
21
20
|
"Rakefile",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brianmario-yajl-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
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-05-
|
13
|
+
date: 2009-05-30 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -21,11 +21,10 @@ executables: []
|
|
21
21
|
extensions:
|
22
22
|
- ext/extconf.rb
|
23
23
|
extra_rdoc_files:
|
24
|
-
- CHANGELOG.rdoc
|
25
24
|
- README.rdoc
|
26
25
|
files:
|
27
26
|
- .gitignore
|
28
|
-
- CHANGELOG.
|
27
|
+
- CHANGELOG.md
|
29
28
|
- MIT-LICENSE
|
30
29
|
- README.rdoc
|
31
30
|
- Rakefile
|
data/CHANGELOG.rdoc
DELETED
@@ -1,141 +0,0 @@
|
|
1
|
-
= Changelog
|
2
|
-
|
3
|
-
0.5.1 (May 25th, 2009)
|
4
|
-
* added some more tests for the new API
|
5
|
-
* inlined a couple of hot functions used in parsing for a little speedup
|
6
|
-
* updates to readme, reflecting changes in API
|
7
|
-
* version bump to push another gem build
|
8
|
-
|
9
|
-
0.5.0 (May 25th, 2009)
|
10
|
-
* Refactored internal API so the caller can specify initialization options for the Parser and Encoder
|
11
|
-
respectively. Two new classes were introduced as a result - Yajl::Parser and Yajl::Encoder.
|
12
|
-
The newly refactored codebase is cleaner, thread-safe and removed all of the hack-code that was trickled
|
13
|
-
around to make things work in the previous implementation. She's much more seaworthy now cap'n!
|
14
|
-
** Yajl::Parser.new accepts two options, :allow_comments and :check_utf8 which both default to true
|
15
|
-
** Yajl::Encoder.new accepts two options, :pretty and :indent which default to false and " " respectively
|
16
|
-
* cleaned up a lot of state code, that to my knowledge prevented yajl-ruby from being used in a thread-safe environment.
|
17
|
-
* added deprecated messaging to Yajl::Stream.parse and Yajl::Stream.encode - these will likely go away before 0.6.0
|
18
|
-
* fixed a bug in the chunked http response parser regarding partially received chunks
|
19
|
-
* added a Twitter Search API example showing off the HttpStream API
|
20
|
-
|
21
|
-
0.4.9 (May 20th, 2009)
|
22
|
-
* fixed some parser state bugs surfaced by edge cases
|
23
|
-
* added support for Chunked HTTP response bodies in Yajl::HttpStream
|
24
|
-
** added support for passing a block to Yajl::HttpStream.get that will be used as a callback
|
25
|
-
whenever a JSON object is parsed off the stream (even if there is more than one!)
|
26
|
-
* added an examples folder, and put an example using the Twitter Streaming API in there to start
|
27
|
-
* added some more spec tests, this time around Chunked parsing and continuously parsing
|
28
|
-
multiple JSON strings
|
29
|
-
|
30
|
-
0.4.8 (May 18th, 2009)
|
31
|
-
* fixed a totally bone-head compilation problem, I created for myself ;)
|
32
|
-
|
33
|
-
0.4.7 (May 18th, 2009)
|
34
|
-
* Bundling Yajl sources to remove the need to install them (and CMake) separately (Thank you Lloyd!!!)
|
35
|
-
This means you can now simply install the gem and be off and running
|
36
|
-
* Added some spec tests for Yajl::HttpStream
|
37
|
-
* Added some spec tests for Yajl::Stream.encode
|
38
|
-
* added some more thank you's, where credit's due - in the readme
|
39
|
-
* updated the unicode.json file to reflect a "real-life" JSON response
|
40
|
-
* reorganized spec tests into their functional areas
|
41
|
-
* added an rcov rake task to generate code coverage output
|
42
|
-
|
43
|
-
0.4.6 (May 17th, 2009)
|
44
|
-
* Applied a patch from benburkert (http://github.com/benburkert) to fix HTTP Basic Auth in
|
45
|
-
Yajl::HttpStream.get
|
46
|
-
|
47
|
-
0.4.5 (May 17th, 2009)
|
48
|
-
* added Yajl::Stream.encode(hash, io)
|
49
|
-
** generates a JSON string stream, and writes to IO
|
50
|
-
** compressed StreamWriter helpers added as well
|
51
|
-
* fixed a pretty lame segfault in (x86_64 only?) ubuntu/linux
|
52
|
-
* changed the compiled extension to have a more specific name (yajl_ext) for easier loading
|
53
|
-
* removed forced-load of .bundle file, for the rest of the planet aside from OSX users
|
54
|
-
* added some more benchmarks to compare to other forms of serialization in Ruby
|
55
|
-
* various readme updates
|
56
|
-
|
57
|
-
0.4.4 (May 12th, 2009)
|
58
|
-
* NOTE: Breaking API change:
|
59
|
-
** renamed Yajl::GzipStreamReader to Yajl::Gzip::StreamReader
|
60
|
-
* added Yajl::Bzip2::StreamReader
|
61
|
-
** depends on the bzip2-ruby gem if you want to use it, if not Yajl::Bzip2 won't be loaded
|
62
|
-
* added Yajl::Deflate::StreamReader
|
63
|
-
** actually uses Zlib::Inflate for stream decompression
|
64
|
-
* added parse(io) class methods to Yajl::Gzip::StreamReader and Yajl::Bzip2::StreamReader as
|
65
|
-
a helper for parsing compressed streams.
|
66
|
-
* updated Yajl::HttpStream to request responses compressed as deflate and bzip2 in addition
|
67
|
-
to gzip
|
68
|
-
* fixed a bug regarding parsing Integers as Floats (so 123456 would have be parsed and returned as 123456.0)
|
69
|
-
* fixed a bug which caused a segfault in ruby's GC during string replacement in Yajl::Gzip and Yajl::Bzip2's
|
70
|
-
StreamReader#read methods
|
71
|
-
* added support for user-specified User-Agent strings in Yajl::HttpStream
|
72
|
-
|
73
|
-
0.4.3 (May 2nd, 2009)
|
74
|
-
* adding text/plain as an allowed mime-type for Yajl::HttpStream for webservers that respond
|
75
|
-
with it instead of application/json (ahem...Yelp...)
|
76
|
-
* renamed specs folder to spec for no reason at all
|
77
|
-
|
78
|
-
0.4.2 (April 30th, 2009)
|
79
|
-
* Yajl::HttpStream is now sending "proper" http request headers
|
80
|
-
* Yajl::HttpStream will request HTTP-Basic auth if credentials are provided in the passed URI
|
81
|
-
* cleanup requires
|
82
|
-
|
83
|
-
0.4.1 (April 30th, 2009)
|
84
|
-
* fixed a typo in the stream.rb benchmark file
|
85
|
-
* fixed a bug in Yajl::Stream.parse that was causing "strange" Ruby malloc errors on large files, with large strings
|
86
|
-
* added Yajl::GzipStreamReader as a wrapper around Zlib::GzipReader to allow for standard IO#read behavior
|
87
|
-
** this allows Yajl::Stream to read off of a Gzip stream directly
|
88
|
-
|
89
|
-
0.4.0 (April 29th, 2009)
|
90
|
-
* NOTE: Breaking API change:
|
91
|
-
** refactored Stream parsing methods out of Yajl::Native into Yajl::Stream
|
92
|
-
** removed Yajl::Native namespace/module
|
93
|
-
* Addition of Yajl::HttpStream module
|
94
|
-
** This module is for streaming JSON HTTP responses directly into Yajl (as they're being received) for increased awesomeness
|
95
|
-
** it currently supports basic get requests with Yajl::HttpStream.get(uri)
|
96
|
-
** it also supports (and prefers) output compressed (gzip) responses
|
97
|
-
* Addition Yajl::Chunked module
|
98
|
-
** This module is for feeding Yajl JSON pieces at a time, instead of an entire IO object
|
99
|
-
** This works very well in environments like an EventMachine app where data is received in chunks by design
|
100
|
-
* decreased read buffer for Yajl::Stream from 8kb to 4kb
|
101
|
-
|
102
|
-
0.3.4 (April 24th, 2009)
|
103
|
-
* turned Unicode checks back on in the Yajl parser now that it's fixed (thanks Lloyd!)
|
104
|
-
** this also bumps the yajl version dependency requirement to 1.0.4
|
105
|
-
* better guessing of Integer/Float from number found instead of just trying to create a BigNum no matter what
|
106
|
-
* changed extconf.rb to fail Makefile creation if yajl isn't found
|
107
|
-
* added a test to check for parsing Infinity due to a Float overflow
|
108
|
-
|
109
|
-
0.3.3 (April 24th, 2009)
|
110
|
-
* 1.9 compatibility
|
111
|
-
|
112
|
-
0.3.2 (April 24th, 2009)
|
113
|
-
* version bump: forgot to include yajl.c in the gem
|
114
|
-
|
115
|
-
0.3.1 (April 23rd, 2009)
|
116
|
-
* fixed borked gemspec
|
117
|
-
|
118
|
-
0.3.0 (April 23rd, 2009)
|
119
|
-
* slight refactor of ActiveSupport tests to better reflect how they actually
|
120
|
-
exist in ActiveSupport
|
121
|
-
* typo correction in the changelog which had the years in 2008
|
122
|
-
* added some initial spec tests
|
123
|
-
** ported some from ActiveSupport to ensure proper compatibility
|
124
|
-
** included 57 JSON fixtures to test against, all of which pass
|
125
|
-
* changed parser config to not check for invalid unicode characters as Ruby is going to do this anyway (?).
|
126
|
-
This resolves the remaining test failures around unicode.
|
127
|
-
* changed how the parser was dealing with numbers to prevent overflows
|
128
|
-
* added an exception class Yajl::ParseError which is now used in place of simply printing to STDERR upon a parsing
|
129
|
-
error
|
130
|
-
* renamed a couple of JSON test files in the benchmark folder to better represent their contents
|
131
|
-
* misc README updates
|
132
|
-
|
133
|
-
0.2.1 (April 23rd, 2009)
|
134
|
-
* fixed parsing bug - also fixed failing ActiveSupport test failures
|
135
|
-
(except for the unicode one, which is an issue in Yajl itself)
|
136
|
-
|
137
|
-
0.2.0 (April 22nd, 2009)
|
138
|
-
* updated gemspec and README
|
139
|
-
|
140
|
-
0.1.0 (April 21st, 2009)
|
141
|
-
* initial release - gemified
|