teach protoc-gen-ruby PB_{DUMP,LOAD}_REQUEST_BYTES #307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, thenpry
would get the command to close at the end of the stdin input.