mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
accept_eof -> accept_line(nil)
This commit is contained in:
parent
9d48aba5b8
commit
37b2f20a34
3 changed files with 8 additions and 7 deletions
|
@ -235,11 +235,12 @@ class Pry
|
|||
@eval_string = ""
|
||||
end
|
||||
|
||||
def accept_eof
|
||||
Pry.config.control_d_handler.call(@eval_string, self)
|
||||
end
|
||||
|
||||
def accept_line(line)
|
||||
if line.nil?
|
||||
Pry.config.control_d_handler.call(@eval_string, self)
|
||||
return
|
||||
end
|
||||
|
||||
@suppress_output = false
|
||||
inject_sticky_locals!
|
||||
ensure_correct_encoding!(line)
|
||||
|
|
|
@ -56,7 +56,7 @@ class Pry
|
|||
pry.reset_line
|
||||
when :end_of_file
|
||||
output.puts "" if output.tty?
|
||||
pry.accept_eof
|
||||
pry.accept_line nil
|
||||
else
|
||||
pry.accept_line val
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ describe Pry::DEFAULT_CONTROL_D_HANDLER do
|
|||
instance.binding_stack.should.not.be.empty
|
||||
called = false
|
||||
catch(:breakout) {
|
||||
instance.accept_eof
|
||||
instance.accept_line(nil)
|
||||
called = true
|
||||
}
|
||||
called.should == false
|
||||
|
@ -34,7 +34,7 @@ describe Pry::DEFAULT_CONTROL_D_HANDLER do
|
|||
t = pry_tester
|
||||
t.eval "cd Object.new"
|
||||
t.eval("_pry_.binding_stack.size").should == 2
|
||||
t.eval("_pry_.accept_eof")
|
||||
t.eval("_pry_.accept_line(nil)")
|
||||
t.eval("_pry_.binding_stack.size").should == 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue