Project

rson

0.0
No commit activity in last 3 years
No release in over 3 years
JSON like serialization with simple Ruby objects support
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1

Runtime

 Project Readme

Ruby Simple Object's Notation

Build Status Gem Version Code Climate Test Coverage Issue Count

RSON convert a string representation of Ruby simple objects to Ruby objects. It does not use eval() but the parser gem to really parse strings.

Supported Types :

  • Integer
  • Float
  • Symbol
  • String (multi-line)
  • Nil
  • TrueClass
  • FalseClass
  • Array
  • Hash

Examples

Loading from a string

require 'rson'

buffer = %q({ a: 1, 2 => true, 'c' => :d })
Serializer::RSON.load(buffer:buffer) # => { a: 1, 2 => true, 'c' => :d }

Loading from a file

require 'rson'

Serializer::RSON.load(
  file_name:'config.rson',
  file_path:'/etc/some_application'
) # => { a: 1, 2 => true, 'c' => :d }

Installation

gem install rson