diff --git a/lib/pry/helpers/command_helpers.rb b/lib/pry/helpers/command_helpers.rb index 354caf25..2ede8020 100644 --- a/lib/pry/helpers/command_helpers.rb +++ b/lib/pry/helpers/command_helpers.rb @@ -30,9 +30,10 @@ class Pry file = target.eval('__FILE__') line_num = target.eval('__LINE__') if rbx? - if file =~ /__unknown__/ - file = RbxPath.convert_path_to_full(target.variables.method.file.to_s) + if !target.instance_variable_defined?(:@__actual_file__) + target.instance_variable_set(:@__actual_file__, RbxPath.convert_path_to_full(target.variables.method.file.to_s)) end + file = target.instance_variable_get(:@__actual_file__).to_s end [file, line_num] diff --git a/lib/pry/rbx_path.rb b/lib/pry/rbx_path.rb index b3d4fa01..a1e4a817 100644 --- a/lib/pry/rbx_path.rb +++ b/lib/pry/rbx_path.rb @@ -10,6 +10,8 @@ class Pry File.join File.dirname(Rubinius::KERNEL_PATH), path elsif path.start_with?("lib") File.join File.dirname(Rubinius::LIB_PATH), path + else + path end end