Reputation: 16242
The pry edit Class#method
command is a nice feature that allows you to jump directly into the source code of any loaded file, edit it, and jump back into pry with the changes loaded when you quit.
But sometimes I don't want to permanently edit the actual file on the file system. Instead, I want everything to work the way edit command does currently, but I want the actual file system file to revert to what it was prior to my editing it, after the edited version is loaded into pry.
For example, I might want to patch some gem to see how it works, or play around with it, but leave everything intact after I'm done playing. Is there a good way to accomplish this in pry?
Upvotes: 1
Views: 417