Skip to content

Commit

Permalink
Adjust ruby generation for external proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
Taucher2003 committed Nov 18, 2024
1 parent 559f6e1 commit 405a0dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion build/ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ namespace :generate_ruby do

Dir["#{output_dir}/*_pb.rb"].each do |file|
code = File.read(file)
code = code.gsub(/require '(\S+)_pb'/, "require_relative '\\1_pb'")
code = code.gsub(/require '(\S+)_pb'/) do |str|
match = Regexp.last_match[1]

if File.exist?("#{output_dir}/#{match}_pb.rb")
"require_relative '#{match}_pb'"
else
str
end
end
File.write(file, code)
end
end
Expand Down

0 comments on commit 405a0dd

Please sign in to comment.