- Download and setup Protocol Buffer release from https://github.com/protocolbuffers/protobuf/releases (if you haven't already done this for another language). As of February 2019 we're using v3.7 release, which is compatible with proto2 .proto files.
- Install the Google protobuf Ruby gem using
gem install google-protobuf
- Download and install Ruby
gem install rspec
to install rspec unit testing tool
FIXME: As of February 2019, the official google-protobuf
Google protoc tool doesn't support extensions in proto2 files. A 3rd party tool, ruby-protocol-buffers, can be installed using gem install ruby-protocol-buffers
, but doesn't seem to match the existing structure of the Ruby GTFS-rt bindings, as the unit tests fail. As a result we are deprecating the Ruby bindings until official support for proto2 files is implemented in the Google protocol buffer tools.
Regenerate the language binding source from gtfs-realtime.proto by running the following from the ruby
directory:
protoc --ruby_out=lib/google/transit/gtfs-realtime.pb.rb --proto_path=.. ../gtfs-realtime.proto
Add the license header back to the generated source file.
Test the generated code:
rspec
Update the version number in gtfs-realtime-bindings.gemspec
.
?
Build and deploy the gem to rubygems.org
gem build gtfs-realtime-bindings.gemspec
gem push gtfs-realtime-bindings-0.0.1.gem