Module: Pry::RbxPath

Defined in:
lib/pry/rbx_path.rb

Class Method Summary collapse

Instance 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



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



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

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

Instance Method Details

#convert_path_to_full(path) ⇒ Object (private)



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) ⇒ Object (private)



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) ⇒ Object (private)



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

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