Skip to content

Commit bb5a268

Browse files
committed
Minor whitespace fixes and test fixups.
1 parent 4c445b1 commit bb5a268

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/google/protobuf/compiler/ruby/ruby_generator.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,13 @@ bool GenerateFile(const FileDescriptor* file, io::Printer* printer,
507507
"\n",
508508
"filename", file->name());
509509

510-
printer->Print(
511-
"require 'google/protobuf'\n\n");
510+
printer->Print("require 'google/protobuf'\n\n");
512511

513-
for (int i = 0; i < file->dependency_count(); i++) {
514-
printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name()));
512+
if (file->dependency_count() != 0) {
513+
for (int i = 0; i < file->dependency_count(); i++) {
514+
printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name()));
515+
}
516+
printer->Print("\n");
515517
}
516518

517519
// TODO: Remove this when ruby supports extensions for proto2 syntax.

0 commit comments

Comments
 (0)