A sane Google Protocol Buffers library for Ruby
A pure-Ruby Google Protocol Buffers library. It's all about being Buf; ProtoBuf.
gem install beefcake…Any object responding to ` 1, :y => 2)
s = "" x.encode(s) s # => "\b\x01\x10\x02)\0"
x.encode # => #
x.encode.to_s # => "\b\x01\x10\x02)\0"
### Decoding
```ruby
# see code example above for the definition of Variety
x = Variety.new(:x => 1, :y => 2)
# You can decode from a Beefcake::Buffer
encoded = x.encode
Variety.decode(encoded) # =>
# Decoding from a String works the same way:
Variety.decode(encoded.to_s) # =>
# You can update a Beefcake::Message instance with new data too:
new_data = Variety.new(x: 12345, y: 2).encode
Variety.decoded(new_data, x)
x # => .proto fileprotoc --beefcake_out output/path -I path/to/proto/files/dir path/to/file.protoYou can set the BEEFCAKE_NAMESPACE variable to generate the classes under a
desired namespace. (i.e. App::Foo::Bar)
Ruby deserves and needs first-class ProtoBuf support. Other libs didn't feel very "Ruby" to me and were hard to parse.
This library was built with EventMachine in mind. Not just blocking-IO.
Source: https://github.com/protobuf-ruby/beefcake
optional :foo, :string, :default => "bar")http://code.google.com/apis/protocolbuffers/docs/encoding.html
rake testBeefcake conducts continuous integration on Travis CI. The current build status for HEAD is .
All pull requests automatically trigger a build request. Please ensure that tests succeed.
Currently Beefcake is tested and working on:
No open issues yet, or sync has not completed.