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 = ""
|
@eval_string = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept_eof
|
def accept_line(line)
|
||||||
|
if line.nil?
|
||||||
Pry.config.control_d_handler.call(@eval_string, self)
|
Pry.config.control_d_handler.call(@eval_string, self)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept_line(line)
|
|
||||||
@suppress_output = false
|
@suppress_output = false
|
||||||
inject_sticky_locals!
|
inject_sticky_locals!
|
||||||
ensure_correct_encoding!(line)
|
ensure_correct_encoding!(line)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Pry
|
||||||
pry.reset_line
|
pry.reset_line
|
||||||
when :end_of_file
|
when :end_of_file
|
||||||
output.puts "" if output.tty?
|
output.puts "" if output.tty?
|
||||||
pry.accept_eof
|
pry.accept_line nil
|
||||||
else
|
else
|
||||||
pry.accept_line val
|
pry.accept_line val
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe Pry::DEFAULT_CONTROL_D_HANDLER do
|
||||||
instance.binding_stack.should.not.be.empty
|
instance.binding_stack.should.not.be.empty
|
||||||
called = false
|
called = false
|
||||||
catch(:breakout) {
|
catch(:breakout) {
|
||||||
instance.accept_eof
|
instance.accept_line(nil)
|
||||||
called = true
|
called = true
|
||||||
}
|
}
|
||||||
called.should == false
|
called.should == false
|
||||||
|
@ -34,7 +34,7 @@ describe Pry::DEFAULT_CONTROL_D_HANDLER do
|
||||||
t = pry_tester
|
t = pry_tester
|
||||||
t.eval "cd Object.new"
|
t.eval "cd Object.new"
|
||||||
t.eval("_pry_.binding_stack.size").should == 2
|
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
|
t.eval("_pry_.binding_stack.size").should == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue