Actions
Bug #3843
closedruby -r tracer prog.rb no longer tracers prog.rb
Description
=begin
The problem appears to be at the end of tracer.rb:
if $0 == FILE
direct call¶
$0 = ARGV[0]
ARGV.shift
Tracer.on
require $0
elsif caller.size <= 1
Tracer.on
end
IN 1.9.2, caller() at this point is 2 deep:
["internal:lib/rubygems/custom_require:29:in require'", "<internal:lib/rubygems/custom_require>:29:in
require'"]
The following change seems to fix it, but it feels a little hacky..
if $0 == FILE
direct call¶
$0 = ARGV[0]
ARGV.shift
Tracer.on
require $0
elsif caller.size <= 2 && caller.all? {|place| place =~ /custom_require/}
Tracer.on
end
Dave
=end
Actions
Like0
Like0