Reputation: 9447
Sometimes I want to experiment using IRB with some objects, but it's might be not that easy to reproduce the state and context that I need. Consider you want to play with syntax of an expression inside RSPec. So I want to implement something like this:
eval_server
eval_client
- it should be implemented)eval_server
eval_client
eval_client
sends it to eval_server
eval_server
evaluates the expression in context of the object where it was invoked, serializes the result or exception (using .inspect
for example), and sends it back to eval_client
eval_client
displays the result...
The question is: if there similar tool already implemented? If not, are there some gems that might help me to implement it?
I know it might look like debugger. But I would prefer not to start rails server with debugger. I just want to add one like in code and have IRB in context of that line at next request.
update:
so according to the answer:
eval_client
= pry-remote
eval_server
= binding.remote_pry
https://github.com/mon-ouie/pry-remote
Upvotes: 2
Views: 226
Reputation: 29895
A Pry plugin called pry-remote can do this:
see: https://github.com/pry/pry/wiki/Remote-sessions
Upvotes: 1