A Ruby implementation of Rison (http://mjtemplate.org/examples/rison.html)
Ruby
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib Fix Rison.dump to encode numeric hash keys as strings Mar 30, 2016
spec Fix Rison.dump to encode numeric hash keys as strings Mar 30, 2016
.gitignore
.travis.yml
Gemfile
License.txt
README.md
Rakefile.rb
rison.gemspec

README.md

rison

A Ruby implementation of Rison - Compact Data in URIs.

Installation

$ gem install rison

Usage

Use Rison.dump to encode Ruby objects as Rison, and Rison.load to decode Rison encoded strings into Ruby objects:

require 'rison'

Rison.dump(true)         # => '!t'

Rison.dump([1, 2, 3])    # => '!(1,2,3)'

Rison.dump({:a => 0})    # => '(a:0)'

Rison.dump(Array)        # => Rison::DumpError

Rison.load('!t')         # => true

Rison.load('!(1,2,3)')   # => [1, 2, 3]

Rison.load('(a:0)')      # => {:a => 0}

Rison.load('abc def')    # => Rison::ParseError