| Index: third_party/protobuf/ruby/README.md
|
| diff --git a/third_party/protobuf/ruby/README.md b/third_party/protobuf/ruby/README.md
|
| index 16474322e44d69c7a27ccc71a5948dbb7b02b5a7..f28e05a72b8f453894e711311221a7f8ca317afb 100644
|
| --- a/third_party/protobuf/ruby/README.md
|
| +++ b/third_party/protobuf/ruby/README.md
|
| @@ -32,23 +32,25 @@ documentation may be found in the RubyDoc comments (`call-seq` tags) in the
|
| source, and we plan to release separate, more detailed, documentation at a
|
| later date.
|
|
|
| - require 'google/protobuf'
|
| +```ruby
|
| +require 'google/protobuf'
|
|
|
| - # generated from my_proto_types.proto with protoc:
|
| - # $ protoc --ruby_out=. my_proto_types.proto
|
| - require 'my_proto_types'
|
| +# generated from my_proto_types.proto with protoc:
|
| +# $ protoc --ruby_out=. my_proto_types.proto
|
| +require 'my_proto_types'
|
|
|
| - mymessage = MyTestMessage.new(:field1 => 42, :field2 => ["a", "b", "c"])
|
| - mymessage.field1 = 43
|
| - mymessage.field2.push("d")
|
| - mymessage.field3 = SubMessage.new(:foo => 100)
|
| +mymessage = MyTestMessage.new(:field1 => 42, :field2 => ["a", "b", "c"])
|
| +mymessage.field1 = 43
|
| +mymessage.field2.push("d")
|
| +mymessage.field3 = SubMessage.new(:foo => 100)
|
|
|
| - encoded_data = MyTestMessage.encode(mymessage)
|
| - decoded = MyTestMessage.decode(encoded_data)
|
| - assert decoded == mymessage
|
| +encoded_data = MyTestMessage.encode(mymessage)
|
| +decoded = MyTestMessage.decode(encoded_data)
|
| +assert decoded == mymessage
|
|
|
| - puts "JSON:"
|
| - puts MyTestMessage.encode_json(mymessage)
|
| +puts "JSON:"
|
| +puts MyTestMessage.encode_json(mymessage)
|
| +```
|
|
|
| Installation from Source (Building Gem)
|
| ---------------------------------------
|
|
|