2011-09-19 04:18:57 -04:00
|
|
|
class Pry
|
|
|
|
module RbxPath
|
|
|
|
module_function
|
|
|
|
def is_core_path?(path)
|
2013-05-10 03:42:55 -04:00
|
|
|
Pry::Helpers::BaseHelpers.rbx? && (path.start_with?("kernel") || path.start_with?("lib")) && File.exist?(convert_path_to_full(path))
|
2011-09-19 04:18:57 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def convert_path_to_full(path)
|
2012-02-28 09:03:41 -05:00
|
|
|
if path.start_with?("kernel")
|
|
|
|
File.join File.dirname(Rubinius::KERNEL_PATH), path
|
|
|
|
elsif path.start_with?("lib")
|
|
|
|
File.join File.dirname(Rubinius::LIB_PATH), path
|
2012-03-01 09:59:27 -05:00
|
|
|
else
|
|
|
|
path
|
2011-09-19 04:18:57 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def rvm_ruby?(path)
|
|
|
|
!!(path =~ /\.rvm/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|