Commit Graph

8 Commits

Author SHA1 Message Date
Conrad Irwin a28b2b087c Fix Ctrl-D in nested pry's
I'm not convinced this is the correct fix, but it seems to mostly
preserve existing behaviour.
2012-12-28 10:00:33 -08:00
Conrad Irwin bf3024bc73 Merge branch 'master' into wip.refactor
Conflicts:
	lib/pry.rb
	spec/command_integration_spec.rb
	spec/control_d_handler_spec.rb
2012-12-28 06:55:59 -08:00
Ryan Fitzgerald 1ea1927b43 Rename `accept_line` to `eval` 2012-12-27 22:06:50 -08:00
Conrad Irwin 4d4c0ab6b2 Pry.accept_line returns a 'should continue?' boolean 2012-12-21 00:41:53 -08:00
Conrad Irwin 37b2f20a34 accept_eof -> accept_line(nil) 2012-12-21 00:40:23 -08:00
Conrad Irwin eeb67684d0 Add Pry::Driver to handle the reading and looping 2012-12-20 01:34:32 -08:00
Kyrylo Silin c7b28efc24 Fix ^D press in nested REPLs
The interesting moment is that `cd -` is still a bit dorky.

  [1] pry(main)> _pry_.repl :a
  [2] pry(:a):1> _pry_.repl :b
  [3] pry(:b):2> cd -
  [4] pry(:b):2> cd -
  [5] pry(:b):2>

The problem is that `_pry_.repl` pushes a new binding onto
`binding_stack`, however, it knows nothing about `old_stack`.

Well, there is a workaround for this.

  [1] pry(main)> _pry_.repl :a
  [2] pry(:a):1> ^D
  [3] pry(main)> cd -
  [4] pry(:a):1> cd -
  [5] pry(main)>

Fix "undefined method `old_stack=' for nil:NilClass" error in this
commit, when you press ^D in a nested REPL. Add a test case for this.
Rewrite some comments and old Control-D units tests (so they use newer
test API).

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-15 03:23:24 +02:00
☈king 848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00