protobuf/ruby
Chris Fallin 3f3820d8f8 Two tests for Ruby code generator:
- A golden-file test that ensures protoc produces known-valid output.
- A Ruby test that loads that golden file and ensures it actually works
  with the extension.

This split strategy allows us to test end-to-end without needing to
integrate the Ruby gem build system and the protoc build system. This is
desirable because we do not want a gem build/install to depend on
building protoc, and we do not want building protoc to depend on
building and testing the gem.
2015-01-14 15:44:46 -08:00
..
ext/google/protobuf_c Support oneofs in MRI Ruby C extension. 2015-01-14 14:35:57 -08:00
lib/google Rename protobuf Ruby module to google/protobuf and rework its build 2014-12-12 15:58:26 -08:00
tests Two tests for Ruby code generator: 2015-01-14 15:44:46 -08:00
google-protobuf.gemspec Two tests for Ruby code generator: 2015-01-14 15:44:46 -08:00
Rakefile Rename protobuf Ruby module to google/protobuf and rework its build 2014-12-12 15:58:26 -08:00
README.md Provide a Ruby extension. 2014-12-09 16:55:59 -08:00

This directory contains the Ruby extension that implements Protocol Buffers functionality in Ruby.

The Ruby extension makes use of generated Ruby code that defines message and enum types in a Ruby DSL. You may write definitions in this DSL directly, but we recommend using protoc's Ruby generation support with .proto files. The build process in this directory only installs the extension; you need to install protoc as well to have Ruby code generation functionality.

Installation

To build this Ruby extension, you will need:

  • Rake
  • Bundler
  • Ruby development headers
  • a C compiler
  • the upb submodule

First, ensure that upb/ is checked out:

$ cd ..   # top level protobuf directory
$ git submodule init
$ git submodule update

Then install the required Ruby gems:

$ sudo gem install bundler rake rake-compiler rspec rubygems-tasks

Then build the Gem:

$ rake gem
$ gem install pkg/protobuf-$VERSION.gem