Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 59 lines (38 sloc) 1.558 kB
6248665 ready for use with limitations
Peter Ohler authored
1 # Oj gem
2 A fast JSON parser and Object marshaller as a Ruby gem.
3
4 ## <a name="installation">Installation</a>
5 gem install oj
6
7 ## <a name="source">Source</a>
8
9 *GitHub* *repo*: https://github.com/ohler55/oj
10
11 *RubyGems* *repo*: https://rubygems.org/gems/oj
12
13 ## <a name="build_status">Build Status</a>
14
da0330c getting the travis image to show status
Peter Ohler authored
15 [![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
6248665 ready for use with limitations
Peter Ohler authored
16
17 ## <a name="links">Links of Interest</a>
18
19 ## <a name="release">Release Notes</a>
20
21 ### Release 0.5
22
23 This is the first release sith a version of 0.5 indicating it is only half
24 done. Basic load() and dump() is supported for Hash, Array, NilClass,
25 TrueClass, FalseClass, Fixnum, Float, Symbol, and String Objects.
26
27 ## <a name="description">Description</a>
28
29 Optimized JSON (Oj), as the name implies was written to provide speed
30 optimized JSON handling. It was designed as a faster alternative to Yajl and
31 other the common Ruby JSON parsers. So far is has achieved that at about 2
32 time faster than Yajl for parsing and 3 or more times faster writing JSON.
33
34 Coming soon: As an Object marshaller with support for circular references.
35
36 Coming soon: A SAX like JSON stream parser.
37
38 Oj is compatible with Ruby 1.8.7, 1.9.2, 1.9.3, JRuby, and RBX.
39
40 ### Simple JSON Writing and Parsing:
41
42 require 'oj'
43
44 h = { 'one' => 1, 'array' => [ true, false ] }
45 json = Oj.dump(h)
46
47 # json =
48 # {
49 # "one":1,
50 # "array":[
51 # true,
52 # false
53 # ]
54 # }
55
56 h2 = Oj.parse(json)
57 puts "Same? #{h == h2}"
58 # true
Something went wrong with that request. Please try again.