# File lib/pry/pry_class.rb, line 108 def self.start(target=TOPLEVEL_BINDING, options={}) target = Pry.binding_for(target) initial_session_setup # create the Pry instance to manage the session pry_instance = new(options) # save backtrace pry_instance.backtrace = caller # if Pry was started via binding.pry, elide that from the backtrace. pry_instance.backtrace.shift if pry_instance.backtrace.first =~ /pry.*core_extensions.*pry/ # yield the binding_stack to the hook for modification pry_instance.exec_hook( :when_started, target, options, pry_instance ) if !pry_instance.binding_stack.empty? head = pry_instance.binding_stack.pop else head = target end # Enter the matrix pry_instance.repl(head) end