From fd1a3033850738592573b92c25c1875273bf3e73 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Thu, 8 Aug 2024 19:56:23 +0200 Subject: [PATCH] Remove load path modification --- build/ruby/Rakefile | 5 +++++ build/ruby/lib/tucana.rb | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/ruby/Rakefile b/build/ruby/Rakefile index 4750337..c79660b 100644 --- a/build/ruby/Rakefile +++ b/build/ruby/Rakefile @@ -27,6 +27,11 @@ namespace :generate_ruby do system!("bundle exec grpc_tools_ruby_protoc -I #{INPUT_INTERNAL_DIR} --ruby_out=#{OUTPUT_INTERNAL_DIR} --grpc_out=#{OUTPUT_INTERNAL_DIR} #{file}") # rubocop:enable Layout/LineLength end + Dir["#{OUTPUT_INTERNAL_DIR}/*_pb.rb"].each do |file| + code = File.read(file) + code = code.gsub(/require '(\S+)_pb'/, "require_relative '\\1_pb'") + File.write(file, code) + end end end diff --git a/build/ruby/lib/tucana.rb b/build/ruby/lib/tucana.rb index fc3020f..47998d7 100644 --- a/build/ruby/lib/tucana.rb +++ b/build/ruby/lib/tucana.rb @@ -8,7 +8,6 @@ class Error < StandardError; end def self.load_protocol(protocol) this_dir = File.expand_path(File.dirname(__FILE__)) protocol_dir = File.join(this_dir, "tucana/#{protocol}") - $LOAD_PATH.unshift(protocol_dir) unless $LOAD_PATH.include?(protocol_dir) Dir["#{protocol_dir}/*_pb.rb"].each { |file| require file } end