ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
463 stars 101 forks source link

teach protoc-gen-ruby PB_{DUMP,LOAD}_REQUEST_BYTES #307

Open embark opened 8 years ago

embark commented 8 years ago

PB_DUMP_REQUEST_BYTES=foo.bin protoc foo.proto --plugin=protoc-gen-gem=bin/protoc-gen-ruby --gem_out=. will dump the raw proto request bytes generated by protoc for foo.proto to foo.bin FUTURE USE CASE: functional tests to come that rely on checked-in bin files

PB_LOAD_REQUEST_BYTES=foo.bin bin/protoc-gen-ruby will read the raw request bytes from foo.bin and print the generated code (actually it is the code gen response proto, but it is still readable) to STDOUT CURRENT USE CASE: makes it so you can use pry when testing code generation. If you gave the code generator input from stdin, then pry would get the command to close at the end of the stdin input.

embark commented 7 years ago

Rebased this! Should be good to go. Will be useful now that we have some bins checked in for functional tests