1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

added Pry#show

This commit is contained in:
John Mair 2011-04-15 15:58:29 +12:00
parent f5286e180e
commit 6038057a9d

View file

@ -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.