Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating files for 0.5.7 release

  • Loading branch information...
commit 66dbfd5399a7c96e4900fb0975762ab4bc097e85 1 parent 8603763
@brianmario brianmario authored
Showing with 16 additions and 4 deletions.
  1. +6 −0 CHANGELOG.md
  2. +7 −1 README.rdoc
  3. +1 −1  lib/yajl.rb
  4. +2 −2 yajl-ruby.gemspec
View
6 CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog
+## 0.5.7 (June 23rd, 2009)
+* You can now pass parser options (like :symbolize_keys for example) to Yajl::HttpStream.get
+* Refactored spec tests a bit, DRYing up the Yajl::HttpStream specs quite a bit.
+* Added a spec rake task, and spec.opts file
+* Updated and renamed rcov rake task, and added rcov.opts file
+
## 0.5.6 (June 19th, 2009)
* Added JSON.default_options hash to the JSON gem compatibility API
* Split out the JSON gem compatibility API's parsing and encoding methods into individually includable files
View
8 README.rdoc
@@ -102,12 +102,16 @@ Since yajl-ruby parses JSON as a stream, supporting API's like Twitter's Streami
You can simply supply a block to Yajl::HttpStream.get, which is used as the callback for when a JSON object has been
unserialized off the stream. For the case of this Twitter Streaming API call, the callback gets fired a few times a second (depending on your connection speed).
The code below is all that's needed to make the request and stream unserialized Ruby hashes off the response, continuously.
+You'll note that I've enabled the :symbolize_keys parser option as well. Doing so is much more efficient for parsing JSON streams with
+lots of repetitive keys - for things like result sets or multiple API requests - than the same parse with string keys.
+This is because Ruby will reuse (and never GC) it's symbol table. Be that as it may, if you want to parse JSON strings with random key names
+it's much better to leave string keys enabled (the default), so they can get GC'd later.
require 'uri'
require 'yajl/http_stream'
uri = URI.parse("http://#{username}:#{password}@stream.twitter.com/spritzer.json")
- Yajl::HttpStream.get(uri) do |hash|
+ Yajl::HttpStream.get(uri, :symbolize_keys => true) do |hash|
puts hash.inspect
end
@@ -252,6 +256,8 @@ This project includes code from the BSD licensed yajl project, copyright 2007-20
== Special Thanks
+For those of you using yajl-ruby out in the wild, please hit me up on Twitter (brianmario) or send me a message here on the Githubs describing the site and how you're using it. I'd love to get a list going!
+
I've had a lot of inspiration, and a lot of help. Thanks to everyone who's been a part of this and those to come!
* Lloyd Hilaiel - http://github.com/lloyd - for writing Yajl!!
View
2  lib/yajl.rb
@@ -13,7 +13,7 @@
#
# Ruby bindings to the excellent Yajl (Yet Another JSON Parser) ANSI C library.
module Yajl
- VERSION = "0.5.6"
+ VERSION = "0.5.7"
class Parser
# A helper method for parse-and-forget use-cases
View
4 yajl-ruby.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{yajl-ruby}
- s.version = "0.5.6"
+ s.version = "0.5.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Lopez", "Lloyd Hilaiel"]
- s.date = %q{2009-06-22}
+ s.date = %q{2009-06-23}
s.email = %q{seniorlopez@gmail.com}
s.extensions = ["ext/extconf.rb"]
s.extra_rdoc_files = [
Please sign in to comment.
Something went wrong with that request. Please try again.