I've been really enjoying developing Ruby applications with Pry. I've also seen a Pry plugin called pry-remote which lets you set up a Drb server for remote access to a Pry session. The pry-remote synopsis in the README makes sense and I have no problem running locally. But how can I use this to, for example, allow a colleague to access the same Pry session in his/her terminal?
If possible, the API I desire would be something like localtunnel:
On computer1:
$ ruby main.rb
[pry-remote] Waiting for client on druby://127.0.0.1:9876
$ drblocaltunnel 9876
share this url:
http://xyz.drblocaltunnel.com
On computer2:
$ drblocaltunnel login -url http://xyz.drblocaltunnel.com
Frame number: 0/4
From: /programming/drb/main.rb @ line 5 Foo#initialize:
4: def initialize(x, y)
=> 5: binding.remote_pry
6: end
You can just use
binding.remote_pry(host_string, port_number)
In your code to bind on host different from localhost. And use pry-remote -s host -p port
to connect to this host from another computer. But pry-remote
opens only one listening socket, so your colleague can only has access if you are not connected yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With