From d5ffd4681156381ef91843ca703998516421a2ab Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 27 Jul 2011 23:21:53 +1200 Subject: [PATCH] requireing tempfile now in introspection.rb (for edit -t); also made a couple of minor changes --- lib/pry/default_commands/introspection.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/pry/default_commands/introspection.rb b/lib/pry/default_commands/introspection.rb index d602f71c..ae54aee9 100644 --- a/lib/pry/default_commands/introspection.rb +++ b/lib/pry/default_commands/introspection.rb @@ -1,3 +1,5 @@ +require 'tempfile' + class Pry module DefaultCommands @@ -146,14 +148,14 @@ class Pry invoke_editor(file_name, line) set_file_and_dir_locals(file_name) - if should_reload - silence_warnings do - context.eval(File.read(file_name)) - end - elsif opts[:p] + if opts[:p] silence_warnings do Pry.active_instance.input = StringIO.new(File.readlines(file_name).join) end + elsif should_reload + silence_warnings do + context.eval(File.read(file_name)) + end end end