simulacre/pry-remote-em — pull request #44 by nbudin (2013-09-20 16:08:52+00:00)
Title: Support Ctrl-D to terminate session

pry-remote-em currently blows up if you press Ctrl-D, with:

```
/Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/pry-remote-em-0.7.5/lib/pry-remote-em/client.rb:250:in `block in readline': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:951:in `call'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:951:in `run_deferred_callbacks'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/pry-remote-em-0.7.5/bin/pry-remote-em:64:in `'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/bin/pry-remote-em:23:in `load'
from /Users/nbudin/.rbenv/versions/2.0.0-p195/bin/pry-remote-em:23:in `

'
```

This patch simply checks if the line passed to the callback is nil, and if so, assumes the user pressed Ctrl-D to end the session.