From 6038057a9d22dd3c09134fab2070daae4435f7bc Mon Sep 17 00:00:00 2001 From: John Mair Date: Fri, 15 Apr 2011 15:58:29 +1200 Subject: [PATCH] added Pry#show --- lib/pry/pry_instance.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 31381b1c..77e6d4d8 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -143,7 +143,7 @@ class Pry target = Pry.binding_for(target) result = re(target) - print.call output, result if should_print?(result) + show(result) if should_print?(result) end # Perform a read-eval @@ -193,13 +193,17 @@ class Pry loop do val = retrieve_line(eval_string, target) process_line(val, eval_string, target) - break if valid_expression?(eval_string) && !null_input?(val) + break if valid_expression?(eval_string) && !null_input?(val) || input.eof? end @suppress_output = true if eval_string =~ /;\Z/ eval_string - end + end + + def show(result) + print.call output, result + end # Returns true if input is "" and a command is not returning a # value.