Experiments on how to display variables from pry sessions in another window.
It currently works by dumping some pry command outputs to a custom file, e.g.
~/.pry_locals
for the Pry::Command::Ls::LocalVars
command, and having
another process watch and read from that file to display it in another window.
- Copy the contents from
hooks.rb
to~/.pryrc
or require the file from within~/.pryrc
. - Copy
pry-watch-locals
to somewhere in your path or link to it, e.g.ln -sr pry-watch-locals /usr/local/bin/pry-watch-locals
- Launch
pry-watch-locals
in some other terminal window / split / tmux pane / whatever. - Launch a
pry
session and play around.
Note that this will result in a text file at ~/.pry_locals
that will be
overwritten on consecutive variable dumps.
- Easier installation (can this be shipped as a Pry plugin?)
- Dump non-local vars as well