From f83ee346fc1f93b307a8607184bafefcfebafb58 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 26 Jan 2014 01:07:48 +0900 Subject: [PATCH] Go to interactive_mode end-of-input is raised When pry is run with file which causes syntax error (expecting end-of-input), gose to interactive_mode. This is same when other errors are raised. This commit will fix #1098. --- lib/pry/repl_file_loader.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pry/repl_file_loader.rb b/lib/pry/repl_file_loader.rb index b587cb2e..f1ffe035 100644 --- a/lib/pry/repl_file_loader.rb +++ b/lib/pry/repl_file_loader.rb @@ -44,6 +44,11 @@ class Pry content.lines.each do |line| break unless _pry_.eval line, :generated => true end + + unless _pry_.eval_string.empty? + _pry_.output.puts "#{_pry_.eval_string}...exception encountered, going interactive!" + interactive_mode(_pry_) + end end # Define a few extra commands useful for flipping back & forth