I just wrote a scraper process. This is a separate file program - it loads ActiveRecord, creates a pair of models, defines a pair of scrambling functions and then starts in a loop.
Unfortunately, I messed up the git command and now the file itself is gone.
However, I have one instance of the scraper that is currently working. I sent SIGSTOP to prevent possible errors.
How can I connect to a process and make it dump code so that I can copy it back to a .rb file?
I do not need its stack trace or other random objects in RAM; they are completely unimportant, as they are written to be killed at any time without loss. I just want not to rewrite this damn thing.
https://github.com/ileitch/hijack it seems that it will allow me to attach a debugger to the running process, which is a good first step. But if I do, then what?
FWIW, I was able to restore ~ ββ60 lines using puts Readline::HISTORY.to_a.reverse.uniq.reverse from the irb console in which I played with the code. But I would prefer everything if I can.
Thanks!
ETA: https://github.com/ngty/sourcify is another possible link.
ETA2: ... phew, Dropbox caught him. You should have thought to check it out earlier. > & L;
So, no longer critical, but still curious if this can be done.
source share