Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for descriptor_pb.rb: google/protobuf should be required first. #9121

Merged
merged 2 commits into from Oct 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/google/protobuf/compiler/ruby/ruby_generator.cc
Expand Up @@ -467,8 +467,6 @@ void EndPackageModules(int levels, io::Printer* printer) {

bool GenerateDslDescriptor(const FileDescriptor* file, io::Printer* printer,
std::string* error) {
printer->Print(
"require 'google/protobuf'\n\n");
printer->Print("Google::Protobuf::DescriptorPool.generated_pool.build do\n");
printer->Indent();
printer->Print("add_file(\"$filename$\", :syntax => :$syntax$) do\n",
Expand Down Expand Up @@ -509,6 +507,9 @@ bool GenerateFile(const FileDescriptor* file, io::Printer* printer,
"\n",
"filename", file->name());

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()));
}
Expand Down