• Stars
    star
    206
  • Rank 184,440 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 14 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BERT (Binary ERlang Term) serialization library for Ruby.

BERT

A BERT (Binary ERlang Term) serialization library for Ruby. It can encode Ruby objects into BERT format and decode BERT binaries into Ruby objects.

See the BERT specification at bert-rpc.org.

Instances of the following Ruby classes will be automatically converted to the proper simple BERT type:

  • Fixnum
  • Float
  • Symbol
  • Array
  • String

Instances of the following Ruby classes will be automatically converted to the proper complex BERT type:

  • NilClass
  • TrueClass
  • FalseClass
  • Hash
  • Time
  • Regexp

To designate tuples, simply prefix an Array literal with a t or use the BERT::Tuple class:

t[:foo, [1, 2, 3]]
BERT::Tuple[:foo, [1, 2, 3]]

Both of these will be converted to (in Erlang syntax):

{foo, [1, 2, 3]}

Installation

gem install bert -s http://gemcutter.org

Usage

require 'bert'

bert = BERT.encode(t[:user, {:name => 'TPW', :nick => 'mojombo'}])
# => "\203h\002d\000\004userh\003d\000\004bertd\000\004dictl\000\000\
      000\002h\002d\000\004namem\000\000\000\003TPWh\002d\000\004nickm\
      000\000\000\amojomboj"

BERT.decode(bert)
# => t[:user, {:name=>"TPW", :nick=>"mojombo"}]

Note on Patches/Pull Requests

  • 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.

Copyright

Copyright (c) 2009 Tom Preston-Werner. See LICENSE for details.

More Repositories

1

chronic

Chronic is a pure Ruby natural language date parser.
Ruby
3,223
star
2

god

Ruby process monitor
Ruby
2,207
star
3

grit

**Grit is no longer maintained. Check out libgit2/rugged.** Grit gives you object oriented read/write access to Git repositories via Ruby.
Ruby
1,966
star
4

clippy

Clippy is a very simple Flash widget that makes it possible to place arbitrary text onto the client's clipboard.
940
star
5

mojombo.github.io

Jekyll source for my personal blog.
HTML
929
star
6

tpw

698
star
7

proxymachine

A simple TCP routing proxy built on EventMachine that lets you configure the routing logic in Ruby.
Ruby
580
star
8

ernie

Ernie is an Erlang/Ruby BERT-RPC Server.
Erlang
460
star
9

erlectricity

Erlectricity exposes Ruby to Erlang and vice versa.
Ruby
347
star
10

tomdoc

A flexible code documentation specification with human readers in mind.
333
star
11

primer

Primer is a Flash-like API built on top of Canvas using jQuery.
JavaScript
280
star
12

mustache.erl

Mustache template engine for Erlang.
Erlang
239
star
13

github-flavored-markdown

GitHub's Flavor of Markdown
182
star
14

bertrpc

BERTRPC is a Ruby BERT-RPC client library.
Ruby
162
star
15

sf-vegetarian-restaurants

A list of awesome vegetarian-friendly restaurants in SF
141
star
16

rakegem

Simple gem and release management with customizable Rake tasks.
Ruby
131
star
17

egitd

The Erlang git-daemon
Erlang
115
star
18

bert.erl

Erlang BERT encoder/decoder
Erlang
98
star
19

asteroids

Destroy your Atom editor, Asteroids style!
JavaScript
94
star
20

gollum-demo

Gollum test repo
Perl
75
star
21

rebar

Ruby to Erlang Bridge And Runner
Erlang
63
star
22

yaws

YAWS is an erlang web server
Erlang
43
star
23

omniship

Ruby API for Shipper APIs (UPS, FedEx, DHL)
Ruby
37
star
24

glowstick

A realtime, OpenGL graphing library for Ruby
Ruby
36
star
25

mastering-git-basics

A presentation on Git basics using ShowOff
JavaScript
35
star
26

octobeer

The GitHub Kegerator
26
star
27

cubesixel

A pixel font (native size 7x7) I made in a different life
26
star
28

vanhelsing

Super streamlined memory profiler with real time graphs for Ruby programs
Ruby
23
star
29

erlang_pipe

A pipe implementation in pure Erlang
Erlang
21
star
30

fixture-scenarios

This plugin allows you to create 'scenarios' which are collections of fixtures and ruby files that represent a context against which you can run tests.
Ruby
18
star
31

v8

C++
18
star
32

scoped

Scope access for multiple services in Ruby. Warning: OLDSCHOOL CODE!
Ruby
10
star
33

pyberry

A tool for systems analysis.
10
star
34

30daysoflaptops.github.io

CSS
8
star
35

mojombo.github.com

Old location of Jekyll source for tom.preston-werner.com
6
star
36

conceptual_algorithms

5
star
37

erlectricity-presentation

5
star
38

endo

Test repo for talk.
4
star
39

fakegem

This is a fake gem so I can test GitHub's gem building when I need to
Ruby
4
star
40

mojombo

3
star