2009-10-08 08:14:40 +04:00
|
|
|
BERT
|
|
|
|
====
|
2009-10-08 06:18:16 +04:00
|
|
|
|
2009-10-08 08:14:40 +04:00
|
|
|
BERT is a BERT (Binary ERlang Term) serialization library for Ruby. It can
|
|
|
|
encode Ruby objects into BERT format and decode BERT binaries into Ruby
|
|
|
|
objects.
|
|
|
|
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
|
|
|
gem install bert -s http://gemcutter.org
|
|
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
require 'bert'
|
|
|
|
|
2009-10-08 08:43:52 +04:00
|
|
|
bert = BERT.encode([:user, {:name => 'TPW', :nick => 'mojombo'}])
|
|
|
|
# => "\203h\002d\000\004userh\003d\000\004dict
|
|
|
|
h\002d\000\004namem\000\000\000\003TPWh\002d
|
|
|
|
\000\004nickm\000\000\000\amojombo"
|
|
|
|
|
|
|
|
BERT.decode(bert)
|
|
|
|
# => [:user, {:name => 'TPW', :nick => 'mojombo'}]
|
|
|
|
|
2009-10-08 08:14:40 +04:00
|
|
|
|
|
|
|
|
|
|
|
Note on Patches/Pull Requests
|
|
|
|
-----------------------------
|
2009-10-08 06:18:16 +04:00
|
|
|
|
|
|
|
* Fork the project.
|
|
|
|
* Make your feature addition or bug fix.
|
|
|
|
* Add tests for it. This is important so I don't break it in a
|
|
|
|
future version unintentionally.
|
|
|
|
* Commit, do not mess with rakefile, version, or history.
|
|
|
|
(if you want to have your own version, that is fine but
|
|
|
|
bump version in a commit by itself I can ignore when I pull)
|
|
|
|
* Send me a pull request. Bonus points for topic branches.
|
|
|
|
|
2009-10-08 08:14:40 +04:00
|
|
|
|
|
|
|
Copyright
|
|
|
|
---------
|
2009-10-08 06:18:16 +04:00
|
|
|
|
|
|
|
Copyright (c) 2009 Tom Preston-Werner. See LICENSE for details.
|