Method: Pry.load_file_at_toplevel

Defined in:
lib/pry/pry_class.rb

.load_file_at_toplevel(file) ⇒ Object

Load the given file in the context of ‘Pry.toplevel_binding`

Parameters:

  • file (String)

    The unexpanded file path.



69
70
71
72
73
# File 'lib/pry/pry_class.rb', line 69

def self.load_file_at_toplevel(file)
  toplevel_binding.eval(File.read(file), file)
rescue RescuableException => e
  puts "Error loading #{file}: #{e}\n#{e.backtrace.first}"
end