Minor whitespace fixes and test fixups.

pull/9121/head
Joshua Haberman 3 years ago
parent 4c445b1803
commit bb5a2684de
  1. 3
      src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb
  2. 3
      src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb
  3. 10
      src/google/protobuf/compiler/ruby/ruby_generator.cc

@ -1,9 +1,10 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ruby_generated_code.proto
require 'ruby_generated_code_proto2_import_pb'
require 'google/protobuf'
require 'ruby_generated_code_proto2_import_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("ruby_generated_code.proto", :syntax => :proto3) do
add_message "A.B.C.TestMessage" do

@ -1,9 +1,10 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ruby_generated_code_proto2.proto
require 'ruby_generated_code_proto2_import_pb'
require 'google/protobuf'
require 'ruby_generated_code_proto2_import_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("ruby_generated_code_proto2.proto", :syntax => :proto2) do
add_message "A.B.C.TestMessage" do

@ -507,11 +507,13 @@ bool GenerateFile(const FileDescriptor* file, io::Printer* printer,
"\n",
"filename", file->name());
printer->Print(
"require 'google/protobuf'\n\n");
printer->Print("require 'google/protobuf'\n\n");
for (int i = 0; i < file->dependency_count(); i++) {
printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name()));
if (file->dependency_count() != 0) {
for (int i = 0; i < file->dependency_count(); i++) {
printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name()));
}
printer->Print("\n");
}
// TODO: Remove this when ruby supports extensions for proto2 syntax.

Loading…
Cancel
Save