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.
This commit is contained in:
yui-knk 2014-01-26 01:07:48 +09:00
parent c7386aebc2
commit f83ee346fc
1 changed files with 5 additions and 0 deletions

View File

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