From 7cc5176d9395372b1aea8dcdcda508bab64a4538 Mon Sep 17 00:00:00 2001 From: John Mair Date: Tue, 15 Nov 2011 03:16:38 +1300 Subject: [PATCH] made initial_session_setup test for initial_session? inside itself --- lib/pry/pry_class.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 2d05b7bb..98f8a171 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -77,6 +77,9 @@ class Pry # Including: loading .pryrc, loading plugins, loading requires, and # loading history. def self.initial_session_setup + + return if !initial_session? + # note these have to be loaded here rather than in pry_instance as # we only want them loaded once per entire Pry lifetime, not # multiple times per each new session (i.e in debugging) @@ -98,9 +101,7 @@ class Pry # Pry.start(Object.new, :input => MyInput.new) def self.start(target=TOPLEVEL_BINDING, options={}) target = Pry.binding_for(target) - if initial_session? - initial_session_setup - end + initial_session_setup Pry.config.hooks.exec_hook(:when_started, target) new(options).repl(target)