Module: Pry::RbxPath

Defined in:
lib/pry/rbx_path.rb

Class Method Summary collapse

Class Method Details

.convert_path_to_full(path) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/pry/rbx_path.rb', line 8

def convert_path_to_full(path)
  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
  else
    path
  end
end

.is_core_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/pry/rbx_path.rb', line 4

def is_core_path?(path)
  Pry::Helpers::BaseHelpers.rbx? && (path.start_with?("kernel") || path.start_with?("lib")) && File.exist?(convert_path_to_full(path))
end

.rvm_ruby?(path) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/pry/rbx_path.rb', line 18

def rvm_ruby?(path)
  !!(path =~ /\.rvm/)
end