Skip to content

Commit 58f8045

Browse files
committed
reworked load path restoration
1 parent 6d7b806 commit 58f8045

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/rdebug-ide

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ if (options.dispatcher_port != -1)
9999
require_relative '../lib/ruby-debug-ide/multiprocess'
100100
end
101101

102+
ENV['DEBUGGER_STORED_RUBYLIB'] = ENV['RUBYLIB']
102103
old_opts = ENV['RUBYOPT']
103104
ENV['RUBYOPT'] = "-r#{File.expand_path(File.dirname(__FILE__))}/../lib/ruby-debug-ide/multiprocess/starter"
104105
ENV['RUBYOPT'] += " #{old_opts}" if old_opts

lib/ruby-debug-ide/multiprocess/starter.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
if ENV['IDE_PROCESS_DISPATCHER']
22
require 'rubygems'
3-
$: << File.expand_path(File.dirname(__FILE__)) + "../.."
3+
ENV['DEBUGGER_STORED_RUBYLIB'].split(File::PATH_SEPARATOR).each do |path|
4+
next unless path =~ /ruby-debug-ide|ruby-debug-base|linecache/
5+
$LOAD_PATH << path
6+
end
47
require 'ruby-debug-ide'
58
require 'ruby-debug-ide/multiprocess'
69
Debugger::MultiProcess::pre_child

0 commit comments

Comments
 (0)